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 6351511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:01:20+00:00 2026-05-24T22:01:20+00:00

To keep it simple, the basic functions of my application are a search interface

  • 0

To keep it simple, the basic functions of my application are a search interface with a form for searching results. The app fetches these results via SOAP from another app.

On the search controller I need the ability to specify some parameters in the redirect that won’t show up in the url of the results page and others that will. Here’s an example of the what the redirect looks like:

return new ModelAndView(new RedirectView(/results?q=blah, true));

As you can see I need the q param to be included. But I also need other parameters that I don’t want to show up on the results page url.

My app needs the ability to have multiple searches within one browser session. For example, having multiple tabs all searching at the same time. So the session object is abstracted to contain a map of session state objects. These hold state data for each search. A new session state is created each time a request is made to the search controller. This session state is then fetched by the results controller.

Our bookmarking process needs to be completely state free. So a person should be able to bookmark the results page url or copy and paste the url into a new tab or another browser. When the results url is executed, the results controller executes a new search.

My problem is this:
I need a way for the results controller to know whether the request is coming from a redirect in the search controller or from a (bookmark/copy & paste). That way it can grab the existing session state data or execute a new search. If I can pass a hidden parameter in the redirect from the search controller such as “requester”, then I can use simple logic in the results controller to look for an existing session state or fire a new search.

Thanks

EDIT: What about passing data from one controller to the other without putting it in the url. Such as accessing model data passed from the search controller redirect in the results controller instead of the results view? Here’s a constructor with the option to hide the model attributes.

/**
 * Create a new RedirectView with the given URL.
 * @param url the URL to redirect to
 * @param contextRelative whether to interpret the given URL as
 * relative to the current ServletContext
 * @param http10Compatible whether to stay compatible with HTTP 1.0 clients
 * @param exposeModelAttributes whether or not model attributes should be
 * exposed as query parameters
 */
public RedirectView(String url, boolean contextRelative, boolean http10Compatible, boolean exposeModelAttributes)

Is there another way to pass data from one controller to the other?

  • 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-05-24T22:01:23+00:00Added an answer on May 24, 2026 at 10:01 pm

    An HTTP redirect response, normally designated by a 301 response code, contains a URI in its Location header that a client should request in order to find the specified resource. There’s no way to tell the client anything else about the request to be made, only the URI it should request. Therefore only things that can go in the URI can be sent back in a redirect. You could make some guesses based on the Referer header, but that’s no guarantee.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

To keep things simple, we have a few aspx pages... Page1.aspx - resets Session
To keep things simple, please allow the assumption that some code requires the use
Well, just to keep it simple: I have a webform. On it a button
I'm creating a threaded message board and I'm trying to keep it simple. There's
For various reasons, such as cookies, SEO, and to keep things simple, I would
I want to keep the class simple and not defined a constructor so i
I will try to keep this as simple as possible. I have a rather
How can you keep track of time in a simple embedded system, given that
I'm trying to do a simple erase and keep getting errors. Here is the
I'm trying to get basic http authentication working on my Rails app. I'm offering

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.