File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Servlet Mapping - WAS to JBOSS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet Mapping - WAS to JBOSS" Watch "Servlet Mapping - WAS to JBOSS" New topic

Servlet Mapping - WAS to JBOSS

Matthew Harshbarger

Joined: Jan 15, 2008
Posts: 1
I have a servlet mapping that works in WAS5.1 one way and differently in JBOSS4.2.2.

The issue is that in JBOSS the servlet is getting all requests even ones directed to a specific JSP. I understand that the way I'm mapping with /* that everything should get handled by the servlet, but in WAS this is not the case. The app I have is currently in WAS and we are considering moving it to JBOSS, so I need to figure out how to get the behavior we get from WAS.

I've had this topic posted on the JBOSS forum ( since 12/20 with not even a comment that I'm posting a dumb question. Would also like it if anyone has an opinion on JBoss community support or JBoss support in general as I have concern that if I move from WAS to JBoss not only will my costs go down, but so will my support.

Ben Souther

Joined: Dec 11, 2004
Posts: 13410

According to the spec, if more than one url-pattern fits the longest one that matches should take precedence.

I'm not sure if the default *.jsp mapping should override /*.
I don't recall it being mentioned in the spec.

One thing you could try, is to add your own mapping to *.jsp and point it to the default servlet in JBoss. Since JBoss uses Tomcat as its servlet container, I'm assuming it would be org.apache.catalina.servlets.DefaultServlet

The downside to this is that it would make your app somewhat server dependent.

Another approach would be to replace your servlet mapping with a filter that tests for the *.jsp extension and forwards everything else to your servlet.

Side note:
The mapping "/*" would also catch all requests for static files.
Are you handling those requests from your servlet as well?

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: Servlet Mapping - WAS to JBOSS
It's not a secret anymore!