Reputation: 28032
I have this code
<form method="post" action="localhost:8080/WelcomeServlet">
<select name="Signal_Drop">
<option value="True">True</opion>
</select>
<select name="Video_Glitch">
<option value="True">True</option>
</select>
<select name="Call_Drop">
<option value="True">True</option>
</select>
<input type="Submit" value="Submit">
</form>
When I click the submit button, the page is not changing. Nothing happens. It is not calling the servlet.
Upvotes: 0
Views: 643
Reputation: 1606
first you've a small html bug at line 3 </opion>
instead of </option>
second , I agree with the two first answers avoid absolute urls as the server will resolve the url automagicaly.
web.xml
<servlet>
<servlet-name>welcome</servlet-name>
<servlet-class>com.lab.WelcomeServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>welcome</servlet-name>
<url-pattern>/WelcomeServlet</url-pattern>
</servlet-mapping>
your form
<body>
<form method="post" action="WelcomeServlet">
<select name="Signal_Drop">
<option value="True">
True
</option>
</select> <select name="Video_Glitch">
<option value="True">True</option>
</select> <select name="Call_Drop">
<option value="True">True</option>
</select> <input type="Submit" value="Submit">
</form>
Hope it'll help you
Upvotes: 0
Reputation: 197
Instead of
localhost:8080/WelcomeServlet
write
/WelcomeServlet
It's not very good to write absolute address here.
Upvotes: 0
Reputation:
Write
http://localhost:8080/WelcomeServlet
instead of just
localhost:8080/WelcomeServlet
And you perhaps have to add the context of your WAR before the Servlet name.
Upvotes: 3