aspose file tools*
The moose likes Servlets and the fly likes Keeping user from putting quotes around string in JSP??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Keeping user from putting quotes around string in JSP???" Watch "Keeping user from putting quotes around string in JSP???" New topic
Author

Keeping user from putting quotes around string in JSP???

Moined Mogul
Ranch Hand

Joined: Jul 11, 2001
Posts: 33
I have a JSP where the user is asked to input a string that will be put into a table in my database. I do not have problems adding the string but if I were to try and edit or copy that same string I get the problem of having ""HELLO"" instead of "HELLO". If "HELLO" were to be an example of a string that I entered.
How could I ensure that the user was never able to add the quotes to a string in my JSP???
Please help, this is quite urgent!!!
Thank you.
Vlad Patryshev
Ranch Hand

Joined: Jun 30, 2001
Posts: 61
Why not just strip the enclosing quotes and leave the user do what she/he likes?


Thanks,<br />Vlad
Moined Mogul
Ranch Hand

Joined: Jul 11, 2001
Posts: 33
How can I strip these off within the JSP and then reassign it to the name of the text box???
Originally posted by Vlad Patryshev:
Why not just strip the enclosing quotes and leave the user do what she/he likes?

Moined Mogul
Ranch Hand

Joined: Jul 11, 2001
Posts: 33
PLEASE HELP!!!
URGENT!!!
THANK YOU!!!
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
You can just use JSP scriptlet to check for and remove the quotes, if they are present.

Bosun


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Vlad Patryshev
Ranch Hand

Joined: Jun 30, 2001
Posts: 61
Oh I see. You want to do it on the client side. Then you can do it using Javascript of course. Not by reacting to key presses (here Javascript is not as strong as one might need), but just by stripping the quotes, say, after the user changes focus.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Keeping user from putting quotes around string in JSP???