aspose file tools*
The moose likes JSP and the fly likes set all form parameters using jsp:setProperty Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "set all form parameters using jsp:setProperty " Watch "set all form parameters using jsp:setProperty " New topic
Author

set all form parameters using jsp:setProperty

Vinod Awar
Ranch Hand

Joined: Nov 06, 2006
Posts: 125
Hi all

i was trying to set the bean properties using <jsp:setProperty name="info" property="*"/>
as follows


and in the servlet i get a reference to that bean and try to access the bean properties as shown below. but iam getting null values for both username and password.


Any suggestions?

Thanks


The biggest bankruptcy is the loss of enthusiasm
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

setProperty will be used when your jsp page is being called, not when the form will be submitted. Which means that nothing will be put into your bean.
You're submitting to a servlet so use methods like ServletRequest.getParamter to get the parameters sent.

Your code would work if you'd be using some 'in-between' jsp with the setProperty tag in it :

login.jsp --[submits to]--> setparams.jsp --[forward to]--> myservlet


[My Blog]
All roads lead to JavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: set all form parameters using jsp:setProperty