It's not a secret anymore!
The moose likes JSP and the fly likes jsp  usebean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "jsp  usebean" Watch "jsp  usebean" New topic

jsp usebean

sandeep Talari
Ranch Hand

Joined: Dec 24, 2007
Posts: 63

abstract class Person
String getName(){}
void setName(String){}

class Employee extends Person
int getEmpId()
void setEmpId(int)

Employee p = new Employee)_;
request.setAttribute("person", p);

<jsp:useBean id ="person" type="Employee" >
<jsp: setProperty name ="person" property ="name" value="fred"/>

<jsp:getProperty name="person" property ="name"/>

how this will work since the set attribute in request scope and here in jsp the default scope we specified is page... explain me
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
It should not work. what did you get when you tested it?

So much trouble in the world -- Bob Marley
I agree. Here's the link:
subject: jsp usebean
It's not a secret anymore!