Struts2必需库: commons-fileupload.jar、commons-io-1.3.2.jar、freemarker-2.3.16.jar、javassist-3.7.ga.jar、ognl-3.0.jar、

struts-core-2.2.1.jar和xwork-core-2.2.1.jar

============================================================

struts.xml

<?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="false" />
<constant name="struts.ui.theme" value="simple"/>
<constant name="struts.i18n.encoding" value="UTF-8" />
<!-- <constant name="struts.custom.i18n.resources"
value="resources/framework/messages/messages-common,
resources/framework/messages/messages-welcome,
resources/framework/messages/messages-exception,
resources/framework/messages/messages-admin,
resources/framework/messages/messages-dictionary,
resources/framework/messages/messages-cnapsmanage,
resources/framework/messages/messages-clearing"/> -->
<!-- 上传文件大小限制 ,最大不超过100M-->
<constant name="struts.multipart.maxSize" value="104857600"/>
<!--<constant name="struts.multipart.saveDir" value="/opt/apache-tomcat-6.0.43/temp"/>--> <constant name="struts.action.extension" value="do" /> <package name="BasePackage" extends="json-default" namespace="/system">
<interceptors>
<!-- <interceptor name="AppExceptionHandler" class="com.agree.framework.struts2.interceptors.ExceptionHandlerInterceptor"></interceptor>
<interceptor name="ActionLogger" class="com.agree.framework.struts2.interceptors.ActionLoggingInterceptor"></interceptor> -->
<interceptor name="PrivilegeJudger" class="com.agree.framework.struts2.interceptors.PrivilegeJudgeInterceptor"></interceptor>
<interceptor name="DownloadPrivilege" class="com.agree.framework.struts2.interceptors.DownloadPrivilegeInterceptor"/> <!-- <interceptor-stack name="SystemConsoleInterceptorStack">
<interceptor-ref name="PrivilegeJudger"></interceptor-ref>
<interceptor-ref name="ActionLogger"></interceptor-ref>
<interceptor-ref name="AppExceptionHandler"></interceptor-ref>
<interceptor-ref name="defaultStack"></interceptor-ref>
</interceptor-stack> -->
</interceptors> <global-results>
<!-- <result name="login">/webpages/freamwork/welcome/welcomeTimeOut.jsp</result>
<result name="nologin">/webpages/freamwork/welcome/nologin.jsp</result>
<result name="APPEXCEPTION">/webpages/freamwork/exception/exception.jsp</result>
<result name="AJAX_SUCCESS" type="json">
<param name="ignoreHierarchy">false</param>
<param name="includeProperties">actionresult</param>
</result> -->
<result name="noSecurity">/noSecurity.jsp</result>
</global-results> <!-- 系统登录 -->
<action name="logon_*" class="LogonActionBean" method="{1}">
<!-- <interceptor-ref name="SystemConsoleInterceptorStack"></interceptor-ref> -->
<result name="success" type="json"></result>
<result name="redirect">/Pages/Layout/index.jsp</result>
<result name="logout">/Pages/Layout/login.jsp</result>
<result name="tologin">/Pages/Layout/login.jsp</result>
</action> </package> <include file="resources/framework/struts2//struts-layout.xml"></include>
<include file="resources/framework/struts2//struts-access.xml"></include>
<include file="resources/framework/struts2//struts-example.xml"></include>
<include file="resources/framework/struts2//struts-config.xml"></include>
<include file="resources/framework/struts2//struts-ide.xml"></include> </struts>

struts2 基本用法的更多相关文章

  1. Struts2 extends用法

    1.创建一个struts-extends.xml文件 <?xml version="1.0" encoding="UTF-8"?> <!DOC ...

  2. 【SSH2(实用文章)】--Struts2文件上传和下载的例子

    回想一下,再上一篇文章Struts2实现机制,该步骤做一步一步来解决,这种决心不仅要理清再次Struts2用法.映射机制及其在深入分析.最后一个例子来介绍Struts2一种用法,这里将做一个有关文件上 ...

  3. struts2整合spring应用实例

    我们知道struts1与spring整合是靠org.springframework.web.struts.DelegatingActionProxy来实现的,以下通过具体一个用户登录实现来说明stru ...

  4. Struts笔记一

    Struts 概念: 是一个MVC框架: Servlet的缺点 1.在web.xml中文件中需要配置很多行代码,维护起来很不方便呢,不利于团队合作. 2.一个servlet的入口只有一个doPost或 ...

  5. Struts 2的流程

    Struts 2的流程 一.Struts 2 的开发步骤: 在web.xml中定义核心的Filter来拦截用户的请求. 由于Web应用时基于请求/响应架构的应用,所以不管哪个MVC Web框架,都需要 ...

  6. struts2中#,$,%的用法以及el,ognl表达式的用法

    OGNL, JSTL, STRUTS2标签中符号#,$,%的用法示例 取Session中的值 <c:out value="${sessionScope.user.userId}&quo ...

  7. J2EE进阶(三)struts2 <s:action>标签的用法

    J2EE进阶(三)struts2 <s:action>标签的用法 前言 使用action标签,可以允许在jsp页面中直接调用Action,(类似AJAX页面调用)在调用Action时候,可 ...

  8. java struts2入门学习--OGNL语言基本用法

    一.知识点学习 1.struts2中包含以下6种对象,requestMap,sessionMap,applicationMap,paramtersMap,attr,valueStack; 1)requ ...

  9. struts2中s:iterator 标签的使用详解 及 OGNL用法

    简单的demo: s:iterator 标签有3个属性:value:被迭代的集合id   :指定集合里面的元素的idstatus 迭代元素的索引 1:jsp页面定义元素写法 数组或list <s ...

随机推荐

  1. 通过UIView获取UIViewController

    需求很简单,通过UIViewController.view内的任意控件获取当前UIViewController: 立马开写: /** * @brief 通过viewController内的view,获 ...

  2. csharp: Export DataSet into Excel and import all the Excel sheets to DataSet

    /// <summary> /// Export DataSet into Excel /// </summary> /// <param name="send ...

  3. 泛函编程(16)-泛函状态-Functional State

    初接触泛函状态觉着很不习惯.主要是在使用State数据类型时很难理解其中的原理,特别是泛函状态变迁机制(state transition mechanism):怎么状态就起了变化,实在难以跟踪.我想这 ...

  4. netty Failed to submit an exceptionCaught() event异常

    最近测试netty开发的服务端应用在关闭时,出现下列异常: ->###WARN#########nioEventLoopGroup-3-2###io.netty.util.internal.lo ...

  5. Webform(分页、组合查询)

    一.分页 1.写查询方法: public List<Student> Select(int PageCount, int PageNumber) {//PageCount为每页显示条数,P ...

  6. .net mysql 支持表情

    1.表 utf8mb4 2.字段  utf8mb4 3.连接字符串 utf8mb4 4.存储过程参数  utf8mb4

  7. 一个帖子学会Android开发四大组件

    来自:http://www.cnblogs.com/pepcod/archive/2013/02/11/2937403.html 这个文章主要是讲Android开发的四大组件,本文主要分为 一.Act ...

  8. android 永不关闭toast

    Toast信息提示框之所以在显示一定时间后会自动关闭,是因为在系统中有一个Toast队列;那么有些时候需要这个Toast信息提示框长时间显示,直到需要关闭它时通过代码来控制,而不是让系统自动来关闭To ...

  9. Servlet API遍程常用接口和类

    本文主要总结Servlet  API遍程常用接口和类 Servlet API http://tomcat.apache.org/tomcat-5.5-doc/servletapi/index.html ...

  10. IOS 网络浅析-(十三 SDWebImage 实用技巧)

    IOS 网络浅析-(十三 SDWebImage 实用技巧) 首先让我描述一下为了什么而产生的实用技巧.(在TableView.CollectionView中)当用户所处环境WiFi网速不够快(不能立即 ...