Re: Servlet mapping for root directory in a webapp?
Following up to myself here... On Thu, 7 Aug 2003, Fredrik Jonson wrote: I'm trying to get tomcat (from sun's jwsdp1.2) to do a default mapping. I (and a lot of other people, apparently =) have tried: servlet-mapping servlet-nameMainView/servlet-name url-pattern//url-pattern /servlet-mapping Today I changed it to: servlet-mapping servlet-nameMainView/servlet-name url-pattern/index.html/url-pattern /servlet-mapping And, as I understand it, tomcat(?) returns that servlet mapping for requests for the root catalog. Well, it is a kind of workaround, but since it works well enough I'll just accept that and continue. But if anyone know more about the magic behind it all, I'd be very greatful for a thorough explanation of how and why it works. TIA regards, -- Fredrik Jonson - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Servlet mapping for root directory in a webapp?
Alternatively, having a zero-length index.html file in your directory, together with a servlet-mapping should also work. Shapira, Yoav [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Howdy, Today I changed it to: servlet-mapping servlet-nameMainView/servlet-name url-pattern/index.html/url-pattern /servlet-mapping And, as I understand it, tomcat(?) returns that servlet mapping for requests for the root catalog. Well, it is a kind of workaround, but since it works well enough I'll just accept that and continue. But if anyone know more about the magic behind it all, I'd be very greatful for a thorough explanation of how and why it works. There's no magic, it's a clearly defined mapping for the url-pattern according to the laws in the servlet specification, v2.3. You can raise the logging level for the Host/Engine to see exactly the pattern resolution steps. The Servlet Specification v2.4, which tomcat 5 implements, supports a servlet as the welcome-file, which is what you are trying to do. Until then, most people make do with a simple index.html containing a meta http-equiv refresh directive. Yoav Shapira 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: Servlet mapping for root directory in a webapp?
Howdy, Today I changed it to: servlet-mapping servlet-nameMainView/servlet-name url-pattern/index.html/url-pattern /servlet-mapping And, as I understand it, tomcat(?) returns that servlet mapping for requests for the root catalog. Well, it is a kind of workaround, but since it works well enough I'll just accept that and continue. But if anyone know more about the magic behind it all, I'd be very greatful for a thorough explanation of how and why it works. There's no magic, it's a clearly defined mapping for the url-pattern according to the laws in the servlet specification, v2.3. You can raise the logging level for the Host/Engine to see exactly the pattern resolution steps. The Servlet Specification v2.4, which tomcat 5 implements, supports a servlet as the welcome-file, which is what you are trying to do. Until then, most people make do with a simple index.html containing a meta http-equiv refresh directive. Yoav Shapira 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]
Servlet mapping for root directory in a webapp?
Hello, I'm trying to get tomcat (from sun's jwsdp1.2) to do a default mapping. Ie, in my webbapp /stuff/ I want to get a servlet to serve the root page. As I understand it there is a default servlet that serves static content, I do not want to replace that one, but only load a specific servlet for the root url for my webapp. I (and a lot of other people, apparently =) have tried: servlet-mapping servlet-nameMainView/servlet-name url-pattern//url-pattern /servlet-mapping as I found it on a lot of search results, but as I understand it that pattern is already taken by the default servlet. It doesn't work. I have had little succes searching google, and the documentation for solutions. Is it at all possible, or does everyone just use a dummy index.html in the root directory and forwards the users to the real content serving servlet? TIA -- Fredrik Jonson - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]