If it is not a typo then your problem is here: <servlet-namemyRoot</servlet-name> --> <servlet-name>myRoot</servlet-name> (missing a >)
and then the next one too. Andrew -----Original Message----- From: Jon Doe [mailto:[EMAIL PROTECTED] Sent: Friday, July 23, 2004 3:11 PM To: [EMAIL PROTECTED] Subject: How does the deploy descriptor work? I thought I understood this, but clearly I don't! (Or at least my app doesn't work.) So, if I may, I would like to explain my understanding of how you create the deploy descriptor, and how it works in Tomcat. Just to get some clarity. OK, so I have a website, hosted as the context /mywebsite in Tomcat. So the localhost syntax to the root of this application is: http://localhost/mywebsite/ Now as I understand it, to get this URL to execute a servlet called Index (ie the class WEB-INF\classes\com\mywebsite\Index.class -- assumes Windows) I need to add this to the deployment descriptor: <servlet> <servlet-namemyRoot</servlet-name> <servlet-class>com.mywebsite.Index</servlet-class> </servlet> <servlet-mapping> <servlet-namemyRoot</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> That is straight forward. Now what if I want /Login, /Register, /Catalogue, etc? What is the url-pattern for these? If I enter /Login, for example, will this the call that servlet when I use this URL: http://localhost/mywebsite/Login If not, and I have to use a url-pattern of /mywebsite/Login, what happens if I decide to change the context path, or even to host it as a virtual server? Do I have to re-edit the web.xml file to reflect these changes? One final question. If the url-pattern for Login is /mywebsite/Login.something, does this mean the user has to type: http://localhost/mywebsite/Login.something for this to trigger? In short, is it the URL that is all important, and not the underlying filenames? (God knows how the wildcards work, so I've been trying to use 'full paths' as I thought this was easier. But I get no output even though I have lines writing to the ServletConfig log, to standard out and to the PrintWriter output!) If anyone can comment on the above -- such as it is totally accurate, or it is all rubbish -- that would be useful! Joe. _________________________________________________________________ STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail --------------------------------------------------------------------- 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]
