I decided it would be nice to use pretty URLs for remote e-mail content fetched as part of an e-mail campaign generator.
This is simple with Struts 2:
STRUTS.XML
<action name="link/*/*" class="mm.linkController" method="execute">
<param name="id">{1}</param>
<param name="key">{2}</param>
<result name="success">/WEB-INF/jsp/link.jsp</result>
</action>
STRUTS.PROPERTIES
struts.enable.SlashesInActionNames = true
Add properties with javabean setters to your action class and away you go.
NB: ensure that the staticParams interceptor is switched on for your namespace.
Sunday, 28 February 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment