wood burning stoves 2.0*
The moose likes Struts and the fly likes bean:define to define a bean of specific object type Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "bean:define to define a bean of specific object type" Watch "bean:define to define a bean of specific object type" New topic
Author

bean:define to define a bean of specific object type

Chris Kul
Greenhorn

Joined: Jul 21, 2008
Posts: 3
Hi,


I am trying to define a bean using following syntax and set value in it using JSP scriptlet.

But I am always getting following exception;


Any idea what is wrong here?

cheers
Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 643
I'm not familiar with the <bean:define> tag, but in the JSP <jsp:useBean> tag, if you specify the class with type="classname" it will not create an instance of the class - instead it will expect to find the object in the session (or wherever). If you want it to create the object if it doesn't already exist, you have to use class="classname". Perhaps it's the same with the <bean:define> tag?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: bean:define to define a bean of specific object type
 
Similar Threads
Cannot find bean under name ....
bean:define , null checks and logic:present
how to define multiple beans
bean:define cannot instaniate new bean?
significance of id and property in <bean:define />