• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A problem about using <jsp:getProperty>

 
Yi-Ru Cai
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65123
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Yi-Ru Cai
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic