Class ChpassWd

java.lang.Object
   |
   +----javax.servlet.GenericServlet
           |
           +----javax.servlet.http.HttpServlet
                   |
                   +----ChpassWd

public class ChpassWd
extends HttpServlet
This servlet is invoked when a user wants to change the password, It has different methods for secure(get) and insecure(post) modes of access.While in the post method the received password has to be crypted before comparing with the one in the database, the one in get method comes already encrypted.


Variable Index

 o myCom
 o out
 o pass2
 o passwd

Constructor Index

 o ChpassWd()

Method Index

 o doCommon(HttpServletRequest, HttpServletResponse)
The method checks if the user has been authenticated, if yes changes the password, else the user is returned back to the login page.
 o doGet(HttpServletRequest, HttpServletResponse)
For secure method of access
 o doPost(HttpServletRequest, HttpServletResponse)
For insecure method of access.

Variables

 o myCom
 public static Connection myCom
 o out
 public static PrintWriter out
 o passwd
 public static String passwd
 o pass2
 public int pass2

Constructors

 o ChpassWd
 public ChpassWd()

Methods

 o doGet
 public void doGet(HttpServletRequest req,
                   HttpServletResponse res) throws IOException, ServletException
For secure method of access

Overrides:
doGet in class HttpServlet
 o doPost
 public void doPost(HttpServletRequest req,
                    HttpServletResponse res) throws IOException, ServletException
For insecure method of access.

Overrides:
doPost in class HttpServlet
 o doCommon
 public void doCommon(HttpServletRequest req,
                      HttpServletResponse res) throws IOException, ServletException
The method checks if the user has been authenticated, if yes changes the password, else the user is returned back to the login page.