That is pretty much what my understanding was as well. But I am glad you cleared it up for me. So appending my webapp folder name is not "bad practice" then. It is just something that has to be done.
Thanks Mike. Gregg -----Original Message----- From: Mike Curwen [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 4:35 PM To: 'Tomcat Users List' Subject: RE: URI Servlet Path Problems Sorry, I realized after sending it didn't explain the misunderstanding... I got caught up with this not long ago when using sendRedirect, so I think I have this clear in my mind. It's all in the browser. The browser interprets form actions that begin with slashes as meaning "relative to the domain" so that would result in an action of "/servlet/foo" being requested by the browser as "http://www.yourdomain.com/servlet/foo" So unless your application is the deafult application (which in this case it's not, it's /holocron), you'll get a 404. If on the other hand you give it no leading slash ("servlet/foo"), the browser says "relative". But relative to the domain and "folder" (for lack of a much more technically accurate label). And to a browser, /holocron/secure looks like folders. So if you GOT to the form by saying http:///www.yourdomain.com/holocron/secure/showmetheform Then all relative urls will be from http://www.yourdomain.com/holocron/secure/ > -----Original Message----- > From: Gregg Bolinger [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 06, 2003 4:22 PM > To: 'Tomcat Users List' > Subject: RE: URI Servlet Path Problems > > > Lol, I might as well just say /holocron/servlet/AddReference. > That works. Is this typical or is there a problem and this > is just a quick fix. > > Gregg > > -----Original Message----- > From: Mike Curwen [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 06, 2003 4:16 PM > To: 'Tomcat Users List' > Subject: RE: URI Servlet Path Problems > > How about > <form action="<%= request.getContextPath() > %>/servlet/AddReference"> </form> > > ? > > > -----Original Message----- > > From: Gregg Bolinger [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, August 06, 2003 4:10 PM > > To: 'Tomcat Users List' > > Subject: RE: URI Servlet Path Problems > > > > > > I did that. But here is the problem with that. My pages are > > under a folder called "secure" so then the URL was > > http://localhost:8080/holocron/secure/holocron/servlet/AddRefe > > rence ha. Thanks for the quick response though. > > > > Gregg > > > > -----Original Message----- > > From: Mike Curwen [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, August 06, 2003 4:08 PM > > To: 'Tomcat Users List' > > Subject: RE: URI Servlet Path Problems > > > > take off the leading slash on the form's action, so that it's > > referencing your web-app (root), and not the server root. > > > > The URI pattern still needs the leading slash. > > > > > > > > > -----Original Message----- > > > From: Gregg Bolinger [mailto:[EMAIL PROTECTED] > > > Sent: Wednesday, August 06, 2003 4:04 PM > > > To: [EMAIL PROTECTED] > > > Subject: URI Servlet Path Problems > > > > > > > > > I have a web app in the following directory > > c:\tomcat\webapps\holocron > > > > > > I have specified my URI to a servlet as > > > <uri-pattern>/servlet/AddReference</uri-pattern> > > > > > > And in my form I have action="/servlet/AddReference" > > > > > > The problem is that when I click the submit button, I am taken to > > > http://localhost:8080/servlet/AddReference and what it > should be is > > > http://localhost:8080/holocron/servlet/AddReference > > > > > > So I am getting an error Cannot Find Servlet/Path etc. Now, if I > > > change my action to > action="/holocron/servlet/AddReference" it works > > > just fine, but that doesn't make any sense to me. I have > read a bit > > > on the Invoker Servlet being turned off in Tomcat 4.1.24 but > > > can't really find any good information on it. Can someone > > > explain to me what is going on here? > > > > > > Thanks. > > > > > > Gregg > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
