Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Geeting session value in text box

 
smitaj joshi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have given <html:text property="name" size="30" value=<%=session.getAttribute("name")%>/>.it is showing error.
Could you tell me correct syntax for it
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by smitaj joshi:
I have given <html:text property="name" size="30" value=<%=session.getAttribute("name")%>/>.it is showing error.
Could you tell me correct syntax for it



you need to put session value in single quote since you have the attribute like "name".

it is a struts related question,if you want to get more details you can go struts forum

Hope this helps

[ December 24, 2008: Message edited by: seetharaman venkatasamy ]
[ December 24, 2008: Message edited by: seetharaman venkatasamy ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65220
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please take the time to choose the correct forum for your posts. This forum is for questions on JSP, not Struts.

For more information, please read this.

This post has been moved to a more appropriate forum.
 
smitaj joshi
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An error occurred at line: 32 in the jsp file: /update.jsp
The method setValue(String, Object) in the type TagSupport is not applicable for the arguments (Object)
29: </tr>
30: <tr>
31: <td align="right">Name</td>
32: <td align="left"><html:text property="name" size="30" value='<%=session.getAttribute("name")%>'/> </td>
33: </tr>
i m not getting meaning of this error.Could you help me on this topic?
 
srikanth paideti
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am facing same problem.
I have to set values to text box from Logic:iterate.
Can you give suggestions?




 
Rudy Gireyev
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately, STRUTS doesn't always play along with JSP. So what I do in such cases is convert the STRUTS tag to its HTML equivalent.
 
Rakesh Keerthi
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try putting in double quotes("") instead of single quotes('').
 
Shailesh Narkhede
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

try with below code, by typecasting object to String,


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic