HI every body,
Can any one tell me what I am doing wrong? when compiling a jsp an error saying:
"Attribute username has no value".
<logic:notPresent
scope="request"
parameter="<%=(String)request.getAttribute("username")%>
<logic:forward name="some global forward">
Thank you in advance
A
Discussions
Web tier: servlets, JSP, Web frameworks: Compiling Error: Attribute username has no value
-
Compiling Error: Attribute username has no value (4 messages)
- Posted by: Atlas Casa
- Posted on: March 13 2003 11:47 EST
Threaded Messages (4)
- Compiling Error: Attribute username has no value by Andrew Phillips on March 18 2003 15:11 EST
- Compiling Error: Attribute username has no value by Simon Knott on March 20 2003 11:21 EST
- Compiling Error: Attribute username has no value by Atlas Casa on March 28 2003 11:42 EST
- Compiling Error: Attribute username has no value by Amol Jakatdar on December 02 2004 11:43 EST
- Compiling Error: Attribute username has no value by Simon Knott on March 20 2003 11:21 EST
-
Compiling Error: Attribute username has no value[ Go to top ]
- Posted by: Andrew Phillips
- Posted on: March 18 2003 15:11 EST
- in response to Atlas Casa
Check to make sure your attribute name is spelled correctly. This is a commone problem I used to have when I wasn't paying attention. -
Compiling Error: Attribute username has no value[ Go to top ]
- Posted by: Simon Knott
- Posted on: March 20 2003 11:21 EST
- in response to Andrew Phillips
Not sure what app server you're using, but you may need to escape the quotes within the scriptlet tag:
<logic:notPresent
scope="request"
parameter="<%=(String)request.getAttribute(\"username\")%>" />
<logic:forward name="some global forward" />
Looks stupid, I know, but you used to have to do this with Tomcat or WebSphere I think. -
Compiling Error: Attribute username has no value[ Go to top ]
- Posted by: Atlas Casa
- Posted on: March 28 2003 11:42 EST
- in response to Simon Knott
Sorry guys, I was not able to reply back to your feedbacks. I was out of my office all this time. your suggestions make sense I will give them a try, thank you again.
ED -
Compiling Error: Attribute username has no value[ Go to top ]
- Posted by: Amol Jakatdar
- Posted on: December 02 2004 11:43 EST
- in response to Simon Knott
Simon, Thank you !!
I was pulling my hair out over this and once I would have gone completely bald, I was going to burn my websphere box...
But your post saved my hair and the box :-)
Using single quote also worked for me:
<logic:notPresent
scope="request"
parameter='<%=(String)request.getAttribute("username")%>' />
<logic:forward name="some global forward" />
Thanks