Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8740553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:08:59+00:00 2026-06-13T11:08:59+00:00

Is there a way to give my links all variables in an object? The

  • 0

Is there a way to give my links all variables in an object? The purpose of this is to make the links book-markable. The important information to re-build the screen will all be in the URL.

My work-around introduces a session and url re-writing. This is a link that will add or change the industry variable in my object s:

<a href="@{Stocks.index()}?s.industry=${roeBean.industry?.urlEncode()}">

When the link is clicked, Stocks.index is called accepting the object s as its parameter. That receives the s.industry data and all other values in s are null. So, I can then merge the s parameter with another copy of s saved in the session. The cache is then updated and the URL re-written.

It works great, but it would be more elegant if the play framework had something to simply expand the state object and change a variable (just for the link). Is there an clean way to do this? I imaging this would be very useful.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:09:00+00:00Added an answer on June 13, 2026 at 11:09 am

    Would just creating a new controller method (not index) for the purpose of just updating industry work? The follow will work when passed the s.id and the s.industry to be added (or if exists replaced if that’s what you’re looking to do).

    In your view:
    (send the view the s object but it seems like you do that now) (also, I’m using the groovy template helper, you can use the html if you want, same results)

    #{a @Stocks.index(s.id, s.industry=roeBean.industry) } Add This Industry {/a}
    

    In your controller:
    (Replace String with whatever Industry is)

    public static void addIndustry(Long id, String industry) {
        Stock s = Search.findById(id);
        String i = industry;
        //Do your stuff
        s.save();
    }
    

    Passing a static string here (or other stuff) works too. so s.industry=’test’ will GET id=1 and industry=test in this example.

    If you want your links to have all properties of an object, can you not just send the whole object? Passing the entire key/value bit of every property in an object seems like a lot of work if you just want the entire object? So in this example:

    when you render the view from your controller

    render(s);
    

    the link?

    #{a @Stocks.index(s, s.industry=roeBean.industry) } Add This Industry {/a}
    

    In your controller to save:

    public static void addIndustry(Stock s, String industry) {
        //Do your stuff
        s.save();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to give a form a special error rendering function in
I was wondering is there a way to give the user a small guided
Is there a standard/common way to give compiler-style error messages that point to a
I was wondering if there is a way to draw an image but give
Is there any straight forward way to do that? I want to give an
Is there way to automatically maximize the output window on hitting build and then
If there are no compile time binding in java, do this mean all binding
I'm wondering if there's a way to list all custom taxonomies that are siblings
What is a good way to give the input field below the three characteristics
Is there way to get file from windows xp command prompt? I tried to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.