wood burning stoves 2.0*
The moose likes Struts and the fly likes Display n number of parameters on jsp page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Display n number of parameters on jsp page" Watch "Display n number of parameters on jsp page" New topic
Author

Display n number of parameters on jsp page

adeeb alexander
Ranch Hand

Joined: May 29, 2008
Posts: 268
Hi.

I have a problem. I am forwarding a page in which n number of texfields are made dynamically, they can have any random name. By using the method getParameterNames() I am able to retrieve values in other jsp. Now i want the same thing to happen in struts 2. how should I use setter an getter methods there. I have used many times setter and getter in other apps but this is some different situation. I have tried like this.





to be more clear I want this statement "System.out.println(ParameterName+":"+request.getParameter(ParameterName));" to print values on page. Note: the parameters can be n in number. I want to print them all I am able to do in jsp. Someone please show me the correct way.


Thanks and regards.

Adeeb
thor aniket
Ranch Hand

Joined: Jan 21, 2012
Posts: 40

configure a JSP for result SUCCESS in struts.xml and in that JSP, use tag to print the values you have defined in action class. Make sure that you write simple getter and setter method in action class for that property.


 
GeeCON Prague 2014
 
subject: Display n number of parameters on jsp page