• 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

Is there a way to set a parameter from an action?

 
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So is there a way to set a parameter to be sent to a page from an action?
or alternatively to set one that gets sent along with a form that is submited using method="post"?


-Tad
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Tad Dicks:
So is there a way to set a parameter to be sent to a page from an action?

Yes. Do a request.setAttribute("foo", foo) to store a request attribute into the request object before the request gets dispatched to the JSP.

Originally posted by Tad Dicks:
So is there a way to set a parameter to be sent to a page from an action?
or alternatively to set one that gets sent along with a form that is submited using method="post"?


That would be a hidden input element inside the form, e.g.
 
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can't not set parameter BUT you can set attribute to request.



or you can use

request.getREquestDispatcher("/forward?param=value").forward(request, response);
reply
    Bookmark Topic Watch Topic
  • New Topic