Kevin Duffey wrote:

> I can confirm this. I spoke with Magnus yesterday and he said they are
> looking in to it. He is under the assumption thus far that you do need a
> file for the mapping to work. I did explain that Craig showed the order of
> mapping, there are 4 of them. The last one, if the first 3 are not met,
> would look for a file with the extension.
>

I was quoting the Servlet API Specification (version 2.2), section 10.1.  The
mappings get tried in the following order:
* Exact match
* Pattern match (like /admin/*)
* Extension match (like *.jsp)
* Default servlet (the one mapped to "/").

>
> Another problem with Orion which Magnus said was fixed and I have not been
> able to check yet, is the getServletPath() call. When I use it, I was not
> getting my *.do info..I was getting null. I have been using getRequestURI()
> instead as that also seems to return the same info.
>

On an extension matched pattern, getServletPath() is supposed to return the thing
that was matched (i.e. the whole request URI after the context path), and
getPathInfo() is supposed to return null.

>
> Incidentally, is there any way to possibly get the actual page that the form
> was in? I tried the request.getHeader("Referrer") call, and that returns
> everything but the path/page.jsp. I would like a way to forward back to the
> page the form submitted is in, incase of errors. I was hoping not to have to
> put that in the xml config file.  Unfortanately, getRequestURI() is usually
> the call to use, but it instead returns my /path/command.do, and not the
> acutal page.jsp name.
>

The getRequestURI() call will *always* refer to your action servlet -- it's purpose
is to tell you where the request is going, not where it came from.

The "referer" header is set by the browser, based on what URI it thinks the form
was on.  But, if you're using a Model 2 approach (with a
RequestDispatcher.forward() from the controller servlet to the JSP page) then the
browser does not know this happens -- therefore it will not set the referer the way
you want.  Moral of the story -- you'll need to track this in your app itself.

Craig McClanahan

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to