struts-config.xml配置文件是一个在Web客户端组件的视图和模型之间的联系,但你的项目的99.99就不会碰这些设置%。基本的配置文件包含以下主要内容:

SN Interceptor & 描述
1 struts-config
This is the root node of the configuration file.
2 form-beans
This is where you map your ActionForm subclass to a name. You use this name as an alias for your ActionForm throughout the rest of the struts-config.xml file, and even on your JSP pages.
3 global forwards
This section maps a page on your webapp to a name. You can use this name to refer to the actual page. This avoids hardcoding URLs on your web pages.
4 action-mappings
This is where you declare form handlers and they are also known as action mappings.
5 controller
This section configures Struts internals and rarely used in practical situations.
6 plug-in
This section tells Struts where to find your properties files, which contain prompts and error messages

下面是示例struts-config.xml文件:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd"> <struts-config> <!-- ========== Form Bean Definitions ============ -->
<form-beans>
<form-bean name="login" type="test.struts.LoginForm" />
</form-beans> <!-- ========== Global Forward Definitions ========= -->
<global-forwards>
</global-forwards> <!-- ========== Action Mapping Definitions ======== -->
<action-mappings>
<action
path="/login"
type="test.struts.LoginAction" > <forward name="valid" path="/jsp/MainMenu.jsp" />
<forward name="invalid" path="/jsp/LoginView.jsp" />
</action>
</action-mappings> <!-- ========== Controller Definitions ======== -->
<controller
contentType="text/html;charset=UTF-8"
debug="3"
maxFileSize="1.618M"
locale="true"
nocache="true"/> </struts-config>

struts-config.xml文件的更多详细信息,请检查你的Struts文档。

struts-config.xml 文件:的更多相关文章

  1. MyBatis2:config.xml文件

    前言 前一篇文章,讲了MyBatis入门,讲到了MyBatis有两个基本的配置文件,一个用来配置环境信息,一个用来写SQL语句.前者我把它命名为config.xml,config.xml的内容是: & ...

  2. MyBatis(2):config.xml文件

    前言 前一篇文章,讲了MyBatis入门,讲到了MyBatis有两个基本的配置文件,一个用来配置环境信息,一个用来写SQL语句.前者我把它命名为config.xml,config.xml的内容是: 1 ...

  3. Android项目中的config.xml文件 “config.xml”

    Android应用程序需要保存一些配置时,可以将这些配置项放置到values/config.xml文件中. 实例分析: <?xml version="1.0" encodin ...

  4. ssh框架中.xml文件小技巧分离xml

    struts.xml文件 struts.xml文件里的action可以分离出来,如: <!-- 预警信息监测 --> <include file="config/strut ...

  5. 无废话Android之android下junit测试框架配置、保存文件到手机内存、android下文件访问的权限、保存文件到SD卡、获取SD卡大小、使用SharedPreferences进行数据存储、使用Pull解析器操作XML文件、android下操作sqlite数据库和事务(2)

    1.android下junit测试框架配置 单元测试需要在手机中进行安装测试 (1).在清单文件中manifest节点下配置如下节点 <instrumentation android:name= ...

  6. 初学DOM树解析xml文件

    做了一次设计模式实验的题目: 某软件公司为新开发的智能手机控制与管理软件提供了一键备份功能,通过该功能可以将原本存储在手机中的通信录.短信.照片.歌曲等资料一次性全部拷贝到移动存储介质(例如MMC卡或 ...

  7. 转载 Silverlight实用窍门系列:1.Silverlight读取外部XML加载配置---(使用WebClient读取XAP包同目录下的XML文件))

    转载:程兴亮文章,地址;http://www.cnblogs.com/chengxingliang/archive/2011/02/07/1949579.html 使用WebClient读取XAP包同 ...

  8. Java+XSL合并多个XML文件

    使用 Java 解析 XML 文件有许多成熟的工具,如 dom4j 等等.但在一些场景中,我们可能使用 Ant.Maven 等构建工具对多个 XML 文件进行合并,我们希望可以直接通过脚本文件,或者简 ...

  9. Struts 关联DTD 文件

    Struts 的xml 文件在Eclipse 中  默认是不会有提示的. 但是我们可以关联DTD 文件, 这样子就可以出现如下的struts   提示了 1. 首先得先确保自己有Struts2 的Sr ...

  10. jenkins 实现多用户同时触发任务 + 修改job的config.xml 不重启服务生效

    (后期添加: 这篇博客是在刚研究并发构建时写的,所以方法比较老套,采用的时流水线(pipeline)的方式,实现时通过如果job的用户配置来创建多个新的执行任务的job,并且将执行日志回收到入口job ...

随机推荐

  1. SpringMVC——redirect重定向跳转传值

    原文:https://my.oschina.net/u/2273085/blog/398374 spring MVC框架controller间跳转,需重定向.有几种情况:不带参数跳转,带参数拼接url ...

  2. Linq To Sql的各种查询

    一.Inner Join   //request为查询条件   var result = from a in db.TableA  join b in db.TableB  on a.ID equal ...

  3. C#属性和字段区别、get与set用法

    属性和字段的区别 在C#中,我们可以非常自由的.毫无限制的访问公有字段,但在一些场合中,我们可能希望限制只能给字段赋于某个范围的值.或是要求字段只能读或只能写,或是在改变字段时能改变对象的其他一些状态 ...

  4. Spine U3D整合流程问题

    Spine U3D整合流程问题 What: 公司2d项目开发,动画外包的spine.本来在spine里面一切正常,但是导入u3d运行库的时候动画切换的时候原来的动画是好的,一旦切换了就乱帧了. 如下结 ...

  5. 火车票订票API 用PHP完成火车票订票流程

    本教程用来演示聚合数据-火车票订票接口的使用流程. 配置好PHP环境,PHP版本最好大于5.5 去聚合数据-火车票订票接口申请key:http://www.juhe.cn/docs/api/id/17 ...

  6. Python——在Unicode和普通字符串之间转换

    1.1. 问题 Problem You need to deal with data that doesn't fit in the ASCII character set. 你需要处理不适合用ASC ...

  7. Qt Creator项目中使用qss

    近期学习qt .使用的编译器是qt creator ,学习过程中遇到的题就是 怎样将程序中将要用到的.qss 文件静态编译到.exe程序中,而不是在程序执行时动态加载.动态加载的最大问题在于一旦.qs ...

  8. 使用CAsyncSocket总结

    最近想起CAsyncSocket这个类,记得很早以前用过,现在却想不起来怎么用了,翻了翻以前的代码又看了看msdn感觉这个类做简单的异步socket太简单了,几行代码就可以搞定,在此先做个总结. 不管 ...

  9. curl 重定向问题

    今天在curl一个网站的时候遇到一个奇怪的问题,下面是输出: lxg@lxg-X240:~$ curl -L http://www.yngs.gov.cn/ -v * Hostname was NOT ...

  10. ORCAD应用小技巧

    1.位号复制 递增和不变 2.netlist log信息 3.off page页码对其 4.批量修改off page符号命名的方法 5.批量修改电源符号 6.capture中instance和Occu ...