OA Learning Note -002-sruts2.1 configuration

Source: Internet
Author: User

First, Jar

Commons-fileupload-1.2.1.jar
Commons-io-1.3.2.jar
Freemarker-2.3.15.jar
Ognl-2.7.3.jar
Struts2-core-2.1.8.1.jar
Xwork-core-2.1.6.jar

Second, the configuration file

1.struts.xml

1<?xml version= "1.0" encoding= "UTF-8"?>2<!DOCTYPE Struts public3"-//apache software foundation//dtd Struts Configuration 2.0//en"4"Http://struts.apache.org/dtds/struts-2.0.dtd" >5 6<struts>7<!--configured for development mode--8<constant name= "Struts.devmode" value= "true"/>9<!--to configure the extension to action--Ten<constant name= "Struts.action.extension" value= "action"/> One<!--to configure the theme to simple--- A<constant name= "Struts.ui.theme" value= "simple"/> -      -     the< PackageName= "Default" namespace= "/"extends= "Struts-default" > -        -<!--Configure the action for testing, not integrated with spring, class attribute write full name-- -<!--when STRUTS2 is integrated with spring, the class property can write the bean's name-- +<action name= "Test"class= "Testaction" > -<result name= "Success" >/test.jsp</result> +</action> A  at  -</ Package> -  -<!--ADD packages here-- -  -</struts>

2.web.xml

1<?xml version= "1.0" encoding= "UTF-8"?>2<web-app version= "3.0"3Xmlns= "Http://java.sun.com/xml/ns/javaee"4Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"5Xsi:schemalocation= "Http://java.sun.com/xml/ns/javaee6http//java.sun.com/xml/ns/javaee/web-app_3_0.xsd ">7<display-name></display-name>8<welcome-file-list>9<welcome-file>index.jsp</welcome-file>Ten</welcome-file-list> One  A<!--Configure the core of the STRUTS2 filter-- -<filter> -<filter-name>struts2</filter-name> the<filter-class>org.apache.struts2.dispatcher.ng.filter.strutsprepareandexecutefilter</filter-class> -</filter> -<filter-mapping> -<filter-name>struts2</filter-name> +<url-pattern>/*</url-pattern> - </filter-mapping> + </web-app>

OA Learning Note -002-sruts2.1 configuration

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.