This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Servlets and the fly likes url-pattern problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "url-pattern problem" Watch "url-pattern problem" New topic
Author

url-pattern problem

Frank Sikuluzu
Ranch Hand

Joined: Dec 16, 2003
Posts: 116
<servlet>
<servlet-name>MyServlet</servlet-name>
<servlet-class>dir1.dir2.MyServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>/hello.html</url-pattern>
</servlet-mapping>

<servlet-mmapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>/hello</url-pattern>
</servlet-mapping>

The "Myservlet" is created under a "test" web application.

Now, the original URL is "http://server/test/servlet/dir1.dir2.MyServlet?param=abc", I tried "http://server/test/hello.html?param=abc" and "http://server/test/hello?param=abc" but neither of them works. Did I do anything wrong here ? Does the URL-pattern apply to the case when Servlet takes some parameter ?
Balasubramanian Hitler
Greenhorn

Joined: Feb 04, 2004
Posts: 4
Try to restart your server if the below url also not working
http://server/test/servlet/MyServlet?param=abc
[ October 13, 2004: Message edited by: Balasubramanian Hitler ]
Senthil B Kumar
Ranch Hand

Joined: Feb 09, 2004
Posts: 160
No!! , even when the Servlet takes parameters, the URL patter does apply.


Work like you don't need the money. Love like you've never been hated. Dance like nobody's watching. Sing like nobody's listening. Live like it's Heaven on Earth.
Currently I Reside Here WEBlog
Balasubramanian Hitler
Greenhorn

Joined: Feb 04, 2004
Posts: 4
There is an typo
<servlet-mmapping> ----> <servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>/hello</url-pattern>
</servlet-mapping>
 
jQuery in Action, 3rd edition
 
subject: url-pattern problem
 
It's not a secret anymore!