Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get JSP scriptlet value in struts tag

Tags:

Here is my code:

<% request.setAttribute("lcItem", "Hello"); %>

If I do as following, I'm not getting the value:

<s:property value="%{lcItem}" />
<s:property value="lcItem" />

Any suggestions?

like image 302
Vinayak Bevinakatti Avatar asked Apr 07 '09 09:04

Vinayak Bevinakatti


1 Answers

This works perfectly..

<%       
   request.setAttribute("lcItem", LeftContentItem);
%>

<s:property value="#request['lcItem']" />

Note: According to the Scope we use we should specify the #request .. etc

like image 195
Vinayak Bevinakatti Avatar answered Oct 12 '22 21:10

Vinayak Bevinakatti