Issue
I have a servlet mapping like below.
<servlet>
<servlet-name>SubmitComment</servlet-name>
<servlet-class>org.rohitsharma.db.servlet.SubmitComment</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SubmitComment</servlet-name>
<url-pattern>/SubmitComment</url-pattern>
</servlet-mapping>
When I hit a form with action SubmitComment
. It worked on my localhost.
But when I uploaded it on real host it give me error like.
Not Found
The requested URL /SubmitComment was not found on this server.
How should I change these mapping to get it working?
Here is the form:
<form action="SubmitComment" method="post" id="leavereply">
<ol><li>
<label for="name">Name</label>
<input id="name" name="name" class="text" />
</li><li>
<label for="email">Email Address</label>
<input id="email" name="email" class="text" />
</li><li>
<label for="message">Your Message</label>
<textarea id="message" name="message" rows="8" cols="50"></textarea>
</li>
<input type="hidden" id="blog_id" name="blog_id" value="<%out.print(blog.blog_id);%>">
<li>
<input type="image" name="imageField" id="imageField" src="images/submit.gif" class="send" />
<div class="clr"></div>
</li></ol>
</form>
Solution
It was server setting issue. Nothing related to the code or any mapping. Thanks for your time. It was some setting issue on my live hosts. I changed my host and things worked :)
Answered By - Rohit Sharma