Jsp – Is it possible to access struts2 variable in jsp scriptlet

jspstruts2

Is it possible to access struts2 variable in jsp scriptlet?

If I have struts2 variable like

<s:set var="test" value="%{'true'}"/>

Can I use variable "test" in JSP scriptlet?

If yes. How is it possible?

Can anyone give some idea about it?

Thanks.

Best Solution

You can even use the request object to get the action variable. For example, if you have a variable String userName in the action, you can use

<%
String userName = (String) request.getAttribute("userName");
%>