• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

url-pattern problem

 
Frank Sikuluzu
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No!! , even when the Servlet takes parameters, the URL patter does apply.
 
Balasubramanian Hitler
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is an typo
<servlet-mmapping> ----> <servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>/hello</url-pattern>
</servlet-mapping>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic