Creating an application using Struts2

Creating an application using Struts2
Step 1. Open Eclipse and Goto New >> Dynamic Web Project Step 2. Provide “StrutsApplication” as Project name and select “2.4” as Dynamic web module version and click Next Step 3. Click Next Step 4. Click Next Step 5. Click Finish Step 6.  Copy all the required JAR files in WebContent >> WEB-INF >> lib folder. Create this folder if ...

Struts Components

Struts Components
The web.xml File (Deployment Descriptor) This is the file which the container reads. This file has all the configuration information which we have defined for our web application. The configuration information includes the index file, the default welcome page, the mapping of our servlets including path and the extension name, any init parameters, information related ...

Overview of Struts Framework

Overview of Struts Framework
Overview of Struts Framework Open source Based on the Model-View-Controller (MVC) design paradigm, distinctly separating all three levels: Model: application state View: presentation of data (JSP, HTML) Controller: routing of the application flow Implements the JSP Model 2 Architecture Stores application routing information and request mapping in a single core file, struts-config.xml The Struts Framework, ...

Struts

What is Struts? Struts Framework was developed by Craig McLanahan in 2002 and subsequently handed over to Apache Jakarta project group. Struts Framework is the implementation of Model-View-Controller (MVC) design pattern for the JSP and Servlets.   What is Model-View-Controller (MVC) ? Model-View-Controller architecture is all about dividing application components into three different categories Model, View ...

ServletConfig and ServletContext

Both ServletConfig and ServletContext are configuration objects used by servlet container to initialize various init parameters for a web application.However, they differ in terms of the scope and availability of init parameters defined by both of them    S.No.  ServletConfig  ServletContext  1. one ServletConfig object per servlet  one ServletContext object shared by all the servlets ...

Preinitialization of Servlet

A container does not initialize the servlets as soon as it starts up, it initializes a servlet when it receives a request for that servlet first time. This is called lazy loading. The servlet specification defines the element, which can be specified in the deployment descriptor to make the servlet container load and initialize the ...

JSTL Core Library Actions

source: Exam Guide : David Bridgewater   There are 14 core library actions, divided into 4 groups 1. General Purpose : <c:out>, <c:set>,<c:remove> and <c:catch> 2. Conditional : <c:if>, <c:choose>, <c:when>, <c:otherwise> 3. Iteration : <c:forEach>, <c:forTokens> 4. URL Related :  <c:import>, <c:url>, <c:redirect>,<c:param>    S.No.  Core Libary Action  Attribute Name  Run Time Expression Allowed  Mandatory  Default Value  Type  1.  <c:out>  value  Yes  Yes  NA  Object   ...

JSP standard actions

JSP Standard action are predefined tags which perform some action based on information that is available at the time when the browser requested a jsp page.   There are 11 jsp standard actions are available S.No.  Standard Actions  Descriptions  1.  <jsp:useBean>  to create or search an exisiting bean  2  <jsp:setProperty>  to set the bean property ...

JSP include standard action and include directive

 S.No.  include directive <%@ include file=”…” %>  JSP include   1. Content of the file specified in the attribute “file” of the include directive will be pasted as it is at tranlation time , where include directive is used in the jsp  At runtime, the includED file will be executed and the response will be included ...

Is Invalid Statement

1. Using the method isUserInRole(), overrides any declarative authorization related to method in which it is invoked – isUserInRole() method itself doesn’t do any authorization.   2. <c:remove scope=”session”> name </c:remove> – value attribute is mandatory for      <c:remove>   3. Benefits of the JSP precompilation is , it avoids initialization on the first request.   ...