RE: How does the deploy descriptor work?
Hola, >I re-read this. It seems to say there are only *two* wildcard options -- >either /text/* or *.text. I'm not sure whether the *.text form will match >/some.text or just some.text. You're right : many people seem to think /*.txt is a valid url-pattern, and it's not. >So I've got my HTML form reference looking like this: > > ... > > ... OK. That means register.reg in the same directory level as the form itself. A url-pattern of /register.reg would work if your HTML form is right under your docBase. A *.reg pattern should work as well. >However, this doesn't work. Any reasons why not? Beause I'm new to this I'm >not sure whether this is a syntax error here, or an error is my code. >Whereever I have logging in my server.xml file I've set the debug level to >9, so I don't miss anything. But it seems not to push out anything. So if >you confirm the above is correct, I'll focus on my code. Your syntax seems fine. I'm not sure why it's not working for you. Enable the AccessLogValve that's commented out by default in the conf/server.xml file. Then test again, and check this log so you can see exactly what URL is requested when you submit the form, and what the server's response is. The Mapper (http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-connectors/util/java/o rg/apache/tomcat/util/http/mapper/Mapper.java?rev=1.40&view=markup) used to have more debug statements in it, like "trying exact match for url ... -- failed" which would be exactly what you need here. Yoav - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How does the deploy descriptor work?
Thanks for your reply. I've still a question, given what you have said. You might want to revisit a few key elements of the Deployment Descriptor as explained in the Servlet Specification. These include: - The use of welcome-file to serve the resource /. You typically do NOT want to define a servlet at url-pattern /. As I'm not using JSP or HTML files directly (at least for the time being) I tried putting servlet reference to the welcome-file and that worked. So I've got rid of the / -- so that's cool. Thanks for the tip. - url-pattern does not include the docBase, but rather it's relative to the docBase. So for http://yourhost/yourwebsite/Login, the url-pattern is just /Login. Read the Servlet Specification, it answers your questions completely and in detail. That's what it's for. I re-read this. It seems to say there are only *two* wildcard options -- either /text/* or *.text. I'm not sure whether the *.text form will match /some.text or just some.text. So I've got my HTML form reference looking like this: ... ... (Note no leading /. It didn't work when I had the slash.) So I then defined this in the web.xml file: ... Register *.reg ... However, this doesn't work. Any reasons why not? Beause I'm new to this I'm not sure whether this is a syntax error here, or an error is my code. Whereever I have logging in my server.xml file I've set the debug level to 9, so I don't miss anything. But it seems not to push out anything. So if you confirm the above is correct, I'll focus on my code. Thanks. Joe. Yoav Shapira Millennium Research Informatics _ 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]
RE: How does the deploy descriptor work?
Hi, You might want to revisit a few key elements of the Deployment Descriptor as explained in the Servlet Specification. These include: - The use of welcome-file to serve the resource /. You typically do NOT want to define a servlet at url-pattern /. - url-pattern does not include the docBase, but rather it's relative to the docBase. So for http://yourhost/yourwebsite/Login, the url-pattern is just /Login. Read the Servlet Specification, it answers your questions completely and in detail. That's what it's for. Yoav Shapira Millennium Research Informatics >-Original Message- >From: Jon Doe [mailto:[EMAIL PROTECTED] >Sent: Friday, July 23, 2004 4: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: > > > > com.mywebsite.Index > > > > / > > >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] This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How does the deploy descriptor work?
If it is not a typo then your problem is here: --> myRoot (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: com.mywebsite.Index / 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]