/*************************************************************/
/* ACTION代码 */
/*************************************************************/
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.jrosion.struts.action;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.jrosion.business.service.ISysModulePowerService;
import com.jrosion.business.service.imp.SysModulePowerService;
import com.jrosion.database.pojo.SysUsers;
/**
* MyEclipse Struts Creation date: 11-29-2007
*
* XDoclet definition:
*
* @struts.action validate="true"
*/
public class QueryPowerModuleAction extends Action {
/*
* Generated Methods
*/
/**
* Method execute
*
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
String result = "";
ISysModulePowerService sysModulePowerService = new SysModulePowerService();
String parentid = request.getParameter("parentid");
HttpSession session = request.getSession();
SysUsers sysUsers = new SysUsers();
sysUsers = (SysUsers) session.getAttribute("userInfo");
PrintWriter out = null;
try {
result = sysModulePowerService.getModules(sysUsers.getPk(),
parentid);
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);
response.setContentType("text/html;charset=utf-8");
out = response.getWriter();
out.print(result);
out.flush();
out.close();
} catch (IOException e) {
result = "";
}
return null;
}
}
/*************************************************************/
/* AJAX代码 */
/*************************************************************/
function queryPowerModules(parentid){
request = createXmlHttpRequestObject();
var url = "";
url = "../queryPowerModule.do?parentid="+parentid+"&r="+getRandom();
request.open("GET", url , false);
request.onreadystatechange = queryPowerModulesResult;
request.send(null);
}
function queryPowerModulesResult(){
if (request.readyState == 4){
if (request.status == 200){
var subModule = document.getElementById("subModule");
subModule.innerHTML = "";
var resText = request.responseText;
subModule.innerHTML = createModule(resText);
}
}
}
/* ACTION代码 */
/*************************************************************/
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.jrosion.struts.action;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.jrosion.business.service.ISysModulePowerService;
import com.jrosion.business.service.imp.SysModulePowerService;
import com.jrosion.database.pojo.SysUsers;
/**
* MyEclipse Struts Creation date: 11-29-2007
*
* XDoclet definition:
*
* @struts.action validate="true"
*/
public class QueryPowerModuleAction extends Action {
/*
* Generated Methods
*/
/**
* Method execute
*
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
String result = "";
ISysModulePowerService sysModulePowerService = new SysModulePowerService();
String parentid = request.getParameter("parentid");
HttpSession session = request.getSession();
SysUsers sysUsers = new SysUsers();
sysUsers = (SysUsers) session.getAttribute("userInfo");
PrintWriter out = null;
try {
result = sysModulePowerService.getModules(sysUsers.getPk(),
parentid);
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);
response.setContentType("text/html;charset=utf-8");
out = response.getWriter();
out.print(result);
out.flush();
out.close();
} catch (IOException e) {
result = "";
}
return null;
}
}
/*************************************************************/
/* AJAX代码 */
/*************************************************************/
function queryPowerModules(parentid){
request = createXmlHttpRequestObject();
var url = "";
url = "../queryPowerModule.do?parentid="+parentid+"&r="+getRandom();
request.open("GET", url , false);
request.onreadystatechange = queryPowerModulesResult;
request.send(null);
}
function queryPowerModulesResult(){
if (request.readyState == 4){
if (request.status == 200){
var subModule = document.getElementById("subModule");
subModule.innerHTML = "";
var resText = request.responseText;
subModule.innerHTML = createModule(resText);
}
}
}