jQuery in Action, 3rd edition
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 REST with Spring (video course) this week in the Spring 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
It is sorta covered in the JavaRanch Style Guide.
subject: jsp usebean
jQuery in Action, 3rd edition