Hi all I am trying to run sample servlet with jsp ,first i need to display the jsp page and then when user clicks on button the form parameters needs to be passed to the servlet which is given in jsp page using action in form tag.Below are my codes,please help me regarding this
when i tried url http://localhost:8080/<appl-name> then its displaying the default test.jsp page when i click on submit button its not at all responding and not giving any error,any idea what is the problem
You're assuming that the URL format of the HTML form action attribute and the web.xml url-pattern are identical - but they're not. The former needs to include the web app context name, whereas the latter does not. This may help: http://www.coderanch.com/how-to/java/RelativeLinks
I think you also have a problem with the attributes of your textarea. Only form elements with a "name" attribute will be submitted for form processing, not the "id" attribute. Use Firebug to look at the parameters being sent to the server on the submit. I think you'll find that nothing is being sent.
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
just replace the tag as
<form action="hello" method="POST".......>
<textarea ........ name="name">
<input type="submit" name="submit">
and check it...
and try to cast the parameter as
String enteredtext =(String) request.getParameter("name");