
<p>hi
I am trying to insert record in database using hibernate in JSP(Netbeans). When I click insert button it should go to insert.java class but fails to go.</p>
<ul>
<li><p>index.jsp
<%</p>
<pre class="prettyprint">String uname="";
String pass="";
Object action;
</code></pre>
<p>%></p></li>
</ul>
<p><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Admin Login Form</title>
</head>
<body>
<form method="post" action="Insert.doPost">
Enter Username<input type="text" name="uname" value="" /><br>
Enter Password<input type="password" name="passwd" value="" /><br>
<input type="submit" value="Insert" name="login" />
</form>
</body>
</html></p>
<p>insert.java</p>
<p>public class Insert {</p>
<pre class="prettyprint">protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
String c1 = request.getParameter("uname");
String c2 = request.getParameter("pass");
//String action = request.getParameter("insert");
ConnectDatabase db = new ConnectDatabase();
db.setInfo(c1,c2);
</code></pre>
<p>}
}</p>
<p>Plz help me</p>

Perform action on Servlet from jsp in the following manner:
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.