• 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

how to get values from JSP

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

i am working with struts. i want to know how to get the values form the jsp page when i used form bean scope="request". i could not use request.getparameter() because of security violations. if scope="session" we can use form.getproperty(). now my client is restricted the above conditions. please let me know the solutions if you know. i am excepting early and positive response form our friends.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The ActionForm is the standard means Passing information from the JSP to the Action in a Struts application. It works just as well in request scope as it does in session scope. So, your form.getProperty solution should work just fine even if the ActionForm is in request scope.

Also just a friendldy reminder:

Like most people who answer questions in these forums, I do it for fun, not because we have to. When someone says they are "expecting an early response", that sounds more like demands and pressure than fun, and most of the time I chose not to answer those questions.
[ January 03, 2008: Message edited by: Merrill Higginson ]
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Append the additional parameters in the function call along with the action. You can fetch those values in the Action class through request.getParameter() method. It's no violation as we pass the request and response objects in the "public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)" method.

Here is the javascript function example....

function fnSubmit()
{
document.BillMessageForm.action="addBillMessage.do";
var input = document.createElement('INPUT');
input.type = 'HIDDEN';
input.name = 'action';
input.value = 'add';
document.BillMessageForm.appendChild(input);
document.BillMessageForm.submit();
}
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic