This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Textbox String

 
Amber Woods
Ranch Hand
Posts: 111
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I created a servlet that creates a html form with a textbox and a submit button. The form posts to the same servlet which in turn reverses the string entered in the textbox and creates the same form as before only now with the reversed text in the textbox. If the user presses the submit button again the reversed text should go back to what it was.
My servlet seems to work for all text except when a single quote is placed in the textbox and submitted. What happens is the text after a single quote gets reversed and sent back but cuts off the text that was before the single quote to begin with.
My guess that this happens is because I use s single quotes to set what the value of the textbox will be on the form. This is part of what I do in the code:
out.print( "<INPUT TYPE='TEXT' NAME='text' value='" );
//code to take in the string and reverse then print
out.print( "' size='50'>" );
Any Suggestions?
Amber
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic