Struts2
Edifiergl
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Struts2笔记一之简单了解Struts2
1、Struts2所需要的jar为:commons-fileupload-1.2.1.jar、commons-io-1.3.2.jar、 commons-logging-1.0.4.jar、freemarker-2.3.13.jar、ognl-2.6.11.jar、struts2-core-2.1.6.jar、 xwork-2.1.2.jar、原创 2014-08-13 22:36:21 · 589 阅读 · 0 评论 -
Struts2笔记六之i18n国际化
1.国际化的原理定义对应国家的配置文件:app_zh_CN.properties文件里面有welcome.msg=你好app_en_US.properties文件里面有welcome.msg=hello将其放在properties目录以下是在Java中测试代码ResourceBundle res = ResourceBundle.getBundle("propert原创 2014-08-13 23:07:50 · 1008 阅读 · 0 评论 -
Struts2文件上传
页面代码:upload.jsp<%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%> "> 文件上传原创 2014-08-13 23:12:38 · 575 阅读 · 0 评论 -
Struts2结合jquery使用Ajax传递Json数据
1.所需jar包struts2的jar包:freemarker.jar ognl.jar struts2-core.jar commons-logging.jar commons-fileupload.jar commons-io.jar xwork-core-2.1.6.jarjson的jar包:json-lib.jar 这个是json所需jar包struts-js原创 2014-08-14 23:18:36 · 3465 阅读 · 1 评论 -
Struts2笔记二之struts.xml
Struts2笔记二之struts.xml1、struts.xml中的package:原创 2014-08-13 22:57:30 · 725 阅读 · 0 评论 -
Struts2笔记五之Struts标签
1、页面使用Struts标签需要引入2、Struts2标签简介1.通用标签1) property2) seta)默认为action scope, 会将值放入reques和ActionContext中。b)page,request,session,application3)bean4)include对中文文件支持有问题,不建议使用,如需包含,改用jsp包含原创 2014-08-13 23:06:54 · 723 阅读 · 0 评论 -
Struts2笔记四之Ognl
1、ognl(Object Graph Navigation Language)表达式是中value里面的username这个表达式在Action类中定义private String username;并配上set/get方法,则username这个会存放在值栈中。而ognl表达式就是取值栈中的值得表达式。user.xxx只有传,才会构造,想初始化domain model,可以自己ne原创 2014-08-13 23:04:54 · 495 阅读 · 0 评论 -
Struts2下载
因为下载文件就是一个按钮或者一个链接,所以以下就不列出页面代码,只列出struts.xml配置和Action类1.一个简单的文件下载struts.xml: image/gif代表GIF图片,image/jpeg代表JPG图片-->text/plain 例如取值为inputStream 的属性需要编写getInputStream()方法 -->i原创 2014-08-13 23:19:16 · 651 阅读 · 1 评论 -
Struts2笔记三之Result
Struts2笔记三之Result原创 2014-08-13 23:03:07 · 644 阅读 · 0 评论 -
Struts2笔记七---拦截器
1.自定义拦截器:要有一个自定义的拦截器类,它需要实现Interceptor接口,里面有一个intercept方法。这个就是拦截器主要的实现方法。intercept这个方法有一个参数ActionInvocation invocation,这里必须要在intercept方法中使用invocation调用invoke()方法。在这个invoke()方法之前执行的代码就是Struts执行我们原创 2014-08-13 23:09:26 · 531 阅读 · 0 评论
分享