Just a small observation Roger, whilst you're solution is perfectly workable, you would need to have a big switch statement (or something similar) which could get messy.
imho, the use of the extra directory and namespace (i.e. /xml/, /html/, etc.) that I suggested earlier is slightly simpler because it makes use of Struts existing dispatch determining mechanisms to direct the request to the correct handler, but I'd welcome any comments you have if you feel the extra param has other benefits to offer. Al. -----Original Message----- From: Roger Varley [mailto:[EMAIL PROTECTED] Sent: 24 May 2007 15:38 To: Struts Users Mailing List Subject: Re: [S2] Results Based on URL File Types I'm still a newbie as well so take this with a pinch of salt. I would try doing it this way; http://www.domain.com/struts2/queryName?param1=foo,param2=xml http://www.domain.com/struts2/queryName?param1=foo,param2=json http://www.domain.com/struts2/queryName?param1=foo,param2=html http://www.domain.com/struts2/queryName?param1=foo,param2=rss Include getter and setter for param2 in your action and set your result strings as appropriate to get the results you want so, for example after executing your query, you could include in your action method; return getParam2() which would return xml,json,html or rss and then in your struts.xml you'd specify <result name="xml">YourResultTypeForXML</result> <result name="json">YourResultTypeForJSON</result> etc etc Does this help. Regards Roger --------------------------------------------------------------------- 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]