Home  >  Struts 2

Struts 2 Tutorial with Examples

By Arvind Rai, April 30, 2014
Apache struts 2 has been developed by Craig McClanahan initially. This is an open source java framework that is used to build java web application. Struts 2 is extensible framework which uses plugins to gain some extra capability. Using annotation, XML can be removed from struts 2 coding. Struts 2 adopt MVC architecture. In this page we will learn struts 2 by example. Every example is explained in detail and has a download link for source code.
Struts 2 + Hibernate 3 Integration with Full-Hibernate-Plugin using @SessionTarget and @TransactionTarget Annotation Example On this page we will provide struts 2 and hibernate 3 integration with Full-Hibernate-Plugin using @SessionTarget and @TransactionTarget annotation example. Struts 2 + Freemarker Template Annotation Integration Example This page will provide Struts 2 and Freemarker template annotation integration example. To get started with it, we need to include Freemarker JAR dependency in our Struts 2 project. Struts 2 + Quartz 2 Scheduler Integration Example This page will explain struts 2 and quartz 2 scheduler integration example. With the help of ServletContextListener we can use quartz with struts 2. Struts 2 does not provide any specific plugin... Struts 2 + REST Web Service Integration Example This page will provide the Struts 2 and REST web service integration example. Struts 2 provide REST plugin to implement REST web service. Parent package should be rest-default... Struts 2 + JSON Integration Annotation Example In this page, we will learn Struts 2 JSON integration using annotation. Struts 2 supports JSON response using JSON plugin. We need to use json-default as parent package... Struts 2 Annotation File Upload Example: Single and Multiple Struts 2 provides efficient way to support file uploads. There are tag library to write view in JSP. Errors can be displayed on UI which is required by the user...
Struts 2 OGNL Expression Tutorial with Examples OGNL is Object Graph Navigation Language. OGNL is an expression that can set and get the property of java object. In struts 2 OGNL is used to associate Action class and UI components... @UrlValidator Annotation Example in Struts 2 In this page we will learn how to use @UrlValidator to validate a field for a URL. URL is validated against a regex. Struts 2 provides the attribute where we can define our own regex... @RequiredFieldValidator and @StringLengthFieldValidator in Struts 2 In this page, we will understand how to use @RequiredFieldValidator and @StringLengthFieldValidator annotation in struts 2. These annotations are used to validate form fields... @DoubleRangeFieldValidator and @IntRangeFieldValidator in Struts 2 @DoubleRangeFieldValidator and @IntRangeFieldValidator are the strust 2 annotation to validate form field. Both validates the form field value for a given min and max... @ConversionErrorFieldValidator and @DateRangeFieldValidator in Struts 2 @ConversionErrorFieldValidator and @DateRangeFieldValidator are the struts 2 validation annotation. Both @ConversionErrorFieldValidator and @DateRangeFieldValidator works at method level... @RequiredStringValidator and @EmailValidator in Struts 2 @RequiredStringValidator and @EmailValidator are the struts 2 validation annotations. @RequiredStringValidator checks if string field is not empty. @EmailValidator checks if a filed contains valid email or not... Struts 2 Annotation: @ResultPath @ResultPath in struts 2 is used to change default location of results. @ResultPath annotation can be applied on class level as well as in package-info.java... Struts 2 Exception Handling Example with @ExceptionMapping Annotation In this page we will learn struts 2 annotation based exception handling. @ExceptionMappings and @ExceptionMapping are two annotations to handle exception in struts 2... Struts 2 Annotations: @ParentPackage @ParentPackage annotation in struts 2 is used to define different parent struts package. It is annotated on action class. @ParentPackage uses a name which can be declared in struts xml... Struts 2 Annotations: @Namespace, @Results In this page, we will learn about @Namespace and @Results struts annotation. @Namespace hides the package structure from URL and @Results defines the response of action class... Struts 2 @Action Annotation Example @Action annotation in struts 2 defines URL pattern for an Action class. Each method of an action class can be fetched by a separate URL. This facility provides the power to hide package name in URL... Struts 2 Custom Interceptor Example Using @InterceptorRef Annotation Struts 2 supports strong custom interceptor annotation and xml based. In this example we will use @InterceptorRef to support custom interceptor. Custom interceptor is a class which implements... Struts 2 Hibernate 3 Integration Example Using Annotation In this page we will learn struts 2 and hibernate 3 integration using annotation. I will create a user form and the detail of user will be saved in Mysql database... Struts 2 Annotation Message Resource Example In this example we will see how to use Message Resource or Resource Bundle in struts 2 using annotation. Message Resource files is a property file in which we put key value pairs... Struts 2 Validation Annotation Example In this page we will learn how to validate a field using struts 2 annotation. In action class use annotation to validate property and enable validation in form tag in jsp... Struts 2 Login Application XML Based Example In this page, we will learn how to create an application in Struts 2 using XML configuration. For the example we have taken a login application. Struts 2 applications can be created annotation based and xml based... Struts 2 StrutsPrepareAndExecuteFilter in web.xml StrutsPrepareAndExecuteFilter belongs to org.apache.struts2.dispatcher.ng.filter package. StrutsPrepareAndExecuteFilter can also be understood by its name... Struts 2 Annotation Simple Login Example In this page, we will learn how to start with struts 2 by a simple login example using annotation. I have tried to explain step by step how to configure the struts 2 to use in our example...
POSTED BY
ARVIND RAI
ARVIND RAI
FIND MORE TUTORILAS
comments powered by Disqus








Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us