You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Pawson, David" <Da...@rnib.org.uk> on 2005/02/07 16:43:36 UTC

jsp version of session variable access. Pointer to syntax wanted.

Looking for the syntax to gain access to a session variable
in a jsp page, rather than converting it to java.

HttpSession session=request.getSession();
String s = (String)session.getAttribute(sessionData.FILECOUNT);

I'm not using the xml syntax (as yet).
tomcat 5028.

any pointers appreciated please.

Regards DaveP.

**** snip here *****

-- 
DISCLAIMER:

NOTICE: The information contained in this email and any attachments is 
confidential and may be privileged.  If you are not the intended 
recipient you should not use, disclose, distribute or copy any of the 
content of it or of any attachment; you are requested to notify the 
sender immediately of your receipt of the email and then to delete it 
and any attachments from your system.

RNIB endeavours to ensure that emails and any attachments generated by
its staff are free from viruses or other contaminants.  However, it 
cannot accept any responsibility for any  such which are transmitted.
We therefore recommend you scan all attachments.

Please note that the statements and views expressed in this email and 
any attachments are those of the author and do not necessarily represent
those of RNIB.

RNIB Registered Charity Number: 226227

Website: http://www.rnib.org.uk




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: jsp version of session variable access. Pointer to syntax wanted.

Posted by Tim Funk <fu...@joedog.org>.
Via EL: (assuming sessionData.FILECOUNT = mySessionVariableName)

${sessionContext.mySessionVariableName}


Via snippet:
<%=session.getAttribute(sessionData.FILECOUNT)%>

In a jsp - the session variable is given to you as implicit variable.

-Tim

Pawson, David wrote:

> Looking for the syntax to gain access to a session variable
> in a jsp page, rather than converting it to java.
> 
> HttpSession session=request.getSession();
> String s = (String)session.getAttribute(sessionData.FILECOUNT);
> 
> I'm not using the xml syntax (as yet).
> tomcat 5028.
> 
> any pointers appreciated please.
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: jsp version of session variable access. Pointer to syntax wanted.

Posted by fstmncn <fs...@yahoo.com>.
you can use expression language:
e.g.:

${sessionData.FILECOUNT}

--- "Pawson, David" <Da...@rnib.org.uk> wrote:

> Looking for the syntax to gain access to a session
> variable
> in a jsp page, rather than converting it to java.
> 
> HttpSession session=request.getSession();
> String s =
> (String)session.getAttribute(sessionData.FILECOUNT);
> 
> I'm not using the xml syntax (as yet).
> tomcat 5028.
> 
> any pointers appreciated please.
> 
> Regards DaveP.
> 
> **** snip here *****
> 
> -- 
> DISCLAIMER:
> 
> NOTICE: The information contained in this email and
> any attachments is 
> confidential and may be privileged.  If you are not
> the intended 
> recipient you should not use, disclose, distribute
> or copy any of the 
> content of it or of any attachment; you are
> requested to notify the 
> sender immediately of your receipt of the email and
> then to delete it 
> and any attachments from your system.
> 
> RNIB endeavours to ensure that emails and any
> attachments generated by
> its staff are free from viruses or other
> contaminants.  However, it 
> cannot accept any responsibility for any  such which
> are transmitted.
> We therefore recommend you scan all attachments.
> 
> Please note that the statements and views expressed
> in this email and 
> any attachments are those of the author and do not
> necessarily represent
> those of RNIB.
> 
> RNIB Registered Charity Number: 226227
> 
> Website: http://www.rnib.org.uk
> 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> 
> 


=====
[--�--]


		
__________________________________ 
Do you Yahoo!? 
The all-new My Yahoo! - Get yours free! 
http://my.yahoo.com 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org