
struts2
文章平均质量分 75
lh200808
这个作者很懒,什么都没留下…
展开
-
struts2 的3种驱动 第一种方式
[size=x-large]第一种是:将所有的属性都写在action中:[/size][color=red]在action中 我只写了一个属性username : action 中的内容:[/color] package com.luhua.test;public class UserAction { //用户名 priva...原创 2010-10-31 16:24:42 · 89 阅读 · 0 评论 -
struts2 的3种驱动 第二种方式 对象驱动
[size=x-large]第二种是:将对象写在action中:[/size][color=red]在action中 我只写了一个user 对象 : action 中的内容:[/color] package com.luhua.test;import com.luhua.pojo.User;public class UserAction ...原创 2010-10-31 16:41:53 · 132 阅读 · 0 评论 -
struts2 的3种驱动 第三种方式 模型驱动
[size=x-large]第三种是:将对象写在action中 action实现一个ModelDriven :[/size][color=red]在action中 我只写了一个user 对象 : action 中的内容:[/color]package com.luhua.test;import com.luhua.pojo.User;impor...原创 2010-10-31 17:01:34 · 122 阅读 · 0 评论 -
STRUTS2 乱码
终于在自己的项目中引入struts2了,但一上来就来一个中文乱码的问题。google了半天找了几个不痛不痒的结果,很是不满意。又调试了半天,终于 解决了中文乱码的问题。总结一下,中文乱码,首先要区分是页面乱码、action乱码,还是数据库乱码。大致的原理是java使用unicode编码-- >window使用gbk(gb2312的扩展集)--mysql默认使用utf-8(unicode的一种编码方...原创 2010-10-31 20:41:24 · 97 阅读 · 0 评论 -
struts2 转发
struts2中转发: 类ActionForward中的代码 package com.luhua.action; import com.opensymphony.xwork2.ActionSupport; public class ActionForward extends ActionSupport{ private static fi...原创 2010-11-22 09:34:13 · 87 阅读 · 0 评论