dcsimg
html-jsp(write a file)-redirect to that file, problem
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   NIAN_ZHANG
Posted On:   Thursday, August 21, 2003 06:10 AM

err, i can't find any proper words to describe my problem in the subject area... ok. below is my code a html file T.html and a jsp file TT.jsp <%@page contentType="text/html"%> <%@page import="java.io.*"%> JSP Page <% String input = request.getParameter("in"); try { FileWriter fw = new FileWriter("C:\local\projectnt\updatedPage.htm"); PrintWriter pw = new PrintWriter(fw); pw.println(input); pw.cl   More>>

err, i can't find any proper words to describe my problem in the subject area...


ok. below is my code


a html file T.html


			
















and a jsp file TT.jsp


			
<%@page contentType="text/html"%>
<%@page import="java.io.*"%>

JSP Page

<%
String input = request.getParameter("in");
try
{
FileWriter fw = new FileWriter("C:\local\projectnt\updatedPage.htm");
PrintWriter pw = new PrintWriter(fw);
pw.println(input);
pw.close();
}
catch (IOException ioe)
{
out.println("ioex");
}
response.sendRedirect("updatedPage.htm");
%>



when open the T.html, enter something, then submit, TT.jsp should write the something to updatedPage.htm, then redirect to it, i then need to back to the html file and enter some new things, submit again, then i shold see the new content.

But, the problem is sometimes the updatedPage.htm just show last submitted content. i have to refresh(one or several times) the page to see the correct content.


any idea what's going on?

   <<Less

Re: html-jsp(write a file)-redirect to that file, problem

Posted By:   NIAN_ZHANG  
Posted On:   Thursday, August 21, 2003 06:19 AM

and i have checked the updatedPage.htm by opening it manually, and found it does change every time input is changed.
About | Sitemap | Contact