Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JSP and the fly likes A problem about using <jsp:getProperty> 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 » Java » JSP
Bookmark "A problem about using <jsp:getProperty>" Watch "A problem about using <jsp:getProperty>" New topic
Author

A problem about using <jsp:getProperty>

Yi-Ru Cai
Greenhorn

Joined: Jun 01, 2012
Posts: 4
I write

in page1

and try this in page2 to get "world":


But it doesn't work
does this mean I always have to do <jsp:useBean id="hello" scope="session" class="hello.HelloBean" /> before using <jsp:getProperty name="hello" property="name" /> in the same page, even I create the object in another page first?

Thank you for your answering
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60794
    
  65

No, you do not need to repeat the useBean action.

But the get and set property actions are obsoleted by the EL and JSTL. Why are you still using them in the first place?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Yi-Ru Cai
Greenhorn

Joined: Jun 01, 2012
Posts: 4
Bear Bibeault wrote:No, you do not need to repeat the useBean action.

But the get and set property actions are obsoleted by the EL and JSTL. Why are you still using them in the first place?

First , thanks for your replying
I am taking lessons about Servlet and JSP.
So I try to test whether if I can use script to put some objects in the sesson , and just use <jsp:getProperty....> to get the object and its property.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: A problem about using <jsp:getProperty>
 
Similar Threads
EJB and JSP
jsp:getProperty calling bean from specific scope
give another jsp to action
usebean is not working with jsp
The value for the useBean class attribute is invalid