HTML FILE
<form method = "post" action = "getSum">
Enter first no. : <input type = "text" name = "First"/>
Enter Second no.: <input type = "text" name = "Second"/>
SUM : <input type = "text" name = "Sum"/>
</form>
sum.java
package calculation;
public class sum extends HttpServlet {
private static final long serialVersionUID = 1L;
public sum() {
super();
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
int first = Integer.parseInt(request.getParameter("First"));
int second = Integer.parseInt(request.getParameter("Second"));
int sum = first+second;
PrintWriter out = response.getWriter();
out.println("");
}
}
I want to put the result sent by servlet into the input box which i made in html file how to do that? I am new to servlet programming pls help me out a little bit