struts第五天----给action方法中注入值
来源:互联网 发布:肉炖久了吃好吗 知乎 编辑:程序博客网 时间:2024/06/08 03:25
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<constant name="struts.action.extension" value="do"/>
<include file="department.xml"/>
<include file="employee.xml"/>
</struts>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.1//EN" "http://struts.apache.org/dtds/struts-2.1.dtd">
<struts>
<package name="department" namespace="/control/department" extends="struts-default">
<action name="list_*" class="com.isoftstone.study.HelloWorldAction" method="{1}">
<param name="savepath">department</param>
<result name="success">/WEB-INF/page/message.jsp</result>
</action>
</package>
</struts>
package com.isoftstone.study;
import com.isoftstone.domain.Person;
public class HelloWorldAction {
private String msg;
private int id;
private String name;
private Person person;
public Person getPerson() {
return person;
}
public void setPerson(Person person) {
this.person = person;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public String addUI(){
msg="addUI";
return "success";
}
public String execute() throws Exception{
msg="success";
return "success";
}
}
package com.isoftstone.domain;
public class Person {
private int id;
private String name;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
package com.isoftstone.domain;
public class Person {
private int id;
private String name;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
</head>
<body>
<%=new Date() %>中国
<form action="<%=request.getContextPath() %>/control/employee/list_execute.do"} method="post">
id:<input name="person.id" type="text"/><br/>
name:<input name="person.name" type="text"/><br/>
<input value="发送" type="submit"/>
</form>
</body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'message.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
</head>
<body>
id=${person.id}<br/>
id=${person.name }
</body>
</html>
- struts第五天----给action方法中注入值
- Struts第五天
- struts.xml 获取action中 get方法 参数值
- struts中action的创建和属性注入
- struts中action的修改方法
- 中软!第五天
- 在Struts action中利用.do跳转到另一action传值方法
- struts--为Action的属性注入值、处理流程
- Struts中的Action方法
- STRUTS Action 方法校验
- 关于struts2 中action 属性没有 set 方法 依然会注入值的问题(解决)
- 关于struts2 中action 属性没有 set 方法 依然会注入值的问题(解决)
- Struts中配置Action
- struts 中 action 属性
- struts中Action相关
- struts中配置action
- 关于struts Action类中重载excute方法应注意
- Struts中action的方法不能纳入spring事务管理
- xcode学习:storyborad
- 黑马程序员--Struts2框架技术
- Linux串口编程-4-odd校验
- win7 x64环境下载、安装、配置jdk-7u7
- Android调试器DDMS使用方法(Dalvik Debug Monitor Service)
- struts第五天----给action方法中注入值
- ngx_pagespeed 是一个 Nginx 的扩展模块,可以加速你的网站
- Linux串口编程-5-space校验
- 编译zeromq的java绑定:jzmq
- VC++ MFC怎么实现“多线程”
- 一个java包中有两个含Main的类的运行方法
- MFC 实现两个子线程交叉运行
- 报表点列头排序
- 工作流jbpm的.jpdl.xml文件中文乱码