I will add the section to install and configure struts later.
Now, let us assume that struts is installed and working.
Now let us create a sample user login screen, welcome page and error page.
The first screen will be the UserLogin.jsp and then users enter username and password.
Now we are validating the username and password against the hard coded values in the server side beans.
If the login is successful, then the request will forwared to welcome page or else to the error page.
For any struts project,
a) should have a bean extends to "org.apache.struts.action.ActionForm".
This is the helper class that gets all the html element values and populates the values of the
private instance variables of the bean.
This bean should have setter and getter methods for all the HTML form fields.
b) another bean should extend to "org.apache.struts.action.Action", is the model component of the MVC
framework that struts offers.
There is a method to be overriden,
public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
c) the action beans and actionform beans are to be mentioned in the struts-config.xml file, and
a properties file is to be created in the Root\WEB-INF\classes directory.
Let us create the UserLogin.jsp page