zoukankan      html  css  js  c++  java
  • Struts2环境配置

    1、导入jar包


    2、拷贝改动配置文件struts.xml。web.xml
    将struts.xml文件复制到src文件夹下,改为例如以下配置
    <? xml version= "1.0" encoding = "UTF-8" ?>
    <! DOCTYPE struts PUBLIC
        "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
        "http://struts.apache.org/dtds/struts-2.0.dtd" >

    < struts>
        <!-- 配置为开发模式 -->
        <constant name= "struts.devMode" value= "true" />
        <!-- 把扩展名配置为action -->
        <constant name= "struts.action.extension" value = "action" />
        <!-- 把主题配置为simple -->
        <constant name= "struts.ui.theme" value= "simple" />
       
        <package name= "default" namespace ="/" extends= "struts-default">
           
        </package >

        <!-- Add packages here -->

    </ struts>

    将web.xml文件配置成例如以下形式
    <? xml version= "1.0" encoding = "UTF-8"?>
    < web-app version= "2.5" xmlns = "http://java.sun.com/xml/ns/javaee"
            xmlns:xsi ="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation ="http://java.sun.com/xml/ns/javaee
           http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" >
            < display-name></ display-name >
           
            < filter>
                  < filter-name> struts2</ filter-name >
                   < 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>
           
            < welcome-file-list>
                  < welcome-file> index.jsp </welcome-file >
            </ welcome-file-list>
    </ web-app>

    ps:xml自己主动提示设置:
    window ==> preferences ==> 搜索xml ==> xml catalog ==> key type改为URI ==> 选择dtd文件路径 ==>复制key为dtd文件名称
  • 相关阅读:
    ssh
    ssh免密码登陆
    滑雪[dp]
    Help Jimmy[dp]
    动态规划 [子序列问题]
    最佳加法表达式 [dp]
    求排列的逆序数[归并排序]
    输出前m大个数,时间复杂度O(n+mlog(m)) [快排]
    不会递归?五道例题教你如何递归
    函数模板的琐碎笔记
  • 原文地址:https://www.cnblogs.com/jzssuanfa/p/6748159.html
Copyright © 2011-2022 走看看