Check out: 
http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/jsp/PageContext.html

It seems that pageContext is a jsp-only context. 

You should bind the object to either request or session context, and then use a 
<bean:define> tag to pull the object out of the request/session and put it into the 
pageContext. 

Do:
<bean:define id="login" name="login_username" scope="request"/>
<c:if test="${ login == null.....

Google for bean:define to learn more. 
Enjoy,

 - Kashif Q.
-----Original Message-----
From: Ricky Lee [mailto:[EMAIL PROTECTED] 
Sent: Saturday, April 17, 2004 6:01 PM
To: [EMAIL PROTECTED]
Subject: what should i do to set the session in the pageContext in a Action class?

hi, thanks for reading..

i have a problem about set the seesion(pageContext) in
the action class.. 

i know that set the seesion in the request, just like 
request.getSession().setAttribute("login_username",userForm.getUsername());

and in the JSP page, we can use the code to get the
seesion:

<%=request.getSession().getAttribute("login_username")%>

but, i want to use the pageContext to set the session
so as to load the attribute in JSTL 

<c:if test="${....}}">...</c:if>

if i use <c:if test="${session.login_username ==
null}">...</c:if>  it can't work...

because there isn't login_username in the session
pageContext.

if i use <c:if
test="${request.getSession().getAttribute("login_username")
== null}">..</c:if>

it still cause a error....syntax error...

i know in the custom taglib, we can use the the

 pageContext.setAttribute(String,Object,scope) the
scope can set to "session"

and in the JSP page, we can use the JSTL to get the
attribute..


but in the Action class , there isn't pageContext
object to set the session in the pageContext, just has
the request to set pageContext, what should i do to
set the session in the pageContext?


please help me....thanks! 




        
                
__________________________________
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢
http://photos.yahoo.com/ph/print_splash

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to