• 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

Depatch Action query

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
Am relatively new to Struts. Am using version 1.3. I have a security issue, where I need to stop from sending anything in the query string. Now I have been told that if we are using Dispatch Action (which is my case) we have to pass the method name of the in the query string, i.e. the query string is going to look like
http://<url>/<formName>.do?method=myActionMethod. Is it true that we can not work with DispatchAction withput sending the method name in the query string?
If there is another way of doing this please let me know.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you read the Javadocs for DispatchAction? They answer your question.
 
Dushyant Agarwal
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi David,
I went through the javadoc . Not sure what you wanted me to find out.
I asked if there was a way of not sending the method name in the query string. May be in some other context or some other way in struts.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You asked if there was a way to work with DispatchAction without sending the method name in the query string.


NOTE - If the value of the request parameter is empty, a method named unspecified is called. The default action is to throw an exception. If the request was cancelled (a html:cancel button was pressed), the custom handler cancelled will be used instead. You can also override the getMethodName method to override the action's default handler selection.


You didn't specify what you wanted to do. The answer to your original question is yes, and the docs show how.
 
Dushyant Agarwal
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

You didn't specify what you wanted to do


I want to carry out navigation from one page to another in struts but without using query parameter for passing the action method name.

You can also override the getMethodName method to override the action's default handler selection.


I could not get "getMethodName() " method in the documentation.
 
This tiny ad is guaranteed to be gluten free.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic