atom feed3 messages in org.apache.struts.userRe: path info
FromSent OnAttachments
David NollDec 4, 2000 3:11 pm 
Craig R. McClanahanDec 4, 2000 5:02 pm 
David NollDec 4, 2000 7:20 pm 
Subject:Re: path info
From:Craig R. McClanahan (Crai@eng.sun.com)
Date:Dec 4, 2000 5:02:01 pm
List:org.apache.struts.user

David Noll wrote:

Hello,

Hopefully this is a no-brainer. How can I configure struts to call an action, and include the path info? EG - my normal action is called at:

server/action.do

I would like to call this action like this:

server/action.do/some/extra/random/parameters/etc

and later on, in my action class access that extra info via javax.servlet.http.HttpServletRequest.getPathInfo(). With out of the box servlet init params and action.xml values, I get an error specifying that an invalid path was requested. I'm developing against struts .5, if it makes a difference.

Well, it's simple but not necessarily obvious ...

The servlet spec's definition of extension mapping is that it only looks for an extension after the last slash. In effect, that means you cannot use path info with extension mapped servlets. Alternatives:

* Use path-mapped servlets instead (maybe "/do/*").

* Pass the extra info as a query string rather than as extra path info.

Thanks, David

Craig McClanahan