struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chia soon siong <chiasoonsi...@gmail.com>
Subject Re: Struts 2 - Getting values from action in JSP pages using scriplet?
Date Sat, 27 Mar 2010 07:32:18 GMT
Hi,

<%
String s = request.getAttribute("myAttribute");
s = "This is my string " + s;
%>


Use the code below and you can display the value in jsp.
<%=s%>

Regards,
Soon Siong


On Sat, Mar 27, 2010 at 12:04 PM, ApprendreNB <trungbkvn@yahoo.com> wrote:

>
> Dear all,
>
> I have a property in an action class. How can I get its value in JSP pages
> without using Struts tag (like s:property etc.)?
> For example, how can I print it value using scriplet like this: <% String s
> = request.getAttribute("myAttribute"); out.println("This is my string " +
> s); %>
>
> I tried this code but it doesn't work. In which scope (request, session,
> application ...) is my property stocked?
>
> Thank you very much.
> --
> View this message in context:
> http://old.nabble.com/Struts-2---Getting-values-from-action-in-JSP-pages-using-scriplet--tp28050118p28050118.html
> Sent from the Struts - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message