|Subject:||RE: path info|
|From:||David Noll (lis...@noll.org)|
|Date:||Dec 4, 2000 7:20:34 pm|
Thanks for the response. The path mapped servlets didn't work when I tried them; the same error was thrown, which I think makes sense. In a url like this:
the path info starts at the second slash, and struts is setup to expect a leading slash in an action path. An eventual solution might be to allow regex matching in the action path attribute. Then a struts action class would only need to delete the "real" action path from the beginning of the path info to get path info relative to the action. If that sounds like a reasonable idea to the list, I'll put a feature request in bugrat.
BTW, the whole point of this exercise is to create a means of browsing a database that is friendly to search engines that don't recognize pages with query strings.
David Noll wrote:
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:
I would like to call this action like this:
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.