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