aspose file tools*
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
JavaRanch » Java Forums » Java » JSP
Bookmark "jsp  usebean" Watch "jsp  usebean" New topic
Author

jsp usebean

sandeep Talari
Ranch Hand

Joined: Dec 24, 2007
Posts: 63
hello,

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

class Employee extends Person
{
int getEmpId()
{}
void setEmpId(int)
{}
}
servlet

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

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

<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?


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: jsp usebean