Skip to main content

Posts

Showing posts with the label About Struts 2 FrameWork

About Struts 2 FrameWork

A framework tries to automate the common tasks and provides a platform for the users to build applications quickly. Struts 2 is based on the OpenSymphony Web Works Framework . Struts 2 framework implements the Model-View-Controller ( MVC ) design pattern. In Struts 2 the model, view and controller are implemented by the action , result and FilterDispatcher respectively. The controller's job is to map the user request to appropriate action. In Struts 2 FilterDispatcher does the job of Controller. Model contains the data and the business logic. In Struts 2 the model is implemented by the Action component. View is the presentation component of the MVC Pattern. In Struts 2 the view is commonly implemented using JSP, Velocity Template, Freemaker or some other presentation-layer technology. The controller receives the user request and determine which Struts 2 action to invoke. The framework creates an instance of this action and associate it with the newly ...

Struts2 Video Tutorial Part1

Introduction to Struts 2 Framework

Datetimepicker Tag Example

In this section, we are going to describe the datetimepicker tag. The datetimepicker tag is a UI tag that is used to render a date/time picker in a dropdown container. A stand-alone DateTimePicker widget that makes it easy to select a date/time or increment by week, month, and/or year. It is possible to customize the user-visible formatting with either the 'formatLength' (long, short, medium or full) or 'displayFormat' attributes. By default current locale will be used. Add the following code snippet into the struts.xml file. struts.xml <action name="datetimepickerTag" class="net.struts2.includeTag">    <result>/pages/uiTags/datetimepickerTag.jsp</result> </action> Create an action class as shown: includeTag.java package net.struts2; import com.opensymphony.xwork2.ActionSupport; import java.util.*; public class includeTag extends ActionSupport {   private Date m...