this calls for debugging line by line
when you have no debug tool, then println is helpful
heres one trap you can set
just println the string you received before reversing it
if it prints the whole sentence, then its cool, your method is getting correct input.
and then, println just before exiting the reverse method,
you should see whole sentence reverse. if not, if you see only the last word reversed, then, the error is between those 2 printlns.
if the println shows correctly reversed sentence, then the error is in the process of returning the string to the client,..that is, in the jsp that will display the reversed