GeeCON Prague 2014*
The moose likes Tomcat and the fly likes servlet mapping not getting invoked Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Tomcat
Bookmark "servlet mapping not getting invoked" Watch "servlet mapping not getting invoked" New topic
Author

servlet mapping not getting invoked

Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
Hi,

I have a directory - /news

I also have:

<servlet-mapping>
<servlet-name>blojsom</servlet-name>
<url-pattern>/news/*</url-pattern>
</servlet-mapping>

but if you go to http://dhtmlkitchen.com/news/ you get an apache directory listing of the directory /news. I do not want this. I want the blojsom servlet to be invoked.

What should I do? Can I fix this?
[ July 18, 2005: Message edited by: Bear Bibeault ]

comp.lang.javascript FAQ: http://jibbering.com/faq/
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

Which container are you using?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
It's tomcat 5.5.
[ July 18, 2005: Message edited by: Garrett Smith ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

Sounds like your connection between apache and tomcat is not configured correctly.

Moved to the Tomcat forum (where I believe this has been discussed before).
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

I'm not so sure that /news/ would invoke the servlet even without Apache's interferance without a /news (as opposed to /news/*) mapping -- but I'm not in a position to test it out at the moment.
Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
It matched it in TC 4.

And according to Head First Servlets, /news/* is a directory pattern and will match a directory path, even if it's missing an end slash (e.g. "/news").

I'm gonna search this forum to see if I can find that thread you mentioned.

Thanks,

Garrett
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

I think this is the topic that I was thinking of.
 
GeeCON Prague 2014
 
subject: servlet mapping not getting invoked