Once you use the s:url tag, you can use JSTL syntax.

${myaction} ... 

In fact I have started a meme where I create a routes.jsp that I include in
my files that lists all the s:url and other useful url aliases like <s:url
value="/resources" id="resources"/>

${resources}/images/bla.gif 

I have started to really like this because I can maintain a lot of my my
links in a single place.  


Johannes Geppert wrote:
> 
> use the struts2 tags, like this.
> 
> <s:url id="myaction" action='MyAction'/>
> <p><s:a href="%{myaction}" cssClass="kopf">Go To My Action</s:a></p>
> 
> Best Regards
> Johannes Geppert
> 
> 
> Anthony Frasso wrote:
>> 
>> Hello, and thanks for your help in advance.
>> 
>> I'm new to Struts 2, and working on a simple application to learn the
>> framework.  I'm also trying to use XHTML with this application.
>> 
>> I know that in a JSP page, I can use the following to create a link to
>> an action:
>> 
>>     <p> "<s:url action='MyAction'  ">Go To My Action </p>
>> 
>> This works well.  However, I've tried to do the same with a JSPX page.
>>  Unfortunately, I get an exception when I navigate to this page:
>> 
>>     org.apache.jasper.JasperException: /home.jsp(15,16) The value of
>> attribute "href" associated with an element type "a" must not contain
>> the '<' character.
>> 
>> Is there something I'm doing incorrectly?  Or is there a different way
>> to do this kind of a thing within a JSPX page?
>> 
>> Thanks for your help.
>> 
>> Regards,
>> Anthony Frasso
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Struts-2-and-XHTML-tp21408099p21446525.html
Sent from the Struts - User mailing list archive at Nabble.com.


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

Reply via email to