This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Servlets and the fly likes handle special characters from text area using Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "handle special characters from text area using " Watch "handle special characters from text area using " New topic
Author

handle special characters from text area using

Ronnie Phelps
Ranch Hand

Joined: Mar 12, 2001
Posts: 329
I'm trying to use request.getParameter("TEXTAREANAME") when sending a request from a form via a JSP. But I get unexpected results when entering characters(i.e. ') in that text field. I understand I may have to attach a backslash to specify this character is literal(i.e \'). Is there anyway I can have this special characters tagged with the (\) or will I have to manually add this using String buffers replace method?
Ronnie Phelps
Ranch Hand

Joined: Mar 12, 2001
Posts: 329
I think this is an SQL problem because I'm trying to do an insert into a database. How do I insert a string of text that contains the character ' in it when the format of Insert uses ' as a delimeter?
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

I think if you use a PreparedStatetment the driver will handle this invisibly under the covers.

Dave.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: handle special characters from text area using
 
It's not a secret anymore!