0

File 1: public_html/eval.jsp

File 2: public_html/m/eval.jsp

File 1 form action:

action="submitEval" 

File 2 form action:

 action="../submitEval

web.xml:

<servlet>
  <servlet-name>submitEval</servlet-name>
  <servlet-class>submitPackage.submitEval</servlet-class>
</servlet>
<servlet-mapping>
  <servlet-name>submitEval</servlet-name>
  <url-pattern>submitEval</url-pattern>
</servlet-mapping>

Getting complaints of 404s when using the /m/ version of eval.jsp. Not able to recreate but I figure if they are getting a 404 it would most likely have to do with my servlet mapping, any thoughts?

Mr Man
  • 1,498
  • 10
  • 33
  • 54
  • should have a url and not just a string. putting "/" before "submitEval" in should solve it. – Shadab Faiz Mar 29 '17 at 16:28
  • @ShadabFaiz I have about 150 other servlets with a similar mapping (no leading "/") and none of them have an issue. I am wondering if the form action is wrong – Mr Man Mar 29 '17 at 16:39

1 Answers1

0

Since i cant post it in the comment so i'm posting it as an answer.The only time i have seen or used such mapping without any leading "/" is "*.anyString",and to test your mapping,i also went and tried the mapping which you are doing here,

<servlet>
    <servlet-name>Demo</servlet-name>
    <servlet-class>coo.Demo</servlet-class>\
    </servlet>

    <servlet-mapping>
        <servlet-name>Demo</servlet-name>
        <url-pattern>Demo</url-pattern>
        </servlet-mapping>

but i'm getting java.lang.IllegalArgumentException: Invalid <url-pattern> Demo in servlet mapping.But adding "/" or "*.Demo" fixes it as expected. So i'm curious why is it working for you but not for me.

Shadab Faiz
  • 2,380
  • 1
  • 18
  • 28