Struts Subjective Questions And Answers

Totel:130 Click: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
Struts Interview Questions And Answers

Page 1

The Jakarta struts project, an open source project supported by the Apache software Foundation, is a server side java implementation of the model view controller (MVC) design pattern.
The struts framework designed to create Web application that easily separate the presentation layer and allow it to  be abstracted from the transaction and data layers.

   The struts framework models its server side implementation of the MVC using a combination of JSPs, custom JSP tags, and a Java Servlet. It involves the following steps :

   The incoming request is received by the ActionServlet, which acts as the controller, and the ActionServlet looks up the requested URI in an XML file.
   The Action Class performs its logic on the Model components associated with the application.
Once the Action has completed its processing, it returns control to the ActionServlet with a key that indicates the result of its processing. ActionServlet uses this key to determine where this result should be forwarded for presentation.
   The request is complete when the ActionServlet response by forwarding the request ot the view that was linked to the returned key, and this view presents the result of the Action.

MVC stands for Model-View-Controller. The MVC design pattern is originated from Smalltalk, consists of three components : a Model, a View, and a Controller.

  MODEL : Represents the data objects. The Model is what is being manipulated and presented to the user. Model contains the business logic of the application.

  VIEW : Serves as screen representation of the Model. It is the object that represents the current state of the objects.

  CONTROLLER : Defines the way the user interface reacts to the user's input. The Controller component is the object that manipulates the Model, or data object.

The following steps are involved to install struts framework in your web application :

  •     Uncompress the Struts Archive to your local disk.
  •     Create a new web Application say, MyStrutsApp inside the webapps directory under the tomcat directory.
  •     Copy all the jar files, extracted from the lib directory into the /webapps/MyStrutsApp/WEB-INF/lib directory.
  •     Create an empty web.xml file and copy it to the /webapps/MyStrutsApp/WEB-INF/ directory.
  •     Create an empty struts-config.xml file and copy it to the /webapps/MyStrutsApp/WEB-INF/ directory. The struts-config.xml file is the diployment descriptor for all Struts applicattion. It is the file that glues all of the MVCcomponents together.

Instead of using the standard HTML Form tag, like most HTML pages, the struts specific Form tag is : 

<html:form action="" name="" type="">

This tag with its subordinate input tags, encapsulates Struts form processing. The Form tag attributes are :  
action : Represents the URL to which this form will be submitted. This is also used to find the appropriate ActionMapping in the Struts configuration file.  
name : Identifies the key that is used to lookup the appropriate ActionForm that will represent the submitted form data.  
type : Names the fully qualified classname of the form bean you want to use in this request.

To use the struts specific <html:form> tag you have to use the taglib directive:
<%@ taglib uri="WEB-INF/struts-html.tld" prefix="html" %>

Goto Page:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
Struts Objective Questions And Answers

Struts Objective Questions And Answers

Struts Interview Questions And Answers

Struts Interview Questions And Answers

R4R,Struts Objective fresher and experienced, Struts Subjective fresher and experienced ,Struts Interview Questions And Answers,Struts fresher and experienced,Struts Interview fresher and experienced ,Struts Questions fresher and experienced,Struts Answers fresher and experienced