Monday, August 3, 2015

Sun Java Struts Tutorial

Develop the view pages like the success and error pages that will get used in the application. Example: UserCreated.jsp, UserError.jsp

Deploy the application

8.


Apache Struts is an open-source Java framework that helps creation of interlacing based applications. It provides a Model-View-Controller architecture that streamlines the development of web based applications by demarcating code into Model--representing business data, View--representing page design and Controller--representing page navigation logic. It also provides a library of tag library that offers functionality frequently needed in a web application.


Instructions


Setting up the development environment


1. Download Struts jar file from http://struts.apache.org/download.cgi


2. Add the struts jar file to your project's library path. This will make the Struts classes available for your application development.


3. Download and install the web container (example Apache Tomcat) to be used in deploying the Apache Struts application.


Developing the application


4. Model your application as a series of Forms that are sent to an action which direct the user to result (success or error) pages.


5. Design your web application and assemble the static pages and forms like java server pages and HTML pages in the project. Example: createUser.jsp.


6. Develop the model and action classes that will be used in the application. Example: UserAction.java, User.java


7.Struts Interlacing Utilize StepSun's Java programming speech is one of the most typical programming languages. It has a Broad adoption for server-side course for mesh applications.



Configure the web.xml file and define the Servlets and Struts actions that were developed in Section 2. A sample action will consist of web form page (from Section 2, Step2) that gets submitted to an action (Section 2, Step 3) which in turn directs the user to a success or error page (Section 2, Step 4).


9. (optional) Bundle the application into a web archive (war) file. The files can also be deployed directly as an expanded application.


10. Deploy the application files or the war file created in Step Two above onto the web container being used (example tomcat). Make sure all the application classes and library jar files are deployed correctly.


11. Access and test your Java Struts application.