File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[S2] IncludeParams with s:url Tag

 
David Zazeky
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have two actions: searchResults and searchForm. I am trying to create a link from searchResults back to the searchForm while passing all of the user's search parameters. To do that, I tried using the s:url tag with includeParams="all." The problem is that the resulting link takes me back to searchResults instead of going to searchForm (even though I specified searchForm in the action tag).

My JSP code:

The resulting URL generated (parameters omitted):

Does anyone know how to stop Struts from including the "action:searchResults=searchForm" part in the URL? The generated link works correctly if I manually delete that part of the link.

Thanks!
 
Sonny Gill
Ranch Hand
Posts: 1211
IntelliJ IDE Mac
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is nothing wrong with the code. My guess is that the extra parameters are present in the first request to searchResults action, and then they get added to the generated link since you are using includeParams="all".

Check if you are submitting these parameters through query string or a form submission when the searchResult action is invoked the first time.
If yes, then the solution is to either remove those parameters, or use includeParams='get' if that serves your purpose. Otherwise, you may have to fall back to setting includeParams='none' and adding the required parameters manually using <s:param>

HTH.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic