Introduction to the stripes view framework

Source: Internet
Author: User

Stripes thought it was amazing for the first time and made programmers who liked coding curious. What makes him jump pages flexibly and freely?

Stripes is a view framework used to build Web applications using the latest Java technology.It has the following features:


  • You do not need to configure ing for each action (actionbeans will be automatically discovered and configured using annotations), support for action forwarding, Servlet requests, and rest requests.

  • A powerful binding engine is used to construct web objects that are complex and independent from request parameters.

  • Easy-to-use and localized verification and type conversion systems. You can reuse actionbean as a view help class.

  • Supports multiple events corresponding to one form. Transparent file upload capability. supports continuous development (for example, you can build and test JSP before thinking about your actionbean.


1. Control forwarding in the strpes View

Strpes is mainly used to connect the page and background data. We use it to control page Jump and redirection-control the View data flow direction, so as to facilitate user data display.

650) This. width = 650; "src =" http://img.blog.csdn.net/20131105140616156? Watermark/2/text/plain/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma ==/ dissolve/70/gravity/center "style =" border: none; "/>

This picture is not enough to explain the problem. It should be exactly the meaning of the following chart:

650) This. width = 650; "src =" http://img.blog.csdn.net/20131105141839578? Watermark/2/text/plain/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma ==/ dissolve/70/gravity/center "style =" border: none; "/>

Here, stripes serves as a set of servlet processing sets, or a controller layer.

2. actionbeans filtering (ing * actionbean class to context)

Actionbeans filtering mainly loads the implementation class of the actionbean interface that implements stripes into the application context. The following is the Web. xml registration filtering configuration of the action package:


  1. <filter>      <display-name>Stripes Filter</display-name>      <filter-name>StripesFilter</filter-name>      <filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class>      <init-param>          <param-name>ActionResolver.Packages</param-name>          <param-value>com.boonya.stripes.actions</param-value>      </init-param>      <init-param>          <param-name>Interceptor.Classes</param-name>          <param-value>              net.sourceforge.stripes.integration.spring.SpringInterceptor          </param-value>      </init-param>  </filter>  <filter-mapping>      <filter-name>StripesFilter</filter-name>      <servlet-name>StripesDispatcher</servlet-name>      <dispatcher>REQUEST</dispatcher>  </filter-mapping>    <servlet>      <servlet-name>StripesDispatcher</servlet-name>      <servlet-class>net.sourceforge.stripes.controller.DispatcherServlet</servlet-class>      <load-on-startup>1</load-on-startup>  </servlet>  <servlet-mapping>      <servlet-name>StripesDispatcher</servlet-name>      <url-pattern>*.action</url-pattern>  </servlet-mapping>

Note: The actionresolver parameter under <filter> <ini-param>. packages value (param-value), which is configured as the location of your action class, such as COM. boonya. stripes. actions.


3. Stripes supports dynamic path ing

Stripes provides the following name:Net. SourceForge. Stripes. Controller. dynamicmappingfilter
The dynamic filter class to realize the dynamic configuration of the URL. This configuration is applicable to Servlet and practical and rest-style requests. The rest dynamic style supports variable parameters such: "/home/{username}/{password }". Reference: http://stripes.sourceforge.net/docs/current/javadoc/net/sourceforge/stripes/controller/DynamicMappingFilter.html, Which is configured in Web. XML as follows:

  1. <! -- Dynamically configure the implicit filter --> <filter> <description> dynamically maps URLs to actionbeans. </description> <display-Name> stripes dynamic mapping filter </display-Name> <filter-Name> dynamicmappingfilter </filter-Name> <filter-class> net. sourceForge. stripes. controller. dynamicmappingfilter </filter-class> <init-param> <param-Name> actionresolver. packages </param-Name> <param-value> COM. boonya. stripes. actions </param-value> </init-param> </filter> <filter-mapping> <filter-Name> dynamicmappingfilter </filter-Name> <URL-pattern>/ * </url-pattern> <dispatcher> request </dispatcher> <dispatcher> forward </dispatcher> <dispatcher> include </dispatcher> </filter-mapping>

Note: The actionresolver parameter under <filter> <ini-param>. packages value (param-value), which is configured as the location of your action class, such as COM. boonya. stripes. actions.


4. Stripes provides the tag library used by JSP to support webpage Layout

Import the tag library on the JSP page:

  1. <%@ taglib prefix="stripes"      uri="http://stripes.sourceforge.net/stripes.tld"%>


Common tags are supported: radio, form, input, etc. The Import and Export page reference has the corresponding automatic prompt function.


5. seamless integration of common frameworks

Common frameworks such as Hibernate, spring, and ibatis are compatible.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.