Re: Tomcat not seeing servlet
2010/2/14 David Short > Thank you Juha. The " works nicely. > > -Original Message- > From: Juha Laiho [mailto:juha.la...@iki.fi] > Sent: Sunday, February 14, 2010 8:49 AM > To: users@tomcat.apache.org > Subject: Re: Tomcat not seeing servlet > > On 02/14/2010 06:21 PM, David Short wrote: > > "./AuthLogin" and "AuthLogin" still don't work. > > > > It works with the fully qualified path > > "http://yourserver:port/yourwebapp/AuthLogin"; or "../../AuthLogin" > > Ah, yes, that completes the picture. And below I'll > somewhat repeat what Konstantin already explained, but > perhaps in a little bit different way. > > The url-patterns you set in web.xml are relative to the > application (context) root: > > >> > >> AuthLoginServlet > >> /AuthLogin > >> > > .. which means that the full URL for the above servlet will be > http://server:port/contextroot/AuthLogin > > However, URLs you set in jsp:s are "true" URLs, which means > that the /AuthLogin in your jsp form is not relative to > the application root: > > >> Login.jsp snippet: > >> > > ... /AuthLogin here refers to > http://server:port/AuthLogin > > The proposed forms > > > > > > would both refer to > http://server:port/yourwebapp/path_to_Loginjsp/AuthLogin > > ... where, apparently the path_to_Loginjsp in your case > has two levels of directories. To make either of the above > forms work, your url-pattern for the AuthLoginServlet would > have to be > /path_to_Loginjsp/AuthLogin > ... and this would pretty much be the easiest way to solve > the problem; with this, your JSP could really have the > form action as plain "AuthLogin". > > The JSTL tag library does also contain a tag "c:url", which > helps in making URLs that refer to the application itself; > that would be another solution if your application already > uses JSTL. For an explanation, see f.ex. > http://www.ibm.com/developerworks/java/library/j-jstl0318/ > -- > ..Juha > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > > -- MBA Ing. Ugo Ojeda del Arco Gerente de Desarrollo de Sistemas Universidad del Pacifico Telf. 2190100 - 2228 / 2161 PD Tarda 7 segundos en imprimir este email y 7 años en crecer el árbol que servirá para hacer el papel.
Re: Tomcat not seeing servlet
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Konstantin, On 2/14/2010 8:53 AM, Konstantin Kolinko wrote: > Try this instead: > > > > or this > Even better: "> This will encode the URL with the session id if necessary, and pre-pend any context path necessary. As pointed our by another poster, the use of a tag library such as JSTL's takes care of this for you, and always uses context-relative URLs (just as the above code would do). - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkt5kQ0ACgkQ9CaO5/Lv0PDs5gCfbQvX7JSjX2FdkquQjUYqyApt EZQAnjgHll4T6kCUX0u3aDafbGUuCSoF =3lsS -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat not seeing servlet
Thank you Juha. The " works nicely. -Original Message- From: Juha Laiho [mailto:juha.la...@iki.fi] Sent: Sunday, February 14, 2010 8:49 AM To: users@tomcat.apache.org Subject: Re: Tomcat not seeing servlet On 02/14/2010 06:21 PM, David Short wrote: > "./AuthLogin" and "AuthLogin" still don't work. > > It works with the fully qualified path > "http://yourserver:port/yourwebapp/AuthLogin"; or "../../AuthLogin" Ah, yes, that completes the picture. And below I'll somewhat repeat what Konstantin already explained, but perhaps in a little bit different way. The url-patterns you set in web.xml are relative to the application (context) root: >> >> AuthLoginServlet >> /AuthLogin >> .. which means that the full URL for the above servlet will be http://server:port/contextroot/AuthLogin However, URLs you set in jsp:s are "true" URLs, which means that the /AuthLogin in your jsp form is not relative to the application root: >> Login.jsp snippet: >> ... /AuthLogin here refers to http://server:port/AuthLogin The proposed forms > > would both refer to http://server:port/yourwebapp/path_to_Loginjsp/AuthLogin ... where, apparently the path_to_Loginjsp in your case has two levels of directories. To make either of the above forms work, your url-pattern for the AuthLoginServlet would have to be /path_to_Loginjsp/AuthLogin ... and this would pretty much be the easiest way to solve the problem; with this, your JSP could really have the form action as plain "AuthLogin". The JSTL tag library does also contain a tag "c:url", which helps in making URLs that refer to the application itself; that would be another solution if your application already uses JSTL. For an explanation, see f.ex. http://www.ibm.com/developerworks/java/library/j-jstl0318/ -- ..Juha - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat not seeing servlet
On 02/14/2010 06:21 PM, David Short wrote: "./AuthLogin" and "AuthLogin" still don't work. It works with the fully qualified path "http://yourserver:port/yourwebapp/AuthLogin"; or "../../AuthLogin" Ah, yes, that completes the picture. And below I'll somewhat repeat what Konstantin already explained, but perhaps in a little bit different way. The url-patterns you set in web.xml are relative to the application (context) root: AuthLoginServlet /AuthLogin .. which means that the full URL for the above servlet will be http://server:port/contextroot/AuthLogin However, URLs you set in jsp:s are "true" URLs, which means that the /AuthLogin in your jsp form is not relative to the application root: Login.jsp snippet: ... /AuthLogin here refers to http://server:port/AuthLogin The proposed forms would both refer to http://server:port/yourwebapp/path_to_Loginjsp/AuthLogin ... where, apparently the path_to_Loginjsp in your case has two levels of directories. To make either of the above forms work, your url-pattern for the AuthLoginServlet would have to be /path_to_Loginjsp/AuthLogin ... and this would pretty much be the easiest way to solve the problem; with this, your JSP could really have the form action as plain "AuthLogin". The JSTL tag library does also contain a tag "c:url", which helps in making URLs that refer to the application itself; that would be another solution if your application already uses JSTL. For an explanation, see f.ex. http://www.ibm.com/developerworks/java/library/j-jstl0318/ -- ..Juha - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat not seeing servlet
"./AuthLogin" and "AuthLogin" still don't work. It works with the fully qualified path "http://yourserver:port/yourwebapp/AuthLogin"; or "../../AuthLogin" Thank you. -Original Message- From: Konstantin Kolinko [mailto:knst.koli...@gmail.com] Sent: Sunday, February 14, 2010 5:53 AM To: Tomcat Users List Subject: Re: Tomcat not seeing servlet 2010/2/14 David Short : > > > AuthLoginServlet > > /AuthLogin > > The above is correct. > Login.jsp snippet: > Try this instead: or this The mappings in web.xml are relative to your webapp, so you'll have to call http://yourserver:port/yourwebapp/AuthLogin unless your webapp is named ROOT (case-sensitively). The is processed by browser, and action="/AuthLogin"> instructs it to create a relative URL using "/AuthLogin" for the path. The starting "/" tells the browser that it is an absolute path on that server. My proposals above turn this into a relative path (relative to the URL of the page that displayed that login.jsp snippet). See "relative URLs" in HTML spec for more details. Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat not seeing servlet
2010/2/14 David Short : > > > AuthLoginServlet > > /AuthLogin > > The above is correct. > Login.jsp snippet: > Try this instead: or this The mappings in web.xml are relative to your webapp, so you'll have to call http://yourserver:port/yourwebapp/AuthLogin unless your webapp is named ROOT (case-sensitively). The is processed by browser, and action="/AuthLogin"> instructs it to create a relative URL using "/AuthLogin" for the path. The starting "/" tells the browser that it is an absolute path on that server. My proposals above turn this into a relative path (relative to the URL of the page that displayed that login.jsp snippet). See "relative URLs" in HTML spec for more details. Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat not seeing servlet
> From: David Short [mailto:dsh...@san.rr.com] > Subject: Tomcat not seeing servlet > > description The requested resource (/AuthLogin) is not available. Where is your webapp deployed? Do you have a element for it? (You may not need one.) If there is one, where is it, and what's in it? Where is the AuthLoginServlet.class file located? Any messages of interest in the Tomcat logs? - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org