资源预览内容
第1页 / 共7页
第2页 / 共7页
第3页 / 共7页
第4页 / 共7页
第5页 / 共7页
第6页 / 共7页
第7页 / 共7页
亲,该文档总共7页全部预览完了,如果喜欢就下载吧!
资源描述
strucs2strucs2 笔记笔记*流程*struts2org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilterstruts2*.action/index.jsppublic class RegAction public String execute()return “ok“;*jsp 中通过$x.y-EL 调用属性*request-action 中的属性-session-public class UserAction extends ActionSupport private User user;public User getUser() return user;public void setUser(User user) this.user = user;-登录名login:$user.login *建立 struts 项目;1、添加 jar 包2、web.xml 中添加过滤器3、struts.xml*struts 执行过程:*1. http:/loalhost:6688/second/a/b/reg.action?name=tom3、struts.xml:*redirectAction :重定向到一个 action chain: forward 到一个 action A-chain-B 俩action,嵌套执行redirect: 重定向到一个 jspdispatcher: forward 到一个 jsp*显示提示消息:1、类 extends ActionSupportaddActionMessages();2、*保存消息:如何将 messa 存入 session:拦截器,paramAUTOMATIC*-radio 写法二:1、role 类2、设置属性private list(Role) rolelist=new Arraylist();添加静态块添加 getRolelist()方法3、-generic tagsui tags:form tags-non-form tagslabel-password-submit-checkbox-*小结:拦截器struts2 请求执行流程action 配置,请求路径。 。 。指定 namespace,action,form:theme=radio-list 写法action 与页面传输数据;get-在页面取出,set-页面的值读入
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号