Hi,

Is there a way to make the <s:url> tag generate 'nice' URLs linking to
actions with wildcards in their names?

For example, let's take the following mapping using DefaultActionMapper:

        <action name="galleries/*" method="execute" class="galleryViewer">
                < param name="galleryID">{1}</ param>
                <result>/pages/galleries/GalleryViewer.jsp</result>
        </action>

With this mapping an HTTP request to http://server/galleries/3 invokes the
galleryViewer with the galleryID parameter set to 3. Unfortunately, when I
try to link to this action in a JSP using <s:url>, the URL generated by
Struts isn't the nice "/galleries/3", but the standard
"/galleries?galleryID=3" (which I'm trying to avoid). The JSP code:

        <s:url action="galleries" id="url">
                <s:param name="galleryID">3</s:param>
        </s:url>
        <s:a href="%{url}">View gallery 3</s:a>

How can I make Struts generate 'nice' URLs based on the <action> definitions
in struts.xml?

(Of course I could hardwire the custom URL format into each JSP that links
to the action, but that would be redundant and would take a lot of work to
change the URL structure later.)

Thanks,
Peter

-- 
View this message in context: 
http://www.nabble.com/Linking-to-wildcard-URLs-tf4221102.html#a12007966
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to