Code:
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 

{
		
if(null !=request.getParameter("check"))
			{
				
			String act = request.getParameter("check");

      if (act.equalsIgnoreCase("inreq"))
			{

			
			
			response.setContentType("text/html");
			
			
			StudId=Integer.parseInt(request.getParameter("Studentid"));
			AccId=Integer.parseInt(request.getParameter("Accountid"));
			AccNum=Integer.parseInt(request.getParameter("AccNum"));
			curntBal=Integer.parseInt(request.getParameter("Currbalance"));
			ystudy=Integer.parseInt(request.getParameter("study"));
			comit_amt=Integer.parseInt(request.getParameter("Committedamnt"));
			
		
			Bean b=new Bean();
			b.setStudentId(StudId);
			b.setStdAccId(AccId);
			b.setaccnum(AccNum);
			b.setystudy(ystudy);
			b.setcommitamnt(comit_amt);
			b.setCurntBal(curntBal);
	
			Dao create=new Dao();
			flag=create.insertStudent(b);
			
			if(flag==1)
			{
			request.setAttribute("stuList",create.studentId);
			request.setAttribute("accntid",create.accntId);
			request.setAttribute("accNm",create.accnum);
			request.setAttribute("curB",create.curntBal);
			
			request.setAttribute("eDate",create.curyr);
			request.setAttribute("cmtAmt",create.commitAmt);

			getServletConfig().getServletContext().getRequestDispatcher("/view_student.jsp").forward(request,response);
			}
			else
				getServletConfig().getServletContext().getRequestDispatcher("/Error.jsp").forward(request,response);
				
			}
}

Last edited by shabbir; 9Dec2011 at 09:19.. Reason: Code blocks