哪里出现了问题吗,type==null,拿不到传输得值,已经request.getAttribute("type")了
这个是我后台代码:
public void queryBussinessSourceNameResult(HttpServletRequest request, HttpServletResponse response)throws Exception {
GgCodeDto ggCodeDto = ggCodeDto(request);
ParamUtils paramUtils = new ParamUtils(request);
String bussinessSource = paramUtils.getParameter("bussinessSource").trim();
String bussinessSourceName = paramUtils.getParameter("bussinessSourceName").trim();
HttpSession session = request.getSession();
GgUserDto ggUserDto = (GgUserDto)session.getAttribute("user");
String language = ggUserDto.getCurrentLanguage();
int pageNo = paramUtils.getIntParameter("pageNo", 1);
int rowsPerPage = paramUtils.getIntParameter("rowsPerPage", AppConstants.ROWS_PERPAGE);
Pagination pagination = new Pagination(pageNo, rowsPerPage);
ggCodeDto.setCodeType("BusinessCode");
ggCodeDto.setObject_OrderBy("displayNo");
ggCodeDto.setCodeCode(bussinessSource);
ggCodeDto.setCodeCName(bussinessSourceName);
QueryCondition queryCondition = new QueryCondition(ggCodeDto,pagination);
queryCondition.setConditionDto(ggCodeDto);
queryCondition.setPagination(pagination);
session.setAttribute("queryCondition", queryCondition);
List result = ServiceManager.platform.getGgCodeService().find(ggCodeDto, pagination);
PageRecord pageRecord = new PageRecord(pagination.getTotalCount(),pagination.getPageNo(), 1, pagination.getRowsPerPage(),result);
request.setAttribute("fm", new AbstractForm(pageRecord));
request.setAttribute("resultList", result);
}
这是我前台代码:
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/app.tld" prefix="app"%>
<html>
<head>
<link href="/common/css/Standard.css" rel="stylesheet" type="text/css">
<%
**String type = (String)request.getAttribute("type");
%>
<script language="javascript">
//点查询
function queryMethod(){
fm.action="/sales/corporateQuery.do?actionType=bussinessSourceNameResult";
fm.target="QueryResultFrame";
fm.submit();
}
//点选择
function selectBussinessSource(){
var count = QueryResultFrame.getElementCount('checkboxSelect');
var clientIndex = 0;
if(count == "") {
alert("<bean:message key='message.sales.noRecord' />");
return false;
}
else if(count==1){
if(!QueryResultFrame.fm.checkboxSelect.checked==true) {
alert("<bean:message key='message.sales.selectOne'/>");
return false;
}
}
else {
var n = 0;
for(var i=0;i<QueryResultFrame.fm.checkboxSelect.length;i++){
if(QueryResultFrame.fm.checkboxSelect[i].checked == true){
n = n+1;
clientIndex = i;
break;
}
}
if(n == 0) {
alert("<bean:message key='message.sales.selectOne'/>");
return false;
}
}
var bussinessSourceArray = new Array();
bussinessSourceArray['codeCode']=QueryResultFrame.document.getElementsByName("codeCode")[clientIndex].value;
bussinessSourceArray['codeCName']=QueryResultFrame.document.getElementsByName("codeCName")[clientIndex].value;
if(evaluateMainFrameAgreement(bussinessSourceArray, window.parent.opener.fm)){
}else{
window.parent.close();
}
}
function evaluateMainFrameAgreement(bussinessSourceArray,mainFrameForm){
if(bussinessSourceArray != null) {
var type=document.getElementsByName("type")[0].value;
alert(type);
if(type==1){
mainFrameForm.gsClientCorporateDtoBussinessSource.value = bussinessSourceArray['codeCode'];
mainFrameForm.gsClientCorporateDtoBussinessSource.onchange();
}
}
}
</script>
</head>
<base target="_self">
<body onload="initBody();">
<html:form action="/reins/processCodeReins.do?actionType=queryInsuranceBranchCode" target="QueryResultFrame">
<input type="text" name="type" value="<%=request.getAttribute("type")%>">
<table id="BeforeOverViewMain" class="common" cellpadding="2" cellspacing="1">
<tr><td class="formtitle" colspan="4"><bean:message key="prompt.queryBussinessSource"/></td></tr>
<tr>
<td class="left"><bean:message key="GsClientCorporateDto.bussinessSource"/></td>
<td class="right">
<input name="bussinessSource" class="common" type="text" maxlength="18">
</td>
<td class="left"><bean:message key="GsClientCorporateDto.bussinessSourceName"/></td>
<td class="right">
<input name="bussinessSourceName" class="common" type="text">
</td>
</tr>
</table>
<table id="buttontable" class="button" cellpadding="5" cellspacing="1">
<tr align="center">
<td align="center">
<input type="button" class="button" value="<bean:message key="</span><span class="hljs-attr">button.find" />" onClick="queryMethod()" >
</td>
<TD align="center">
<input type="button" class="button" value="<bean:message key="</span><span class="hljs-attr">GuItemKindLoadingDto.selectedInd" />" onClick="selectBussinessSource();" />
</TD>
</tr>
</table>
<table class="button" cellpadding="5" cellspacing="1">
<tr>
<td ><iframe name="QueryResultFrame" src='about:blank' style='Z-INDEX:1;WIDTH:100%;HEIGHT:410'
marginwidth='0' marginheight='0' hspace='0' vspace='0' frameborder='0' scrolling='no'> </iframe></td>
</tr>
</table>
<jsp:include page="/common/StaticJavascript.jsp" />
</html:form>
</body>
</html>