struts2
文章平均质量分 73
retacn
这个作者很懒,什么都没留下…
展开
-
struts2学习笔记一
1、建立Web项目;2、建立Struts2的配置文件(struts.xml);将Struts2的空项目中的配置文件(struts.xml)复制到项目的src目录下。Namespace决定了action的访问路径,默认为“”,可以接收所有路径的action,如果没有找到相应的namespace时,则使用namespace为空的action是用来解决重名的问题具体视图的返回可以原创 2012-09-07 09:44:31 · 327 阅读 · 0 评论 -
struts2学习笔记三----动态方法调用
动态方法调用 语法格式如下:http://ip:port/AppPath/<PackageNamespace>/<ActionName>!<MethodName>.<extension>举例:http://localhost:8080/struts2demo/user/admin/view1Action!sayHello1.actio...2012-09-09 10:41:00 · 94 阅读 · 0 评论 -
struts2学习笔记二--准备struts2的学习和开发环境
准备struts2的学习和开发环境1 导包2 参照开发包自带的例子在web.xml文件中配置3 参照开发包自带的例子编写Action类和配置struts.xml文件<struts> <package name="demo" namespace="/hello/word"> <action name="test" class="cn.yu.2012-09-09 10:35:00 · 56 阅读 · 0 评论 -
struts2学习笔记一
1、建立Web项目;2、建立Struts2的配置文件(struts.xml);将Struts2的空项目中的配置文件(struts.xml)复制到项目的src目录下。 Namespace决定了action的访问路径,默认为“”,可以接收所有路径的action,如果没有找到相应的namespace时,则使用namespace为空的action<package>是用来解决...2012-09-07 09:44:00 · 66 阅读 · 0 评论 -
struts2实现权限拦截
1 粗粒度的权限控制 (过滤器有前后顺序) web.xml文件配置PrivilegeFiltercn.yue.shop.web.filter.PrivilegeFilterPrivilegeFilter/control/*/** * Copyright (C) 2015 * * FileName:PrivilegeFilter.原创 2015-08-18 13:45:08 · 390 阅读 · 0 评论 -
struts2 学习笔记四---ongl表达式
OGNL表达式标签可以在jsp页面中查看CompoundRoot和OGNL Context map中的信息。如果不经过struts2的过滤器拦截就直接访问jsp页面,那么其中使用的,,等struts2标签都会报告TagUtil.getStack方法抛出的异常。1 访问值栈中的action的普通属性: 2 访问值栈中对象的普通属性(get set方法):原创 2012-09-09 10:43:18 · 1757 阅读 · 0 评论 -
struts2 学习笔记三----动态方法调用
动态方法调用 语法格式如下:http://ip:port/AppPath//!.举例:http://localhost:8080/struts2demo/user/admin/view1Action!sayHello1.action可以通过常量struts.enable.DynamicMethodInvocation关闭动态方法调用。*通配符方式1:原创 2012-09-09 10:41:35 · 668 阅读 · 0 评论 -
struts2学习笔记二--准备struts2的学习和开发环境
准备struts2的学习和开发环境1 导包2 参照开发包自带的例子在web.xml文件中配置3 参照开发包自带的例子编写Action类和配置struts.xml文件 public class TestAction {public String sayHello(){try {Servlet原创 2012-09-09 10:35:44 · 555 阅读 · 0 评论 -
struts2学习笔记四---ongl表达式
OGNL表达式<s:debug>标签可以在jsp页面中查看CompoundRoot和OGNL Context map中的信息。如果不经过struts2的过滤器拦截就直接访问jsp页面,那么其中使用的<s:debug>,<s:text>,<s:property value="%{getText()}">等struts2标签都会报告TagUt...2012-09-09 10:43:00 · 103 阅读 · 0 评论