bean:define id = user name = userName scope = session toScope =
session type = java.lang.String /
struts wrote:
In the Jsp i have:
sess:attribute name=userName/
witch prints the username. Now i want something like:
%
String username= sess:attribute name=userName/;
%
but that doesn't work.
In the Jsp i have:
sess:attribute name=userName/
witch prints the username. Now i want something like:
%
String username= sess:attribute name=userName/;
%
but that doesn't work. How can i assign the session variable to the String username ?
Thanks !
Try something like
String username = session.getAttribute(username);
or
String username = request.getSession(à.getAttribute(username);
struts wrote:
In the Jsp i have:
sess:attribute name=userName/
witch prints the username. Now i want something like:
%
String username= sess:attribute
You can use JSTL to accomplish this using the:
c:set var=username value=${username} /
You can also specify the scope within the value expression. This is if
you wish to use JSTL. Only a suggestion. Hope it helps you out!
--- struts [EMAIL PROTECTED] wrote:
In the Jsp i have:
:13 PM
Subject: Re: session taglib
Try something like
String username = session.getAttribute(username);
or
String username = request.getSession(à.getAttribute(username);
struts wrote:
In the Jsp i have:
sess:attribute name=userName/
witch prints the username. Now i want
You are using a Tag Lib within a Scriptlet.
You can assign the variable using the scriplet by the following:
%
String username = (String) session.getAttribute(userName);
%
hope that helps.
-scott
At 02:40 PM 12/5/2003 +0100, you wrote:
In the Jsp i have:
sess:attribute name=userName/
witch
On Fri, 5 Dec 2003, struts wrote:
In the Jsp i have:
sess:attribute name=userName/
witch prints the username. Now i want something like:
%
String username= sess:attribute name=userName/;
%
but that doesn't work. How can i assign the session variable to the String username ?
A
James,
Isn't there a drive to move to JSTL vs. the Struts tag library? I'm
curious as we've been pushing JSTL for this reason (though it rather
flexible).
Thank you.
--- James Mitchell [EMAIL PROTECTED] wrote:
On Fri, 5 Dec 2003, struts wrote:
In the Jsp i have:
sess:attribute
On Fri, 5 Dec 2003, Oron Gill Haus wrote:
James,
Isn't there a drive to move to JSTL vs. the Struts tag library? I'm
curious as we've been pushing JSTL for this reason (though it rather
flexible).
Yes, you are absolutely correct. Use c:set if you can (given the min spec
requ).
Have a
9 matches
Mail list logo