This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Servlets and the fly likes question about servlet-mapping url-patterns Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply 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: 56222
    
  13

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


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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: 56222
    
  13

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