我正在使用JSP和Servlets。虽然我使用getRequestDispatcher
方法重定向到JSP页面,但有时我在IE中遇到“网页已过期”错误,而我在JSP中使用“NEXT”提交按钮。它在所有其他浏览器中都运行良好。
getServletContext().getRequestDispatcher("/patient-history2(allergies).jsp").forward(request,response);
任何人都可以帮我解决这个问题吗?
this is my gsp page
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@page import="pojo.medication"%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>GMQ Physician Associates</title>
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="css/style2.css" />
<![endif]-->
<!--[if !IE]> -->
<link rel="stylesheet" type="text/css" href="css/style.css" />
<!-- <![endif]-->
<link rel="stylesheet" type="text/css" href="css/jquery.autocomplete.css" />
<link rel="stylesheet" type="text/css" href="css/jquery-ui-1.8.22.custom.css" />
<script type="text/javascript" language="javascript" src="js/scripts.js"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/datepicker2.js"></script>
<script type="text/javascript" src="js/basicnifo.js"></script>
<script src="js/jquery.autocomplete.pack.js"></script>
</head>
<body>
<%
medication []medications=null;
boolean blNoentries=false;;
medications=(medication[])request.getAttribute("medication");
if(medications==null){
blNoentries=true;;
medications=new medication[1];
medications[0]=new medication();
medications[0].setsDose("");
medications[0].setsFrequency("");
medications[0].setsRoute("");
medications[0].setsStrength("");
medications[0].setBtStatus((byte)0);
medications[0].setsDirections("");
medications[0].setsProductName("");
//response.sendRedirect("Home.jsp");
}
//String [] States=new String[Objects.length];
%>
<div id="main">
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="50%"><img src="images/logo.jpg" width="385" height="97" alt="logo" /></td>
<td width="50%"><img src="images/people.jpg" width="327" height="97" class="m1" /></td>
</tr>
<tr>
<td colspan="2"><div class="m2">
<a href="Home.jsp"><div id="home" style="background:url(images/topnav-bt-bg1.png) no-repeat;" class="topnav" onMouseOver="changeBgImage('images/topnav-bt-bg2.png', 'home')" onMouseOut="changeBgImage('images/topnav-bt-bg1.png', 'home')">HOME</div></a>
<a href="service.jsp"><div id="service" style="background:url(images/topnav-bt-bg1.png) no-repeat;" class="topnav" onMouseOver="changeBgImage('images/topnav-bt-bg2.png', 'service')" onMouseOut="changeBgImage('images/topnav-bt-bg1.png', 'service')">SERVICES</div></a>
<a href="provider.jsp"><div id="provider" style="background:url(images/topnav-bt-bg1.png) no-repeat;" class="topnav" onMouseOver="changeBgImage('images/topnav-bt-bg2.png', 'provider')" onMouseOut="changeBgImage('images/topnav-bt-bg1.png', 'provider')">PROVIDER</div></a>
<a href="Basic_info?action=register:"><div id="register" style="background:url(images/topnav-bt-bg1.png) no-repeat;" class="topnav" onMouseOver="changeBgImage('images/topnav-bt-bg2.png', 'register')" onMouseOut="changeBgImage('images/topnav-bt-bg1.png', 'register')">REGISTRATION</div></a>
<a href="faq.jsp"><div id="faq" style="background:url(images/topnav-bt-bg1.png) no-repeat;" class="topnav" onMouseOver="changeBgImage('images/topnav-bt-bg2.png', 'faq')" onMouseOut="changeBgImage('images/topnav-bt-bg1.png', 'faq')">FAQ</div></a>
<a href="contact.jsp"><div id="contact" style="background:url(images/topnav-bt-bg1.png) no-repeat;" class="topnav" onMouseOver="changeBgImage('images/topnav-bt-bg2.png', 'contact')" onMouseOut="changeBgImage('images/topnav-bt-bg1.png', 'contact')">CONTACT</div></a>
</td>
</tr>
</table>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="m5">
<tr>
<td valign="top" class="m3">
<div class="m3a">Quick Menu</div>
<div class="m9">
<a href="Basic_info?action=basic"><div id="basic" style="background:url(images/basic-info-bt1.png) no-repeat;" class="leftnav" onMouseOver="changeBgImage('images/basic-info-bt2.png', 'basic')" onMouseOut="changeBgImage('images/basic-info-bt1.png', 'basic')">Basic Info</div></a>
<a href="Basic_info?action=appoinments:"><div id="app" style="background:url(images/appointments-bt1.png) no-repeat;" class="leftnav" onMouseOver="changeBgImage('images/appointments-bt2.png', 'app')" onMouseOut="changeBgImage('images/appointments-bt1.png', 'app')">Appointments</div></a>
<a href="newMessage.jsp">
<div id="newmess" style="background:url(images/new-message-bt1.png) no-repeat;" class="leftnav" onMouseOver="changeBgImage('images/new-message-bt2.png', 'newmess')" onMouseOut="changeBgImage('images/new-message-bt1.png', 'newmess')">New Message</div></a>
<a href="Basic_info?action=inbox:"><div id="inbox" style="background:url(images/inbox-bt1.png) no-repeat;" class="leftnav" onMouseOver="changeBgImage('images/inbox-bt2.png', 'inbox')" onMouseOut="changeBgImage('images/inbox-bt1.png', 'inbox')">Inbox</div></a>
<a href="Basic_info?action=outbox:"><div id="outbox" style="background:url(images/outbox-bt1.png) no-repeat;" class="leftnav" onMouseOver="changeBgImage('images/outbox-bt2.png', 'outbox')" onMouseOut="changeBgImage('images/outbox-bt1.png', 'outbox')">Outbox</div></a>
<a href="Basic_info?action=health-summary:"><div id="health" style="background:url(images/health-summary-bt1.png) no-repeat;" class="leftnav" onMouseOver="changeBgImage('images/health-summary-bt2.png', 'health')" onMouseOut="changeBgImage('images/health-summary-bt1.png', 'health')">Health Summary</div></a>
<a href="Basic_info?action=clinical-summary:"><div id="clinical" style="background:url(images/clinical-summary-bt1.png) no-repeat;" class="leftnav" onMouseOver="changeBgImage('images/clinical-summary-bt2.png', 'clinical')" onMouseOut="changeBgImage('images/clinical-summary-bt1.png', 'clinical')">Clinical Summary</div></a>
<a href="Basic_info?action=employer-guarantor:"><div id="gurantor" style="background:url(images/employer-gurantor-bt1.png) no-repeat;" class="leftnav" onMouseOver="changeBgImage('images/employer-gurantor-bt2.png', 'gurantor')" onMouseOut="changeBgImage('images/employer-gurantor-bt1.png', 'gurantor')">Employer Guarantor</div></a>
<a href="Basic_info?action=insurance:"><div id="insurance" style="background:url(images/insurance-bt1.png) no-repeat;" class="leftnav" onMouseOver="changeBgImage('images/insurance-bt2.png', 'insurance')" onMouseOut="changeBgImage('images/insurance-bt1.png', 'insurance')">Insurance</div></a>
<a href="Basic_info?action=patienthistory:"><div id="history" style="background:url(images/patient-history-bt2.png) no-repeat;" class="leftnav">Patient History</div></a>
<a href="Basic_info?action=logout:"><div id="logout" style="background:url(images/logout-bt1.png) no-repeat;" class="leftnav" onMouseOver="changeBgImage('images/logout-bt2.png', 'logout')" onMouseOut="changeBgImage('images/logout-bt1.png', 'logout')">Logout</div></a>
</div>
<div class="m8"> </div>
</td>
<td valign="top" class="m4">
<div class="m4a">Patient History</div>
<div class="m6">
<form action="#" method="post" name="reg">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div class="m12">
<table width="100%" border="0" cellspacing="1" cellpadding="2" id="items">
<tr>
<td colspan="9" align="center" bgcolor="#62a3e0" style="width:15%;"><strong>Medications</strong></td>
</tr>
<tr>
<td align="center" bgcolor="#EAEAEA" style="width:15%;"><strong>Medicine</strong></td><!--
<td align="center" bgcolor="#EAEAEA" style="width:15%;"><strong>RxNorm</strong></td>
<td align="center" bgcolor="#EAEAEA" style="width:15%;"><strong>Dose</strong></td>
<td align="center" bgcolor="#EAEAEA" style="width:15%;"><strong>Frequency </strong></td>
<td align="center" bgcolor="#EAEAEA" style="width:15%;"><strong>Route</strong></td>
-->
<td align="center" bgcolor="#EAEAEA" style="width:15%;"><strong>Directions</strong></td>
<td align="center" bgcolor="#EAEAEA" style="width:15%;"><strong>Strength</strong></td>
<td width="12%" align="center" bgcolor="#EAEAEA" style="width:15%;"> <strong>Status</strong></td>
<td width="13%" align="center" bgcolor="#EAEAEA" style="width:15%;"> <strong>Start</strong></td>
<!--
<td width="25%" align="center" bgcolor="#EAEAEA" style="width:15%;"><strong>Delete</strong></td>
-->
</tr>
<tbody>
<% int i=1;
for(int j=0;j<medications.length;j++){%>
<tr>
<td bgcolor="#F5F5F5" style="width:15%;"><input type="text" name="Medicine<%=i %>" id="Medicine<%=i %>" <%if(!blNoentries) {out.println("readonly=\"readonly\"");}%> class="m11 autocompletemedication" value="<%=medications[j].getsProductName() %>" /></td>
<td bgcolor="#F5F5F5" style="width:15%;"><input type="text" name="direction<%=i %>" id="direction<%=i %>" <%if(!blNoentries) {out.println("readonly=\"readonly\"");}%> class="m11" value="<%=medications[j].getsDirections()%>" /></td>
<!--<td bgcolor="#F5F5F5" style="width:15%;"><input type="text" name="RxNorm<%=i %>" id="RxNorm<%=i %>" class="m11" /></td>
<td bgcolor="#F5F5F5" style="width:15%;"><input type="text" name="Dose<%=i %>" id="Dose<%=i %>" class="m11" value="<%=medications[j].getsDose()%>" /></td>
<td bgcolor="#F5F5F5" style="width:15%;"><input type="text" name="Frequency<%=i %>" id="Frequency<%=i %>" class="m11" value="<%=medications[j].getsFrequency() %>" /></td>
<td bgcolor="#F5F5F5" style="width:15%;"><input type="text" name="Route<%=i %>" id="Route<%=i %>" class="m11" value="<%=medications[j].getsRoute()%>" /></td>
--><td bgcolor="#F5F5F5" style="width:15%;"><input type="text" name="Strength<%=i %>" id="Strength<%=i %>" <%if(!blNoentries) {out.println("readonly=\"readonly\"");}%> class="m11" value="<%=medications[j].getsStrength() %>" /></td>
<td bgcolor="#F5F5F5" style="width:15%;"><label for="checkbox">
<select name="Status<%=i %>" id="Status<%=i %>" <%if(!blNoentries) {out.println("disabled=\"disabled\"");}%>class="drop1">
<option value="1"<%if(medications[j].getBtStatus()==1){out.println(" selected='selected'");} %>>active</option>
<option value="2"<%if(medications[j].getBtStatus()==2){out.println(" selected='selected'");} %>>in active</option>
</select>
</label></td>
<td bgcolor="#F5F5F5" style="width:15%;"><input type="text" name="Start<%=i %>" id="Start<%=i %>" <%if(!blNoentries) {out.println("readonly=\"readonly\"");}%> class="m11 <%if(blNoentries) {out.println("datepick");}%>" value="<% if(medications[j].getsStartDate()!=null){out.println(medications[j].getsStartDate().substring(0,10)); }else out.println("");%>" /></td>
<input type="hidden" name="Medications<%=i%>" id="Medications<%=i%>" class="m16" value="<%=medications[j].getiPrescriptionId()%>"/>
<!--
<td align="center" bgcolor="#F5F5F5" style="width:15%;"><input type="checkbox" name="Delete<%=i %>" id="Delete<%=i %>" value="true"/></td>
-->
</tr>
<%i++;} %>
</tbody>
<tfoot>
<tr>
<td colspan="9" align="right">
<input type="submit" name="update" id="update" value="ADD ROW" class="bt-press add_more" onmouseover="changeBgImage('images/button-bg2.png', 'update')" onmouseout="changeBgImage('images/button-bg.png', 'update')" /></td>
</tr>
<input type="hidden" name="item_count" id="item_count" value="<%=medications.length%>" />
<tr>
<td colspan="9" align="right">
<input type="submit" name="button" id="PREVIOUS" value="PREVIOUS" class="bt-press" onmouseover="changeBgImage('images/button-bg2.png', 'PREVIOUS')" onmouseout="changeBgImage('images/button-bg.png', 'PREVIOUS')" />
<input type="submit" name="button" id="save" value="SAVE" class="bt-press" onmouseover="changeBgImage('images/button-bg2.png', 'save')" onmouseout="changeBgImage('images/button-bg.png', 'save')" />
<input type="submit" name="button" id="NEXT" value="NEXT" class="bt-press" onmouseover="changeBgImage('images/button-bg2.png', 'NEXT')" onmouseout="changeBgImage('images/button-bg.png', 'NEXT')" /></td>
</tr>
</tfoot>
</table>
</div></td>
</tr>
<input type="hidden" name="page" value="patienthistory3" class="m10" />
</table>
</form>
</div>
<div class="m7"> <br />
</div>
</td>
</tr>
</table>
<div class="foot">GMQ Physician Associates, 100-C, Foley, AL 3655 TEL: (456)789-2343 FAX: (456)789-2343</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$(".datepick").datepicker({dateFormat: "mm-dd-yy"});
//$( ".datepick" ).live("click", function(event){
//alert("test")
//$(".datepick").datepicker({dateFormat: "mm-dd-yy"});
//});
$('.autocompletemedication').live('click', function(){
var id = $(this).attr('id');
// alert(id);
$(this).autocomplete("getMeditation.jsp");
});
});
</script>
<script>
$(".add_more").click(function(event){
event.preventDefault();
var count = $("#item_count").val();
count = parseInt(count);
var new_count = count +1;
// $(".delete_link").remove();
// <td align="center" bgcolor="#F5F5F5" style="width:15%;"><input type="checkbox" name="Delete'+new_count+'" id="Delete'+new_count+'" /></td> \
var html = '<tr>\
<td bgcolor="#F5F5F5" style="width:15%;"><input type="text" name="Medicine'+new_count+'" id="Medicine'+new_count+'" tabindex="1" class="m11 autocompletemedication" value="" /></td> \
<td bgcolor="#F5F5F5" style="width:15%;"><input type="text" name="direction'+new_count+'" id="direction'+new_count+'" tabindex="1" class="m11 " value="" /></td> \
<td bgcolor="#F5F5F5" style="width:15%;"><input type="text" name="Strength'+new_count+'" id="Strength'+new_count+'" tabindex="1" class="m11" value="" /></td> \
<td bgcolor="#F5F5F5" style="width:15%;"><label for="checkbox"><select name="Status'+new_count+'"id="Status'+new_count+'" class="drop1 ">\
<option value="1" selected="selected"> active</option><option value="2">inactive</option>\
</select></td>\
<td bgcolor="#F5F5F5" style="width:15%;"><input type="text" name="Start'+new_count+'" id="Start'+new_count+'" tabindex="1" class="m11 datepicker" value="" /></td> \
</tr>';
var $html = $(html);
var $ht = $html.find('input.datepicker')[0];
$($ht).datepicker({dateFormat:"mm-dd-yy"});
$('#items > tbody:last').append($html);
$("#item_count").val(new_count);
});
</script>
</body>
</html>
这是我的网站,XML
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>portal</display-name>
<servlet>
<description>
</description>
<display-name>Basic_info</display-name>
<servlet-name>Basic_info</servlet-name>
<servlet-class>
controller.Basic_info</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Basic_info</servlet-name>
<url-pattern>/Basic_info</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>portal.root</param-value>
</context-param>
</web-app>
这是我从重定向到页面的Servlet的一部分:
medication []medication= historyInfo.viewMedication(patientid);
request.setAttribute("medication",medication);
getServletContext().getRequestDispatcher("/patient-history3(medication).jsp").forward(request,response);
return;