日期:2014-05-17 浏览次数:20916 次
function postSend(url, params) {
var _post = document.createElement("form");
_post.action = url;
_post.method = "POST";
_post.style.display = "none";
document.body.appendChild(_post);
_post.submit();
return _post;
}
<filter>
<description>字符集过滤器</description>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<description>字符集编码</description>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
contentType="text/html; charset=UTF-8"%>
<%
String queryRole = "查询角色" ;
String deleteRole = "删除角色" ;
String alterRole = "修改角色" ;
String createRole = "新建角色" ;
%>
.......略去次要的 ......
----------------------JS ----------
function createRole(){
alert("<%=createRole%>");
postSend("<%=basePath%>havePowerCreateRole.do?funOptType="+"<%=createRole%>");
}
@RequestMapping("havePowerCreateRole")
public Object havePowerCreateRole(String funOptType ,HttpServletRequest req){
ModelAndView mv = new ModelAndView();
HttpSession session = req.getSession();
List<String> funOptTypeList = (List<String>) session.getAttribute("funOptTypeList");
for( int i=0 ; i<funOptTypeList.size() ; i++ ){
if( funOptTypeList.get(i).equalsIgnoreCase(funOptType) ){
mv.setViewName("jsp/body/admin/createRole");
return mv;
}
}
ModelAndView error = mv ;
error .addObject("errorTip", havePowerCreateRoleErrorTip);
error.setViewName("jsp/error");
mv = null ;
return error ;
}