package
test;
public class MyBean
{
private
String name = "default";
public MyBean(){}
public MyBean(String name){this.name=name;}
public void setName(String name){ this.name = name; }
public String getName(){ return name; }
}
myjsp.jsp
<%
pageContext.setAttribute("bean", new test.MyBean("no name"));
%>
<
jsp:useBean id="bean" class="test.MyBean">
<%bean.setName("bean");%>
</jsp:useBean>
Name:<%= bean.getName()%>
when i set "bean" attribute with pageContext my output is "Name:no name"
when i set "bean" attribute with request/application/session my output is
"Name:bean"
what is happening behind the scene can anyone explain in detail?
thanks inadvance
Sravanthi
[ May 30, 2008: Message edited by: Vijaya Sravanthi ]