Skip to main content

Posts

Showing posts from July 5, 2013

Login form in servlet with Attribute & RequestDispatcher

login.html < html > < head > < title ></ title > < meta http-equiv ="Content-Type" content ="text/html; charset=UTF-8" > </ head > < body > < form method ="post" action ="login" > User Name: < input type ="text" name ="name" />< br /> Password: < input type ="password" name ="pass" />< br /> < input type ="submit" value ="login" /> </ form > </ body > </ html > login.java package Code; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * * @author Dilip */ public class login extends

Addition of Two Number using servlet and jsp

index.jsp <%@page contentType="text/html" pageEncoding="UTF-8"%> <! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd" > < html > < head > < meta http-equiv ="Content-Type" content ="text/html; charset=UTF-8" > < title > JSP Page </ title > </ head > < body bgcolor ="yellow" > < center >< h1 > Addition of Two Number </ h1 ></ center > < form action =" additionservlet " method ="post" > < table border ="0" width ="100" align ="center" > < tr > < td > First Number </ td > < td >< input type ="text" name ="txtnum1" value ="" /></ td >