This discussion is archived
2 Replies Latest reply: Dec 7, 2012 4:54 AM by user12216452 RSS

servlet mappings in web.xml is not picking up propelry

user12216452 Newbie
Currently Being Moderated
Hi,
I am developing on java web application in Jdeveloper and trying to deploy in integrated wls.

i have one jsp page, and one java servlet. and added url-pattern and servlet mappings in web.xml, but when running the jsp, it is not picking up the servelt . I am getting the error saying 'The server has not found anything matching the Request-URI.'

Can you help me in fixing this issue.

Thanks in advance.
  • 1. Re: servlet mappings in web.xml is not picking up propelry
    RenévanWijk Oracle ACE
    Currently Being Moderated
    When have something like
         <servlet>
            <servlet-name>TestServlet</servlet-name>
            <servlet-class>userinterface.servlets.TestServlet</servlet-class>
        </servlet>
        <servlet-mapping>
            <servlet-name>TestServlet</servlet-name>
            <url-pattern>/testservlet</url-pattern>
        </servlet-mapping>
    in your web.xml, and your war is called something.war; the servlet can be reached at: http://hostname:port/something/testservlet.
  • 2. Re: servlet mappings in web.xml is not picking up propelry
    user12216452 Newbie
    Currently Being Moderated
    Hi,
    I have one Test.html file under public_html folder, and in that html form action url is as below:

    <form action="/servlet/testServlet" method="post">
    .
    .
    .</form>

    and my web.xml content is:

    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
    <servlet>
    <display-name>TestServlet</display-name>
    <servlet-name>TestServlet</servlet-name>
    <servlet-class>oracle.apps.servlet.TestServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>TestServlet</servlet-name>
    <url-pattern>/servlet/testServlet</url-pattern>
    </servlet-mapping>
    </web-app>

    When i run the HTML page, the URL is : http://local:7101/Application1-Test-context-root/Test.html
    and when click on button, its redirecting to http://local:7101/servlet/testServlet and getting the error saying that 'The server has not found anything matching the Request-URI' ideally it shuld redirect to http://local:7101/Application1-Test-context-root/servlet/testServlet.

    let me know what could be the problem?

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points