• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Removing parameters from URL

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am working on an application that usess the Struts framework. We want to remove the search parameters from the URL when a user does a search by clicking on a link (no forms involved). Does this need to be done in the Action, or is there another way to do it?
Thanks!
 
Ranch Hand
Posts: 314
2
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you asking how you can direct a search to an appropriate action based on a parameter value? If so, look at using the org.apache.struts.RelayAction. This action looks for a given parameter and uses its value to look up a forward (to another action).
For instance, if you passed aURL to the Struts controller like:
http://a.b.com/Search.do?dispatch=books
the RelayAction would check the mappings for an ActionForward named 'books' and forward the action to it. For example:
<action
path="/Search"
type="org.apache.struts.scaffold.RelayAction"
scope="request"
validate="false">
<forward name="books" path="/SearchBooks.do" />
<forward name="cars" path="/SearchBooks.do" />
<forward name="music" path="/SearchBooks.do" />
</action>
Hope this helps.
Darryl
 
Darryl A. J. Staflund
Ranch Hand
Posts: 314
2
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi again,
I forgot to mention that by design the name of the parameter has to be 'dispatch'.
Darryl
 
reply
    Bookmark Topic Watch Topic
  • New Topic