aspose file tools*
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
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: 140
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>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: url-pattern problem
 
Similar Threads
question about servlet-mapping and auto redirecting URL
Problem Invoking Servlet thru Proxy Server
Difference JSP File & JSP Page
can I do this in servlet-mapping?
problem in web.xml