Struts2 用Action的属性接受参数
来源:互联网 发布:ps淘宝店铺标志怎么做 编辑:程序博客网 时间:2024/05/01 01:12
index.jsp
<% String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><base href="<%=basePath %>"/><body>使用action属性接收参数<a href="user/user!add?name=a&age=8">添加用户</a></body>
user_add_success.jsp
<body>User Add Success!</body>
struts.xml
<struts> <constant name="struts.devMode" value="true" /> <package name="user" extends="struts-default" namespace="/user"> <action name="user" class="com.bjsxt.struts2.user.action.UserAction"> <result>/user_add_success.jsp</result> </action> </package></struts>
UserAction.java
public class UserAction extends ActionSupport {private String name;private int age;public String add() {System.out.println("name=" + name);System.out.println("age=" + age);return SUCCESS;}public String getName() {return name;}public void setName(String name) {this.name = name;}public int getAge() {return age;}public void setAge(int age) {this.age = age;}}
阅读全文
1 0
- Struts2 用Action的属性接受参数
- struts2学习笔记----用action的属性接受参数
- 用action属性接受参数
- struts2 Action属性接受属性
- Struts2-Action接受参数方式、method属性使用及通配符的配置
- Struts2中action接受参数的方法,属性:DomainModel、ModelDriver和ActionSupport
- struts2 Action属性接受属性(二)
- Struts2的Action接受参数的方法介绍
- struts2.1用action的属性接收参数
- 3.struts2 用action的属性接收参数
- Struts2中Action的属性接收参数
- Struts2中Action的属性接收参数
- struts2——action接受参数!!!
- Struts2中action接受参数方法
- struts2用action属性接收参数
- Struts2 用action属性接收参数
- Struts2:action与action间的属性/参数传递
- struts2的action接受参数:可以决定用不用写getter/setter方法(未经过测试)
- javaObject类
- Java数据类型转换2017
- 须知的css知识——margin不重叠的情形
- Java GUI学生成绩管理系统3种权限登录界面
- 官网:layout_weight="1",layout_width="0dp"可提高性能
- Struts2 用Action的属性接受参数
- JSP开发报错:Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/
- ubuntu 无法获得锁 /var/lib/dpkg/lock
- 当前路径是否存在
- Spring mvc 绑定list参数
- 运行一个最简单的 electron 项目
- Kotlin 学习笔记(一) 基本类型和基本语法
- 内部功能
- Myeclipse连接mysql数据库并测试使用-简例