Try creating a method with something similar
to this in is:

  String input = request.getParameter("Whatever"); // Line from the form
  String returnVariable="";

  if(input.indexOf("\'")!=-1)
        returnVariable=input.replace("\'","");

  return returnVarible;


This will replace all occurances of '  with a blank, or
whatever you decide.

Check the API.

Dave



-----Original Message-----
From: Andrew Dingfelder [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 17, 2000 9:39 PM
To: [EMAIL PROTECTED]
Subject: [SERVLET-INTEREST] dubm question


I know I have heard this somewhere before, but can
someone give me a hint ?

I made a simple servlet that just does an insert into a
mysql database from an HTML form.  It takes about 10
fields, looks up the unique vals & inserts the data if
it is valid.

One error I forgot to check for is if people put 's in
their data...   the sql statements obviously wont like
that...  and I can fix that by looking for 's & making
them '''s

The ugly thing was that after someone made the servlet
blow chunks at the error (it responded with a sql
exception) then every other person that tried to use the
posting servlet had their data corrupted...  as if the
servlet was remembering their data & using it instead of
the new data.

Any suggestions or obvious things to look at ?


Andrew Dingfelder
Computing As You Like It
108 Blanchard St., Raleigh NC 27603
[EMAIL PROTECTED]
Phone (919) 828-9824

___________________________________________________________________________
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


***********************************************************************
Privileged/confidential information may be contained in this message.
If you are not the addressee indicated in this message (or responsible
for delivery of the message to such person), you may not copy or
deliver this message to anyone. In such case, you should destroy this
message and notify the sender and [EMAIL PROTECTED]
immediately.

If you or your employer do not consent to Internet E-mail messages of
this kind, please advise us immediately.

Opinions, conclusions and other information expressed in this message
 (including any attachments) are not given or endorsed by ebeon ltd
 (or ebeon inc., as applicable) unless otherwise confirmed in writing
by an authorised representative independent of this message. Any
liability arising from reliance placed on this message (including its
attachments) without such independent confirmation is hereby excluded.

This message (including attachments) is protected by copyright laws
but has no other legal or contractual standing. The presence of this
footnote indicates that this message (including its attachments) has
been processed by an automated anti-virus system; however it is the
responsiblity of the recipient to ensure that the message (and
attachments) are safe and authorised for use in their environment.
***********************************************************************

___________________________________________________________________________
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

Reply via email to