This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "The page doesn Watch "The page doesn New topic

The page doesn't gets refreshed

Gaurav Kalra

Joined: Mar 13, 2001
Posts: 27
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
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="" TARGET=_blank rel="nofollow">JSP: The Complete Reference</A><BR><A HREF="" TARGET=_blank rel="nofollow">Instant Java Servlets</A>
I agree. Here's the link:
subject: The page doesn't gets refreshed
Similar Threads
Disable button from code???
[B] a private final method can be overridden!!!! [/B]
Trap Refresh and Back action by user
populating one dropdown box depending on the value of other dropdown box
How do you get new text to appear each time