File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes How do I set a bean value from a dropdown? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How do I set a bean value from a dropdown?" Watch "How do I set a bean value from a dropdown?" New topic
Author

How do I set a bean value from a dropdown?

Patrick Noah
Greenhorn

Joined: Aug 22, 2011
Posts: 28
I have the following form, myform.html:


I want to set this howdeep value in my bean, UserData.java:

I do this by using <jsp:set Property> in my SaveName.jsp:


I want to see if this variable is getting set by using jsp:getProperty but I get the following error: org.apache.jasper.JasperException: Cannot find any information on property 'howdeep' in a bean of type 'user.UserData' but YOU CAN CLEARLY SEE IN BOLD THAT I DO HAVE THIS PROPERTY! What is wrong? Thanks.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60046
    
  65

Patrick Noah wrote: but YOU CAN CLEARLY SEE IN BOLD THAT I DO HAVE THIS PROPERTY!


Please don't post in all-caps. Thanks.

And, no, you don't. Look again. Carefully.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Patrick Noah
Greenhorn

Joined: Aug 22, 2011
Posts: 28
Bear Bibeault wrote:
Patrick Noah wrote: but YOU CAN CLEARLY SEE IN BOLD THAT I DO HAVE THIS PROPERTY!


Please don't post in all-caps. Thanks.

And, no, you don't. Look again. Carefully.


Sorry for the all caps . The property "howdeep" is in UserData.java, in lowercase. If I'm only trying to set "howdeep", what am I possibly missing? Are you possibly referring to setHowDeep(String value) ? My understanding is that setter method names are not case-sensitive. Please correct me if I'm wrong.

Thanks!

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60046
    
  65

You're wrong.
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1016
howdeep --> setHowDeep
howDeep --> setHowDeep

See the decapitalize method in java.beans.Introspector
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60046
    
  65

I'm not sure what your point is, Stefan. Are you claiming that the property can be referenced by either of howDeep or howdeep successfully? Actual testing does not bear that out.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do I set a bean value from a dropdown?
 
Similar Threads
use of value object ( javabeans )
Tomcat and Bean placement
java bean , jsp page and parameters
The value for the useBean class attribute user.userData is invalid.
jsp:setProperty tag not setting property in bean