조건부로 JSP 페이지를 새로 고쳐야하고 답변이 Refresh JSP Page에있는 것으로 생각했습니다. 내 작업 페이지에 response.setIntHeader("Refresh",10);
을 사용해 보았는데 작동하지 않아 아래 그림과 같이 Jsp
페이지에서 직접 사용해 보았지만 여전히 작동하지 않았습니다. 이것은 Struts1
프로젝트입니다. response.setIntHeader()가 jsp 페이지를 새로 고치지 않습니다
<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested"%>
<html:form action="/permit/permittedFeatureList" >
<html:xhtml/>
<-- lots of code goes here -->
<% response.setIntHeader("Refresh",10); %>
</html:form>
은 내가
response.setIntHeader("Refresh",10);
<META HTTP-EQUIV="Refresh" CONTENT="10">
와 페이지 새로 고침을 교체 할 때. 액션 페이지에서 Java 코드를 사용하는 것을 선호합니다. 왜 작동하지 않는지에 대해 누구나 생각할 수 있습니까? 감사!
편집 : rupinderjeet47
여기 내 코드를 모두 표시하도록 요청했습니다.
<%@ page import="gov.mo.dnr.cwis.controller.system.permits.permittedFeature.PermittedFeatureListAction" %>
<%@ page import="java.util.Map" %>
<%@ page import="gov.mo.dnr.cwis.vo.ref.permit.PermitTypeInfo" %>
<%@ page import="gov.mo.dnr.utilities.CodeTableConstants.PermitType" %>
<%@ page import="gov.mo.dnr.utilities.CodeTableConstants.PermitStatus" %>
<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="/tags/DNRTags" prefix="DNRTags"%>
<%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested"%>
<%@page import="gov.mo.dnr.utilities.CodeTableConstants.PermitType"%><script language="Javascript" type="text/javascript">
function loadMgpPf()
{
document.permittedFeatureListForm.uglyJavaScriptHack.value="true";
document.permittedFeatureListForm.submit();
}
</script>
<DNRTags:checkLogon />
<html:form action="/permit/permittedFeatureList" >
<html:xhtml/>
<%
Object permitInstanceIdpf = request.getParameter("permitInstanceId");
if (permitInstanceIdpf == null) {
permitInstanceIdpf = request.getAttribute("permitInstanceId");
} if (permitInstanceIdpf == null) {
Map navMap = (Map) request.getSession().getAttribute("permitNavMap");
permitInstanceIdpf = Integer.parseInt(navMap.get("permitInstanceId").toString());
}
boolean permitStatus = false;
request.setAttribute("pfHeader",PermittedFeatureListAction.getPermittedFeatureHeader(permitInstanceIdpf));
java.util.Map<String,String> pstatus = (java.util.Map<String,String>)request.getAttribute("pfHeader");
if (pstatus.get("permitStatus").equals(PermitStatus.DRAFT.status()))
{permitStatus = true;}
boolean gpcfFlag = false;
PermitTypeInfo ptInfo = (PermitTypeInfo)(session.getAttribute("permitTypeInfo"));
PermitType pt = PermitType.getPermitTypeById(ptInfo.getPermitTypeId());
if (pt== PermitType.GPCF || pt== PermitType.GPCF_CONST){
gpcfFlag= true;
}
%>
<h2>
<%if(gpcfFlag == true){ %>
GPCF
<% }%>
Permitted Features List
</h2>
<h3 align="center">
<bean:write scope="request" name="pfHeader" property="permitStatus" />
<logic:equal scope="request" name="pfHeader" property="permitStatus" value="Draft" >
- <bean:write scope="request" name="pfHeader" property="permitAction" />
</logic:equal>
<br />
Permit ID: <bean:write scope="request" name="pfHeader" property="permitNo" /><br />
</h3>
<%@ include file="/WEB-INF/pages/system/permits/facility/underEnforcement.jspf"%>
<%@ include file="/WEB-INF/pages/system/permits/messages.jspf" %>
<div id="permitReadOnly">
<table width="100%">
<tr valign="top">
<td width="25%">
<fieldset>
Facility ID: <bean:write scope="request" name="pfHeader" property="facilityId" /><br />
Facility: <bean:write scope="request" name="pfHeader" property="facilityName" /><br />
Owner Name: <bean:write scope="request" name="pfHeader" property="facilityOwner" /><br />
County: <bean:write scope="request" name="pfHeader" property="countyName" /><br />
Region: <bean:write scope="request" name="pfHeader" property="region" /><br />
</fieldset>
</td>
<td width="25%">
<fieldset>
Permit Type: <bean:write scope="request" name="pfHeader" property="permitType" /><br />
Non-NPDES Type: <bean:write scope="request" name="pfHeader" property="subType" /><br />
Construction Type: <bean:write scope="request" name="pfHeader" property="conType" /><br />
Initial Date: <bean:write scope="request" name="pfHeader" property="initialDate" /><br />
</fieldset>
</td>
<td width="25%">
<fieldset>
Issue Date: <bean:write scope="request" name="pfHeader" property="issueDate" /><br />
Effective Date: <bean:write scope="request" name="pfHeader" property="effDate" /><br />
Expiration Date: <bean:write scope="request" name="pfHeader" property="expDate" /><br />
Termination Date: <bean:write scope="request" name="pfHeader" property="termDate" /><br />
</fieldset>
</td>
<td width="25%">
<fieldset>
<%if(gpcfFlag == true){ %>
GPCF Version Number: <bean:write scope="request" name="pfHeader" property="gpcfVersion" /><br />
MGP Version Number: <bean:write scope="request" name="pfHeader" property="mgpVersion" /><br />
MGP Permit Name: <bean:write scope="request" name="pfHeader" property="mgpName" /><br />
<%} %>
</fieldset>
</td>
</tr>
</table>
</div>
<%-- Add gpcf permitted feature --%>
<DNRTags:AccessRoles roleList="System Administrator, Permit 1, Permit 2, Permit 3">
<%if(gpcfFlag == true){ %>
<div align="right">
<table width="100%" cellspacing="0" class="dataEntryBorder">
<tr>
<td colspan="7" class="rowsecthead">GPCF Permitted Feature</td>
</tr>
<tr>
<td width="97" align="right"> </td>
<td width="152" align="right"><span class="required">*</span><label for="permittedFeatureNo">No:</label></td>
<td width="229" align="left">
<html:text property="permittedFeatureNo" styleId="permittedFeatureNo" size="3" maxlength="3" />
</td>
<td width="26" class="columnseperator"></td>
<td align="right"><span class="required">*</span><label for="activeDate">Active Date or Date Limit Sets Can Be Added:</label></td>
<td colspan="2" align="left" width="229">
<html:text property="activeDate" styleId="activeDate" size="10" maxlength="10" onblur="checkdate(activeDate);"/>
</td>
</tr>
<tr>
<td align="right"> </td>
<td align="right">
<label for="mgpPermittedFeatureId">
<span class="required">*</span>MGP Permitted Features
</label>
</td>
<td align="left">
<% request.setAttribute("mgpPfCodes",PermittedFeatureListAction.getMgpPfCodes(permitInstanceIdpf)); %>
<span class="borderbottom">
<html:hidden property="uglyJavaScriptHack" />
<html:select property="mgpPermittedFeatureId" styleId="mgpPermittedFeatureId" onchange=" loadMgpPf(); ">
<html:option value=""></html:option>
<html:options collection="mgpPfCodes" property="value" labelProperty="label" />
</html:select>
</span>
</td>
<td class="columnseperator"></td>
<td align="right">Type Description:<br /></td>
<td colspan="2" align="left">
<bean:write name="permittedFeatureListForm" property="typeDescription" />
</td>
</tr>
<tr>
<td align="right"> </td>
<td align="right"> </td>
<td> </td>
<td class="columnseperator"></td>
<td align="right">Waste Type:</td>
<td colspan="2" align="left">
<bean:write name="permittedFeatureListForm" property="wasteType" />
</td>
</tr>
<tr>
<td align="right"> </td>
<td align="right" valign="top"><label for="comments">Comments: </label></td>
<td align="left"><html:textarea property="comments" styleId="comments" cols="30" rows="3" /></td>
<td class="columnseperator"></td>
<td align="right" valign="top">Comments:</td>
<td colspan="2" valign="top" align="left">
<bean:write name="permittedFeatureListForm" property="mgpPfComments" />
</td>
</tr>
<logic:notEqual scope="request" name="pfHeader" property="permitStatus" value="Terminated" >
<logic:notEqual scope="request" name="pfHeader" property="permitStatus" value="Retired" >
<tr>
<td colspan="7" align="center">
<html:submit property="action" styleClass="button" value="Add" alt="Add"
onmouseover="this.className='button buttonhov'"
onmouseout="this.className='button'" />
<html:submit property="action" styleClass="button" value="Clear" alt="Clear"
onmouseover="this.className='button buttonhov'"
onmouseout="this.className='button'" />
</td>
</tr>
</logic:notEqual>
</logic:notEqual>
</table>
</div>
<%} %>
</DNRTags:AccessRoles>
<div align="right">
<logic:notPresent scope="request" name="dnr.mo.gov.permits.permittedFeatureList">
<%
try {
PermittedFeatureListAction.reload(request);
} catch (Exception e) {
}
%>
</logic:notPresent>
<logic:present scope="request" name="dnr.mo.gov.permits.permittedFeatureList">
<%if(gpcfFlag == false){ %>
<table width="100%" class="searchresults bordersingle" >
<caption>Click on a Permitted Feature ID link below to view, edit, or delete the Permitted Feature.</caption>
<thead>
<tr>
<th width="10%"><center>No.</center></th>
<th width="15%" align="center">Primary Indicator</th>
<th width="17%" align="center">Type</th>
<th width="10%" align="center">Active</th>
<th width="10%" align="center">Complete</th>
<th width="18%" align="center">Mapped</th>
<th width="20%" align="center">Trace Status</th>
</tr>
</thead>
<tbody>
<% int count = 0; %>
<logic:iterate id="row" scope="request" name="dnr.mo.gov.permits.permittedFeatureList" property="permittedFeatureList" >
<% if(count % 2 == 0) { %>
<tr class="rowaltcolor">
<% } else { %>
<tr bgcolor="white">
<% } %>
<td align="center">
<html:link action="/permit/permittedFeatureBasic" paramId="permittedFeatureId"
paramName="row" paramProperty="permittedFeatureId">
<bean:write name="row" property="permittedFeatureNum" />
</html:link>
</td>
<td align="center">
<label for="Permitted Feature ${row.selectedPrimaryId}" class="hidden">Primary Indicator</label>
<html:radio idName="row" value="permittedFeatureId" property="selectedPrimaryId" styleId="Permitted Feature ${row.selectedPrimaryId}"/>
</td>
<td align="left">
<bean:write name="row" property="permittedFeatureTypeDesc" />
</td>
<td align="center">
<bean:write name="row" property="isActive" />
</td>
<td align="center">
<bean:write name="row" property="isComplete" />
</td>
<td align="center">
<bean:write name="row" property="isMapped" />
</td>
<td align="center">
<bean:write name="row" property="permittedFeatureTraceStatus" />
</td>
</tr>
<% count++; %>
</logic:iterate>
</tbody>
</table>
<%} %>
<%if(gpcfFlag == true){ %>
<table width="100%" class="searchresults bordersingle" >
<caption>Click on a Permitted Feature ID link below to view, edit, or delete the Permitted Feature.</caption>
<thead>
<tr>
<th width="10%" align="center">GPCF PF No.</th>
<th width="15%" align="center">MGP PF No.</th>
<th width="17%" align="center">Primary Indicator</th>
<th width="15%" align="center">Type</th>
<th width="10%" align="center">Active</th>
<th width="10%" align="center">Complete</th>
<th width="17%" align="center">Mapped</th>
<th width="20%" align="center">Trace Status</th>
</tr>
</thead>
<tbody>
<% int gcount = 0; %>
<logic:iterate id="row" scope="request" name="dnr.mo.gov.permits.permittedFeatureList" property="permittedFeatureList" >
<% if(gcount % 2 == 0) { %>
<tr class="rowaltcolor">
<% } else { %>
<tr bgcolor="white">
<% } %>
<td align="center">
<html:link action="/permit/permittedFeatureBasic" paramId="permittedFeatureId"
paramName="row" paramProperty="permittedFeatureId">
<bean:write name="row" property="permittedFeatureNum" />
</html:link>
</td>
<td align="center">
<bean:write name="row" property="mgpPermittedFeatureNum" />
</td>
<td align="center">
<logic:equal name="row" property="isActive" value="Yes">
<label for="Permitted Feature ${row.selectedPrimaryId}" class="hidden">Primary Indicator</label>
<html:radio idName="row" value="permittedFeatureId" property="selectedPrimaryId" styleId="Permitted Feature ${row.selectedPrimaryId}"/>
</logic:equal>
<logic:notEqual name="row" property="isActive" value="Yes">
<label for="Permitted Feature ${row.selectedPrimaryId}" class="hidden">Primary Indicator</label>
<html:radio idName="row" value="permittedFeatureId" property="selectedPrimaryId" styleId="Permitted Feature ${row.selectedPrimaryId}" disabled="true" />
</logic:notEqual>
</td>
<td align="left">
<bean:write name="row" property="permittedFeatureTypeDesc" />
</td>
<td align="center">
<bean:write name="row" property="isActive" />
</td>
<td align="center">
<bean:write name="row" property="isComplete" />
</td>
<td align="center">
<bean:write name="row" property="isMapped" />
</td>
<td align="center">
<bean:write name="row" property="permittedFeatureTraceStatus" />
</td>
</tr>
<% gcount++; %>
</logic:iterate>
</tbody>
</table>
<%} %>
<logic:notEqual scope="request" name="pfHeader" property="permitStatus" value="Terminated" >
<logic:notEqual scope="request" name="pfHeader" property="permitStatus" value="Retired" >
<DNRTags:AccessRoles roleList="System Administrator, Permit 1, Permit 2">
<html:submit value="Save Changes" alt="Save Changes"
property="action" styleClass="button"
onmouseover="this.className='button buttonhov'"
onmouseout="this.className='button'" />
</DNRTags:AccessRoles>
</logic:notEqual>
</logic:notEqual>
<logic:equal scope="request" name="pfHeader" property="permitStatus" value="Draft" >
<DNRTags:AccessRoles roleList="Permit 3">
<html:submit value="Save Changes" alt="Save Changes"
property="action" styleClass="button"
onmouseover="this.className='button buttonhov'"
onmouseout="this.className='button'" />
</DNRTags:AccessRoles>
</logic:equal>
</logic:present>
<logic:notEqual scope="request" name="pfHeader" property="permitStatus" value="Terminated" >
<logic:notEqual scope="request" name="pfHeader" property="permitStatus" value="Retired" >
<DNRTags:AccessRoles roleList="System Administrator, Permit 1, Permit 2">
<%if(gpcfFlag == false){ %>
<logic:equal scope="request" name="pfHeader" property="isCafo" value="Y" >
<html:submit value="Add CAFO Permitted Feature" alt="Add CAFO Permitted Feature"
property="action" styleClass="button"
onmouseover="this.className='button buttonhov'"
onmouseout="this.className='button'" />
</logic:equal>
<html:submit value="Add Permitted Feature" alt="Add Permitted Feature"
property="action" styleClass="button"
onmouseover="this.className='button buttonhov'"
onmouseout="this.className='button'" />
<% }%>
</DNRTags:AccessRoles>
</logic:notEqual>
</logic:notEqual>
<logic:equal scope="request" name="pfHeader" property="permitStatus" value="Draft" >
<DNRTags:AccessRoles roleList="Permit 3">
<%if(gpcfFlag == false){ %>
<logic:equal scope="request" name="pfHeader" property="isCafo" value="Y" >
<html:submit value="Add CAFO Permitted Feature" alt="Add CAFO Permitted Feature"
property="action" styleClass="button"
onmouseover="this.className='button buttonhov'"
onmouseout="this.className='button'" />
</logic:equal>
<html:submit value="Add Permitted Feature" alt="Add Permitted Feature"
property="action" styleClass="button"
onmouseover="this.className='button buttonhov'"
onmouseout="this.className='button'" />
<% }%>
</DNRTags:AccessRoles>
</logic:equal>
</div>
<logic:equal scope="request" name="dnr.mo.gov.permits.permittedFeatureList" property="refreshJspPage" value="true" >
<META HTTP-EQUIV="Refresh" CONTENT="30">
</logic:equal>
</html:form>
이것은 비표준 메커니즘입니다. 뭔가 표준을 사용하십시오. – EJP
당신은'<% response.setIntHeader ("Refresh", 10); %>'는 비표준입니까? 표준 메커니즘은 무엇입니까? – ponder275