You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Michel Prévost <pr...@hotmail.com> on 2013/11/23 23:42:33 UTC

Problem with tutorial

I am new to struts and going through the
http://struts.apache.org/release/2.3.x/docs/using-struts-2-tags.html
tutorial. I have a problem where a var is not expanded.

Ex:

		<s:url action="hello" var="helloLink">
			<s:param name="userName">Bruce Phillips</s:param>
		</s:url>

		<a href="${helloLink}">Hello Bruce Phillips</a>

Normally, when hovering the produced link I should see:
http://localhost:8080/basic_struts/hello.action?userName=Bruce+Phillips

What I see is: http://localhost:8080/basic_struts/$%7B helloLink%7D

As you can see, the var is not expanded and the server returns the href as
is, instead of expanding it to the action="hello" url specification.

I run Tomcat 7, with struts 2.3.15.3.

Some suggested to use ELIgnored="false" and isELIgnored="false" in the Page
directive, but those attributes are not regocnized (Eclipse draws yellow
doodles under it ).

Thank you,
Michel

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Problem with tutorial

Posted by Dave Newton <da...@gmail.com>.
Does *any* EL work? What's your web.xml app (servlet spec) version?
 On Nov 23, 2013 5:43 PM, "Michel Prévost" <pr...@hotmail.com>
wrote:

> I am new to struts and going through the
> http://struts.apache.org/release/2.3.x/docs/using-struts-2-tags.html
> tutorial. I have a problem where a var is not expanded.
>
> Ex:
>
>                 <s:url action="hello" var="helloLink">
>                         <s:param name="userName">Bruce Phillips</s:param>
>                 </s:url>
>
>                 <a href="${helloLink}">Hello Bruce Phillips</a>
>
> Normally, when hovering the produced link I should see:
> http://localhost:8080/basic_struts/hello.action?userName=Bruce+Phillips
>
> What I see is: http://localhost:8080/basic_struts/$%7B helloLink%7D
>
> As you can see, the var is not expanded and the server returns the href as
> is, instead of expanding it to the action="hello" url specification.
>
> I run Tomcat 7, with struts 2.3.15.3.
>
> Some suggested to use ELIgnored="false" and isELIgnored="false" in the Page
> directive, but those attributes are not regocnized (Eclipse draws yellow
> doodles under it ).
>
> Thank you,
> Michel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

RE: Problem with tutorial

Posted by Dave Newton <da...@gmail.com>.
Hence the web.xml/EL question.
 On Nov 24, 2013 10:06 AM, "Michel Prévost" <pr...@hotmail.com>
wrote:

> Thank you Bruce (the very Bruce Phillips from the example :-)), it turned
> out the web.xml file generated by Eclipse was the problem. When I replaced
> it with the one from your example, it worked like a charm!
>
> -----Original Message-----
> From: bphillips@ku.edu [mailto:bphillips@ku.edu]
> Sent: November-24-13 8:23 AM
> To: user@struts.apache.org
> Subject: Re: Problem with tutorial
>
> Michel:
>
>    Are you using the tutorial code provided at
> https://svn.apache.org/repos/asf/struts/sandbox/trunk/struts2examples or
> are
> you coding the example yourself?
>
>    If you are coding the example yourself you may want to compare your code
> and files to the example code checked out from the subversion repository
> above.
>
>   I just checked that the example code for the using tags tutorial works
> correctly under Tomcat 7.
>
> Bruce
>
>
>
> --
> View this message in context:
>
> http://struts.1045723.n5.nabble.com/Problem-with-tutorial-tp5714733p5714735.
> html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

RE: Problem with tutorial

Posted by Michel Prévost <pr...@hotmail.com>.
Thank you Bruce (the very Bruce Phillips from the example :-)), it turned
out the web.xml file generated by Eclipse was the problem. When I replaced
it with the one from your example, it worked like a charm!

-----Original Message-----
From: bphillips@ku.edu [mailto:bphillips@ku.edu] 
Sent: November-24-13 8:23 AM
To: user@struts.apache.org
Subject: Re: Problem with tutorial

Michel:

   Are you using the tutorial code provided at
https://svn.apache.org/repos/asf/struts/sandbox/trunk/struts2examples or are
you coding the example yourself?

   If you are coding the example yourself you may want to compare your code
and files to the example code checked out from the subversion repository
above.

  I just checked that the example code for the using tags tutorial works
correctly under Tomcat 7.

Bruce



--
View this message in context:
http://struts.1045723.n5.nabble.com/Problem-with-tutorial-tp5714733p5714735.
html
Sent from the Struts - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Problem with tutorial

Posted by "bphillips@ku.edu" <bp...@ku.edu>.
Michel:

   Are you using the tutorial code provided at
https://svn.apache.org/repos/asf/struts/sandbox/trunk/struts2examples or are
you coding the example yourself?

   If you are coding the example yourself you may want to compare your code
and files to the example code checked out from the subversion repository
above.

  I just checked that the example code for the using tags tutorial works
correctly under Tomcat 7.

Bruce



--
View this message in context: http://struts.1045723.n5.nabble.com/Problem-with-tutorial-tp5714733p5714735.html
Sent from the Struts - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org