permaculture playing cards*
The moose likes Servlets and the fly likes question about servlet-mapping url-patterns Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "question about servlet-mapping url-patterns" Watch "question about servlet-mapping url-patterns" New topic
Author

question about servlet-mapping url-patterns

Jon Bricker
Greenhorn

Joined: Feb 28, 2003
Posts: 23
I have a servlet mapping that looks something like this

<servlet-mapping>
<servlet-name>myServlet</servlet-name>
<url-pattern>/myServlet</url-pattern>
</servlet-mapping>

What is being passed in looks like this www.example.com/myServlet?id=fas46t2

I would think the above mapping would catch it but it is getting a 404. Do I need to make some changes to account for the parameter being passed in?

I should add that this is running on Tomcat 7.0.5 and this is an outside call trying to reach the servlet.

thanks for the help.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60752
    
  65

Looks like you are missing the context path in the URL.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jon Bricker
Greenhorn

Joined: Feb 28, 2003
Posts: 23
Bear Bibeault wrote:Looks like you are missing the context path in the URL.


That was it. thanks for the help.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60752
    
  65

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: question about servlet-mapping url-patterns
 
Similar Threads
Servlet doesn't pick initial parameter
How to declare/override Weblogic's ServletInvoker in web.xml
How to specific numerous url-patterns in web.xml
can I do this in servlet-mapping?
advantage of using servlet-name element in DD