Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

jsp:useBean initialization

843840Apr 13 2009 — edited Apr 14 2009
I have the following:
<jsp:useBean id="groupRightData" class="foo.GroupRightData" scope="request">
	<jsp:setProperty name="groupRightData" property="*" />
</jsp:useBean>
This initializes all the request parameters to my bean (which is awesome). Now I was wondering if it was possible to set certain properties on the bean and then somehow call an initialization method that will take these key values and initialize the rest of the beans properties. For example lets say I have a car bean, I set the make and model property, then some how call some kind of init method then it sets the 4 door property to true, and the numberOfSeatBelts to 5 and so on. Is this bad? I couldn't find any examples of this and that usually means I am doing something wrong. I thought about getting the bean and then making a fake getter method like "getInit()" that does it so that after I create the bean I can just call ${groupRightData.init} but that just doesn't seem right. Thoughts anyone? Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 12 2009
Added on Apr 13 2009
4 comments
733 views