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 jsp:setProperty versus bean set method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "jsp:setProperty versus bean set method" Watch "jsp:setProperty versus bean set method" New topic
Author

jsp:setProperty versus bean set method

Winston Smith
Ranch Hand

Joined: Jun 06, 2003
Posts: 136
Hi All,
Assume I have a bean called Dog, with an attribute called age.
When assigning a value to age, what are the differences between using:
1.) <jsp:setProperty name="Dog" property="age" value="12" />
and
2.) Dog.setName("12");
I realize when using (2), you have to include the bean in the jsp page, but are there any other differences?
Thanks,
WS


for (int i = today; i < endOfTime; i++) { code(); }
SAFROLE YUTANI
Ranch Hand

Joined: Jul 06, 2001
Posts: 257
The only difference is that with 1), the bean will be created automatically if it doesn't exist in the scope that you defined in your jsp:useBean tage.
Raffi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jsp:setProperty versus bean set method
 
Similar Threads
few obscure things about JSP,EL
jsp:setProperty param
setting a bean in a JSP
jsp:setProperty
<jsp:useBean> example