File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes The page doesn't gets refreshed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "The page doesn Watch "The page doesn New topic
Author

The page doesn't gets refreshed

Gaurav Kalra
Greenhorn

Joined: Mar 13, 2001
Posts: 27
Hi,
I'm developing a site in which i'm continuously overwriting a file with more contents. But the page when refreshed doesn't reflect the changes.
However if i download the page using ftp, the page actually contains more data.
What could be the problem. Please help.
Also in a user input form, if the user enters a text containing quotes, then the sql query reports an error. Is there any possible solution.
Thanx in advance
Gaurav
Phil Hanna
Ranch Hand

Joined: Apr 05, 2001
Posts: 118
What do you mean by "if I download the page using FTP, the page actually contains more data". What is being updated, the JSP page or the file? It's hard to figure out what you're doing wrong if we can't see your code.
The SQL error is caused by your building a query string dynamically from whatever the user enters:

You can see that if userInput contains "O'Brian", you'll get garbled SQL.
A better approach is to use a prepared statement:

Note that you don't need quotes around the "?", whether the value is numeric or string.
------------------
Phil Hanna
Author of :
JSP: The Complete Reference
Instant Java Servlets
[This message has been edited by Phil Hanna (edited April 15, 2001).]


Phil Hanna<BR>Sun Certified Programmer for the Java 2 Platform<BR>Author of :<BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072127686/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">JSP: The Complete Reference</A><BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072124253/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">Instant Java Servlets</A>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: The page doesn't gets refreshed