Hello All,
I try to write servlet that show data from database. The data
adduced in html table on html page . The problem is what
browser take page from its cashe . I.e. data stay old .
Can anyone help me ?
Code :
1) page from servlet
<HTML>
<HEAD>
<TITLE></TITLE>
<META HTTP-EQUIV="expires" CONTENT="0">
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<script language="JavaScript">
<!--
function next ( ){
document.nextpage.page.value++;
document.nextpage.submit();
}
function prev ( ){
document.nextpage.page.value--;
if(document.nextpage.page.value < 0 )
document.nextpage.page.value=0;
document.nextpage.submit();
}
-->
</script>
</HEAD>
<BODY >
<center>
<H1><font color="#0000c0">Bla-Bla</font></H1>
<TABLE WIDTH="100%" HEIGHT="90%" BORDER="1" ALIGN="CENTER" CELLSPACING="1"
CELLPADDING="1" BGCOLOR="#6d74a9" BORDERCOLORLIGHT="#66CCFF" BORDERCOLORDARK="#99FFFF">
//some table
</TABLE>
<FORM name = "nextpage" ACTION="http://myservlet/servlet/ptc" METHOD="GET">
<INPUT TYPE=HIDDEN NAME="page" VALUE="0">
<INPUT type=button VALUE="���������� ����" ONCLICK="prev()">
<INPUT TYPE=BUTTON VALUE="��������� ����" onClick="next()">
</FORM>
</center></BODY></HTML>
2) servlet
public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException {
if(!init)
initialize();
String freq = null;
freq = req.getParameter("page");
if (freq != null) {
try {
int page = Integer.parseInt(freq);
sendPage(page, res);
}
catch (NumberFormatException nfe) {
log("Can't parse page number !");
}
}
else {
res.sendError(404);
}
}
--
Best regards,
Andrey mailto:[EMAIL PROTECTED]
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html