"But must the HREF (and, correspondingly, the servlet mapping), always
start with the Web app name?"
No. You can specify a relative URL.
"If I wanted to make the HREF simply "Y", would the request make it to MyApp
at all?"
Yes. Just specify "Y" instead of "/MyApp/Y".
"If so, would the URL have been transformed into "/MyApp/Y" so that the servlet
mapping would do the right thing?"
yes. If you don't specify an absolute path, the context stays the same. Another
effect you may see is if you redirect a servlet's response to a relative path,
i.e. "A.jsp" instead of "/YourApp/A.jsp" the servlet will try to find
"/MyApp/A.jsp".
--- Duane Morse <[EMAIL PROTECTED]> wrote:
> I'm confused about the rules related to servlet mapping. Suppose my Web app
> is called MyApp, and I make a servlet
> mapping to associate the URL "/MyApp/X" with servlet XServlet. Suppose
> XServlet produces a page with a HREF to
> another servlet, YServlet. I know that mapping "/MyApp/Y" to "YServlet"
> works, so "/MyApp/Y" would be a valid
> HREF. But must the HREF (and, correspondingly, the servlet mapping), always
> start with the Web app name?
> If I wanted to make the HREF simply "Y", would the request make it to MyApp
> at all? If so, would the URL have been
> transformed into "/MyApp/Y" so that the servlet mapping would do the right
> thing?
>
> Duane Morse, Eldorado Computing Inc., Phoenix Arizona
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35
a year! http://personal.mail.yahoo.com/
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html