Overview of struts?, JAVA Programming

Struts is a framework with set of co operating servlets, classes and JSP tags that create a reusable MVC 2 design.

 

351_Struts.png

 

1. Client (Browser): A request from the client browser makes an HTTP request. The Web container will send to the request with an HTTP response, which gets displayed on the web browser.

2. Controller (ActionServlet class and RequestProcessor class): The controller accepts the request from the browser, and creates the decision where to send the request based on the struts-config.xml. Design pattern: Struts controller gives the command design pattern by invoking the Action classes based on the configuration  file  RequestProcessor  class's  process() and  the  struts-config.xml    function  uses     template function design pattern by invoking a sequence of methods like:

  • processPath(request, response) insert the request URI to calculate path element.
  • processMapping(request,response) use the path information to respond the action mapping
  • processRoles(request,respose,mapping) Struts Web application security which gives an authorization scheme. By default invokes request.isUserInRole().

 

  • processValidate(request,response,form,mapping) invokes the validate() function of the ActionForm.
  • processActionCreate(request,response,mapping)Æ accepts the name of the action class from the "type" attribute of the element.
  • processActionPerform(req,res,action,form,mapping) This function calls the execute method of the action class which is where business program is written.

3. ActionServlet : class is the controller part of the MVC design and is the core of the framework. It processes user requests, calculates what the user is trying to achieve according to the request, pulls data from the model to be given to the appropriate range, and selects the proper view to reaction to the user.

4. Workflow Logic (Action class): The Servlet sends the request to Action classes, which react as a thin wrapper to the business logic. The action class use control the workflow of the application. The Action class uses the Adapter design pattern. The Action class is a wrapper around the business program. The purpose of the Action class is to convert the HttpServletRequest to the business program. To use the Action class, subclass and overwrite the execute() function. The actual business logic could be in a separate package or EJB to allow reuse of business program in a protocol independent manner.

5. ActionForm class: Java presentation of HTTP input data. They may carry data over from one request to another, but usually represent the data submitted with the request.

 

Posted Date: 7/27/2012 5:40:02 AM | Location : United States







Related Discussions:- Overview of struts?, Assignment Help, Ask Question on Overview of struts?, Get Answer, Expert's Help, Overview of struts? Discussions

Write discussion on Overview of struts?
Your posts are moderated
Related Questions

Question: (a) (i) Explain the concept of inheritance. Illustrate your answer with a suitable Java example. (ii) Java does not support multiple inheritance but does provide

We need a very good iOS and/or Android developer preferred to be from Egypt. He will be responsible in developing iOS or/ and Android apps for a company. All details will be provid


Staging areas that have messages those have been sent and are waiting to be read. Note that, contrary to what the name queue suggests, messages don't have to be delivered in the or

This module is gives the fundamental functionality of the spring framework. In this module BeanFactory is the heart of any spring-based application. The whole framework was built o

ANDROID APK for 3G dongles support Project Description: We want someone who will modify this Android app or code a similar one. The App function is to let Android tablet P

Public class ConversionProgram {  public void start() {    String userChoice = askConversionCategory();   while (userChoice.equals("1") || userChoice.equals("2") || Page 2

Create a class called DeckOfCards that stores 52 objects of the Card class. Include methods to shuffle the deck, deal a deck, and report the number of cards left in the deck. The s

Write a code in a c++/java  for the automaton distributed in the class that accepts keywords(cat,bat,cab). Create an input file along with these words may be two or three copies of