File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes problem to display session attribute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "problem to display session attribute" Watch "problem to display session attribute" New topic

problem to display session attribute

Vaishali Paramane
Ranch Hand

Joined: Mar 05, 2007
Posts: 107
I want to dispaly username
I am getting error in following line

<td><html:text property="userName" size="30" value="<%=session.getAttribute("name") %>" /></td>

if I remove value attribute it works fine. what is wrong in value attribute?

thanks for help

Preparing for SCWCD
aseem agarwal

Joined: Oct 17, 2009
Posts: 9
what is the exact error..can you please write it here...
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

Might be friendly exception null pointer.

ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
Vaishali Paramane
Ranch Hand

Joined: Mar 05, 2007
Posts: 107
Hey my problem solved
I cast session get attribete like value="<%=(String)session.getAttribute("name") %>" now it is working.

Thanks for help
I agree. Here's the link:
subject: problem to display session attribute
It's not a secret anymore!