67,538
社区成员
发帖
与我相关
我的任务
分享<action name="clubType" class="cn.chzu.csci.action.ClubTypeActon" method="update">
<result type="redirect">/background/sys_admin/dictionaryManage/clubType_list.jsp</result>
<result name="input" type="redirect">/background/sys_admin/sysUserManage/sysUser_update.jsp</result>
</action>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%@page import="cn.chzu.csci.domain.dictionary.ClubType"%>
<%@page import="cn.chzu.csci.service.ClubType_Service"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
ClubType_Service service = new ClubType_Service();
ClubType clubType = service.getById(Integer.parseInt(request.getParameter("id")));
%>
<html>
<head>
<base href="<%=basePath%>" />
<title>更新用户信息</title>
<script type="text/javascript">
function check(){
name = document.getElementById("name").value;
statusItemCode=document.getElementsByName("statusItemCode").value;
if(name.replace(/(^\s*|\s*$)/gi,'') === ''){
alert("姓名不能为空!");
return false;
}
alert("取到值啦"+name);
return confirm("确定修改?")
}
</script>
<style>
.title {
font-size: 16px;
font-family: "楷体";
color: #000000;
font-weight: bold;
}
</style>
</head>
<body>
<s:bean name="cn.chzu.csci.service.IsUse_Service" var="sexType_db"></s:bean>
<s:set var="list" value="%{#sexType_db.list()}"></s:set>
<s:bean name="cn.chzu.csci.service.ClubType_Service" var="db"></s:bean>
<s:set var="clubType" value="%{#db.getById(#parameters.id)}"></s:set>
<s:if test="{#session.msg}" >
<s:property value="%{#session.msg}"/>
<%session.removeAttribute("msg"); %>
</s:if>
<!--update/clubType-->
<form action="<%=basePath%>update/test!update.action" method="post">
<input type="hidden" id="clubType_id" name="clubType.id" value="<%=clubType.getId()%>" />
<table width="100%" border="1" height="400" bordercolor="#bae87c">
<tr>
<td height="49" colspan="5">
<strong>社团类型修改</strong>
</td>
</tr>
<tr>
<td width="5%" height="400s">
</td>
<td colspan="3">
<table width="100%" border="1" bordercolor="#bae87c" height="400">
<tr>
<td width="25%" class="title">
<font color="#FF0000">*</font>社团类型
</td>
<td width="25%">
<input type="text" class="title" id="username"
name="clubType.itemValue" value="<%=clubType.getItemValue()%>" />
</td>
<td width="25%" class="title">
描 述
</td>
<td width="25%">
<input type="text" class="title" id="password"
name="clubType.description" maxlength="40"
value="<%=clubType.getDescription()%>" />
</td>
</tr>
<tr>
<td class="title">
<font color="#FF0000">*</font>状 态
</td>
<td>
<s:select id="name" name="isUseCode" theme="simple" list="list" cssClass="title"
listKey="itemCode" cssStyle="width:168px" value="%{#clubType.getIsUse().getItemCode()}"
listValue="itemValue" onchange="check()">
</s:select> </td>
<td class="title">
注册时间
</td>
<td>
<input type="text" class="title" id="entranceTime"
name="clubType.createTime"
value="<%=clubType.getCreateTime()%>" />
</td>
</tr>
<tr>
<td colspan="4">
<div align="center">
<input type="submit" class="title" value="修改" onClick="return check()"/>
<input type="button" class="title" value="取消"
onclick="location.href='<%=basePath%>background/sys_admin/dictionaryManage/clubType_list.jsp'"></input>
</div>
</td>
</tr>
</table>
</td>
<td width="8%">
</td>
</tr>
<tr>
<td height="37" colspan="5">
</tr>
</table>
<!-- 修改信息页面 -->
</form>
</body>
<s:debug></s:debug>
</html>package cn.chzu.csci.action;
import cn.chzu.csci.domain.dictionary.ClubType;
import cn.chzu.csci.domain.dictionary.IsUse;
import cn.chzu.csci.service.ClubType_Service;
import cn.chzu.csci.service.IsUse_Service;
import com.opensymphony.xwork2.ActionSupport;
public class TestAction extends ActionSupport{
private int isUseCode;
private ClubType clubType;
private ClubType_Service clubTypeService = new ClubType_Service();
private IsUse_Service isUseService = new IsUse_Service();
public int getIsUseCode() {
return isUseCode;
}
public void setIsUseCode(int isUseCode) {
this.isUseCode = isUseCode;
}
public ClubType getClubType() {
return clubType;
}
public void setClubType(ClubType clubType) {
this.clubType = clubType;
this.clubType.setIsUse(isUseService.getById(getIsUseCode()));
}
public ClubType_Service getClubTypeService() {
return clubTypeService;
}
public void setClubTypeService(ClubType_Service clubTypeService) {
this.clubTypeService = clubTypeService;
}
public IsUse_Service getIsUseService() {
return isUseService;
}
public void setIsUseService(IsUse_Service isUseService) {
this.isUseService = isUseService;
}
public String add(){
clubTypeService.add(clubType);
return SUCCESS;
}
public String update(){
clubTypeService.update(clubType);
return SUCCESS;
}
}