If you're using 2.0.11.1, Struts tags do not allow JSTL expressions. You
need to use OGNL instead. I don't recall the OGNL syntax for accessing
page-scope variables, but it's probably something like %{title}, or
%{#title}. Check the OGNL documentation to be sure if someone else
doesn't chime in here.
L.
bugs_ wrote:
But
<%
// declare or construct your variable...
String title="My page";
// set the variable in the page context under the variable name "title"
pageContext.setAttribute("title",title);
%>
<s:hidden name="foo" value='${title}' />
This return the same error. Could you write me here any simple working
example?
Musachy Barroso wrote:
http://answers.google.com/answers/threadview?id=371241
musachy
On Tue, Mar 11, 2008 at 1:39 PM, bugs_ <[EMAIL PROTECTED]> wrote:
I need rewrite jsp page from Struts 1 to Struts 2.
In Strust 1 is in the page something like this:
<% String variable = ... %>
<html:hidden property="foo" value="<%= variable %>"/>
I tried to rewrite it in Struts 2:
<% String variable = ... %>
<s:hidden name="foo" value="<%= variable %>" />
but this doesn't work. It return an error message: "According to TLD or
attribute directive in tag file, attribute value does not accept any
expressions"
I really don't know how to access variable in a Struts 2 tag?
I tried to read Struts 2 documentation, but I didn't find solution.
--
View this message in context:
http://www.nabble.com/How-to-write-variable-in-a-Struts-2-tag--tp15981156p15981156.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]