Struts2的Action名称搜索顺序:2014.12.30
struts.xml配置:
<struts>
<package name="hw" namespace="/test" extends="struts-default">
<action name="helloworld" class="com.self.action.HelloWorldAction" method="dohelloworld">
<result name="doresult">
/WEB-INF/actionpage/showresult.jsp
</result>
</action>
</package>
</struts>
正确访问路径:http://localhost:8080/Struts2_01/test/helloworld
如果浏览器访问路径:
先访问路径:“http://localhost:8080/Struts2_01/test/aa/bb/cc/dd/helloworld”没找到! 再访问路径:“http://localhost:8080/Struts2_01/test/aa/bb/cc/helloworld”也没找到!
...... 直到路径:“http://localhost:8080/Struts2_01/test/helloworld”找到了,返回界面显示
如果还找不到:就到默认<package></package>里面找
<!-- 默认配置:namespace属性为空 -->
<package name="hw" namespace="" extends="struts-default">
<action name="helloworld" class="com.self.action.HelloWorldAction" method="dohelloworld">
<result name="doresult">
/WEB-INF/actionpage/showresult.jsp
</result>
</action>
</package>
Struts2的Action名称搜索顺序:2014.12.30的更多相关文章
- 【Struts2学习笔记(1)】Struts2中Action名称的搜索顺序和多个Action共享一个视图--全局result配置
一.Action名称的搜索顺序 1.获得请求路径的URI,比如url是:http://server/struts2/path1/path2/path3/test.action 2.首先寻找namesp ...
- 02. struts2中Action名称的搜索顺序
搜索顺序 获得请求路径的URI,例如URL为:http://localhost:8080/struts2/path1/path2/path3/student.action 首先寻找namespace为 ...
- Action的搜索顺序(Struts2搜索Action的机制)
当访问如下链接时, http://localhost:8080/struts2Demo/path1/path2/path3/LoginAction.action 第一步:判断当前路径下action是否 ...
- Sturts2中Action的搜索顺序
http://localhost:8080/ProjectName/path1/path2/path3/XX.action 首先会判断以/path1/paht2/path3为namespace的pac ...
- Struts2学习三----------Action搜索顺序
© 版权声明:本文为博主原创文章,转载请注明出处 Struts2的Action的搜索顺序 http://localhost:8080/path1/path2/student.action 1)判断pa ...
- 第二篇——Struts2的Action搜索顺序
Struts2的Action的搜索顺序: 地址:http://localhost:8080/path1/path2/student.action 1.判断package是否存在,例如:/pat ...
- Struts2配置拦截器,struts2加载常量时的搜索顺序
1:struts2加载常量时的搜索顺序 1.Struts-default.xml 2.Struts-plugin.xml 3.Struts.xml 4.Struts-properties(自己创建的) ...
- struts2 模型驱动的action赋值优先顺序
struts2 模型驱动的action赋值优先顺序: 1.优先设置model的属性. 2.如果model属性中没有对应的成员变量,则向上冒泡,寻找action中的属性进行set. 如果action中的 ...
- struts中action名称反复导致的神秘事件
近期由于项目需求变更.须要本人对当中的某个业务功能进行改动.本人依照前台页面找action,依据action找代码的逻辑进行了改动(公司项目是ssh框架,struts配置全部是通过注解的方式进行.配置 ...
随机推荐
- 利用堆排序找出数组中前n大的元素
#include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <time.h> ...
- Sublime Text3 protobuf syntax file(语法文件)
将以下两个文件放置在X:XXX\Sublime Text 3x64\Data\Packages\User目录下,就可以为sublime3添加protobuf文件的语法高亮规则. 文件名:Protobu ...
- 比较setImmediate(func),setTimeout(func),process.nextTick(func)
node中的事件优先级机制: console.log('第一笔!'); process.nextTick(function() { console.log('吃个饭吧!'); setImmediata ...
- Intersection of Two Linked Lists | LeetCode
利用两个栈,然后分别存储每一个链表. 继而,相继pop相同的节点. 有些细节需要注意,请看最后的返回值是如何处理的. /** * Definition for singly-linked list. ...
- .Net程序员安卓学习之路1:登陆界面
任何编程学习起步均是HelloWorld,作为稍有>net编程经验的我们来说就跳过这步吧,咱们且从简单登录界面开始.先看看效果: 一.准备知识: 1. 安卓环境:安装好JDK,直接去官网下载AD ...
- JavasScript判断输入框不为空
<form name="form1" method="POST" action="add.php"> <table wid ...
- Linux 性能工具 - sar学习
简介 sar是一款在linux下的性能工具,可以观察到CPU,内存,IO,运行队列,每秒上下文切换等信息. 软件工具安装 #Ubuntu sudo apt-get install sysstat # ...
- App 上线流程
http://www.cocoachina.com/bbs/read.php?tid=330302
- Java学习-036-JavaWeb_005 -- JSP 动作标识 - forward
JSP 动作主要作用是根据指定的动作进行相应的处理. 一.param 动作 用来给 HTML 文件和 JSP 文件传递参数的,经常和 forward.include.plugin 动作结合使用,语法格 ...
- Java学习-002-Java初识
此文主要讲述什么是 Java,以及 Java 常识性知识,方便亲们进一步了解 Java 语言相关的常识. 一.Java 概述 Java 语言是美国 Sun Microsystems 公司于 1995 ...