随笔分类 - struts2
struts2学习笔记(5)拦截器
摘要:继承AbstractInterceptor类,在类中完成拦截器的功能,只需实现intercept方法即可,提供了init()和destroy()的空实现 示例:显示执行action所用的时间 ①在src中建包com.lzhc.interceptor,在包中建TimerInterceptor.java
阅读全文
struts2学习笔记(4)接收参数
摘要:①用action属性接收 登录界面例子 在webroot下创建login.jsp和success.jsp login.jsp中加入表单: <form action="LoginAction.action" method="post"> 用户名:<input type="text" name="use
阅读全文
posted @ 2017-03-02 16:02
小学森也要学编程
struts2学习笔记(3)struts.xml的一些常用设置
摘要:在开发中通常需要用到多个配置文件,可以通过在web.xml中添加以下代码: <include file="login.xml"></include> 将src中的login.xml集成到web.xml中 xml的编码问题:若xml中出现编码问题,则加上以下代码: <constant name="st
阅读全文
posted @ 2017-03-02 14:26
小学森也要学编程
struts2学习笔记(2)action多个方法的动态调用
摘要:①在struts.xml中的action添加method <action name="addhelloworld" method="add" class="com.lzhc.action.HelloWorldAction"> <result>/add.jsp</result> </action> 在
阅读全文
struts2学习笔记(1)配置与基本操作
摘要:主要作用:将请求与页面区分开 配 置: 下载struts 2.0,在安装路径D:\项目学习\三大框架视屏\struts-2.3.24-all\struts-2.3.24\apps 中解压struts2-blank.war 将目录D:\项目学习\三大框架视屏\struts-2.3.24-all\str
阅读全文
浙公网安备 33010602011771号