Struts2 - Interceptor中取得ActionName、Namespace、Method
在Struts2的Interceptor中取得当前执行对应的ActionName、Namespace、Method方法:
可以使用:
System.out.println(invocation.getProxy().getNamespace());
System.out.println(invocation.getProxy().getActionName());
System.out.println(invocation.getProxy().getMethod());
其中,Namespace对应的是struts.xml的package的namespace。(其实对应的是URL中的路径)
比如:
有一个URL: http://localhost:8080/test/admin/billing/invoice!add.action
Namespace: /admin/billing
ActionName: invoice
Method:add (默认是execute)
Struts2 - Interceptor中取得ActionName、Namespace、Method的更多相关文章
- struts2 在 Action 或 Interceptor 中获取 web.xml 中配置的 <context-param> 参数 (这是我的第一篇博文,哈哈。)
最近为了改一个问题,想加一个控制开关,就在web.xml 中配置了一个 <context-param> 参数,并在 Action 或 Interceptor 中获取参数值. 1.在 web ...
- Struts2 Interceptor学习
Interceptor的设计思想,其实是Spring里面的AOP思想,尽管Struts2又有自己的Interceptor但是,在实际开发中,用的较少,SSH整合之后你可以采用AOP事务处理进行拦截,更 ...
- struts2.0中struts.xml配置文件详解
先来展示一个配置文件 <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration ...
- Struts2 interceptor使用经验小结
1. interceptor 调用Spring容器中的bean 在interceptor中常有需要调用Spring Bean的需要,其实很简单和Struts2的Action一样配置即可. Spring ...
- 在Struts2框架中使用Servlet的API
1. 在Action类中也可以获取到Servlet一些常用的API * 需求:提供JSP的表单页面的数据,在Action中使用Servlet的API接收到,然后保存到三个域对象中,最后再显示到JSP的 ...
- 2.C#中泛型在方法Method上的实现
阅读目录 一:C#中泛型在方法Method上的实现 把Persion类型序列化为XML格式的字符串,把Book类型序列化为XML格式的字符串,但是只写一份代码,而不是public static s ...
- Struts2框架中使用Servlet的API示例
1. 在Action类中也可以获取到Servlet一些常用的API * 需求:提供JSP的表单页面的数据,在Action中使用Servlet的API接收到,然后保存到三个域对象中,最后再显示到JSP的 ...
- ognl,jstl,struts2标签中符号#,$,%的用法
STRUTS2标签操作Map <s:iterator value="sundayMap"> <td colspan="7" ...
- spring boot: filter/interceptor/aop在获取request/method参数上的区别(spring boot 2.3.1)
一,filter/interceptor/aop在获取参数上有什么区别? 1,filter可以修改HttpServletRequest的参数(doFilter方法的功能), interceptor/a ...
随机推荐
- Sql 2000丢失sa 密码,重置sa密码
重置密码需要勾选一个授权 在企业管理器中-->服务器设置——>勾选“运行对系统目录直接进行修改” 勾选后就可以重置密码了. /////////////////// 详细: http://w ...
- jQuery关于Select的操作
jQuery获取Select选择的Text和Value: 1. var checkText=jQuery("#select_id").find("option:selec ...
- PCL可视化显示 直接加载显示pcb文件
简单可视化类,是指直接在程序中使用,而且不支持多线程. #include<iostream> #include<pcl\point_cloud.h> #include<p ...
- hihoCoder#1015 : KMP算法 (KMP模板)
代码如下: # include<iostream> # include<cstdio> # include<cstring> # include<vector ...
- meta是什么意思?
META标签,是HTML语言head区的一个辅助性标签.在几乎所有的page里,我们都可以看 到类似下面这段html代码: -------------------------------------- ...
- LESS中文版函数手册
LESS是一种由Alexis Sellier设计的动态层叠样式表语言.LESS 做为 CSS 的一种形式的扩展,它并没有减少 CSS 的功能,而是在现有的 CSS 语法之上,添加了许多其它的功能. 在 ...
- caffe: test code Check failed: K_ == new_K (768 vs. 1024) Input size incompatible with inner product parameters.
I0327 20:24:22.966171 20521 net.cpp:849] Copying source layer drop7I0327 20:24:22.966179 20521 net.c ...
- jquery循环延迟加载,用于在图片加载完成后再加载js
<html> <head> <script type="text/javascript" src="http://lib.sinaapp.c ...
- 让边框和文本一样高,不受line-height影响,可以使用padding,padding可以用于行内元素
如果设置了,display:inline-block;边框大小至少和行高一样.这样就可能比文字高.
- PHP-mysqllib和mysqlnd
1.什么是mysqlnd驱动? PHP手册上的描述:MySQL Native Driver is a replacement for the MySQL Client Library (libmysq ...