• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

set all form parameters using jsp:setProperty

Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

Posts: 14691
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
    Bookmark Topic Watch Topic
  • New Topic