How JAVABEAN the initial value for the property? ?

Category: Web Develop
 
JLin1026
2012-09-26 09:38:36

Sponsored Links
Consult heroes:
whether through the constructor method BEAN (non-EJB) in the initial value of the properties assigned point? For example the value from the database. I tried it, it seems the constructor does not work, I do not know why. Please expert guidance.
Thank you!

Sponsored Links

yangmingyeyi
2012-09-26 09:40:58
seem constructor can not have parameters parameters ah!
I'm doing now and then compile a method with parameters! This method is called in JSP!
li273
2012-09-26 09:57:38
BEAN is to have a constructor with no parameters, the initial value assigned to the property in the JSP using <jsp: setProperty name = "bean Name" property = "property name" ; value = ""> This is the simplest kind of assigned an initial value.
but there is a premise, these attributes must be a private.
my157308167
2012-09-26 10:07:57
I did not bring constructor arguments, if the method is called, then, BEAB instantiated when a little trouble
asdpkm
2012-09-26 10:11:15
Ladies and gentlemen, I doubt, why no-argument constructor is not executed?
Please pointers twelve. Thank you!
wbkz0120
2012-09-26 10:28:56
Finally, I added before the constructor PUBLIC, the constructor is executed, depressed,
not not write it, the default should also PUBLIC ah? ? ?
Which expert answers. Thank you.
mrhbb
2012-09-26 10:31:03
forgot to say, I use TOMCAT4,
also like to ask, BEAN how to call (or called using) has been placed in the application scope of an object? ?
Thank you!
Domain and server ip had changed since 8/23/2013. Suspend the user registration and posts for program maintenance.