![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Struts2
futureofstar
这个作者很懒,什么都没留下…
展开
-
Struts2搭建
一、环境搭建 1.新建webProject 2.设置tomcat。window/preferences/myeclipse/servers/tomcat下选择tomcat并Enable 3.设置JDK。window/preferences/java/Installed JREs/add下增加JDK。JDK包含调试,JRE不包含调试。二、搭建框架 1.解压Struts...原创 2013-11-13 21:19:44 · 70 阅读 · 0 评论 -
struts2__多语言
struts2的I18N的级别分为Action -package -application级Action级 1.与Action同级新建LoginAction_en_US.properties和LoginAction_zh_CN.properties文件,前面Action名字一定与Action一致 2.jsp中访问:,调用Actoin中的继承的getText();方法pack...原创 2013-12-02 22:51:41 · 84 阅读 · 0 评论 -
多语言测试
1.测试类[code="java"]import java.util.Locale;import java.util.ResourceBundle;public class Test { public static void main(String[] args) { ResourceBundle rb = ResourceBundle.getBundle("app",L...原创 2013-12-02 21:01:27 · 398 阅读 · 0 评论 -
struts访问web元素
一:获取Map类型的request,session,application 继承ActionSupport Map request=(Map)ActionContext.getContext().get("request"); Map session=ActionContext.getContext().getSession(); Map Applicatio...原创 2013-11-26 22:04:11 · 56 阅读 · 0 评论 -
struts接收参数的三种方式
一:属性方法 1.在action中增加属性及get()和set()方法,只接使用属性路径方问时加参数:http://127.0.0.1:8080/Struts2_0100_Introduction/extends_add?username=100二:域模型(domain方式) 1.在action中增加模型对象,及get()和set()方法。 2.在模型对象...原创 2013-11-26 21:18:35 · 113 阅读 · 0 评论 -
sttuts2.配置请求路径二种方式
一:只有类配置[quote] /Hello.jsp [/quote](1)默认执行类中的execute方法:http://localhost:8080/项目名/extends(2)可以动态访问:http://localhost:8080/项目名/extends!add,但是struts默认不启用这种方式,配置如下:[quote] ...原创 2013-11-26 20:41:47 · 167 阅读 · 0 评论 -
Action在Struts中三种实现
一种写execute方法,返回值必为String类型[code="java"]public class noextendsAction { public String execute(){ System.out.println("000000000000000000"); return "path"; }}[/code]调用如下:[q...原创 2013-11-25 22:16:32 · 74 阅读 · 0 评论 -
Struts.xml提示
1.打开struts.xml文件。复制文档类型定义 2.打开preference/xml catalog 3.解压struts.jar核心包,导入原创 2013-11-21 21:01:36 · 63 阅读 · 0 评论 -
复制和导入项目
1.复制和导入项目 复制一个项目,修改properties/MyEclipse/Web/Context Root/Web Context-Root为当前项目名 2.导入项目File/import/exsting projects into workspace选中项目根目录 注意:应选中Copy projects into workspace 3.查看源码在ja...原创 2013-11-19 21:42:58 · 166 阅读 · 0 评论 -
struts_interceptor
1.类[code="java"]public class MyInterceptor implements Interceptor { public void destroy() { } public void init() { } public String intercept(ActionInvocation invocation) throws Exc...原创 2013-12-04 22:32:58 · 59 阅读 · 0 评论