Set a string which is defined in a servlet into a jsp

Hi,

I am new to servlets and need ur help ..

I have a jsp which has aTextField and a TextArea. On submit the text given on the TextField is set ain the servlet. Then an operation is performed on the string annd the result is set to another string variable inside the servlet. Now I want to display this new string in the TextArea of that jsp .. Plzzz help I am already getting the new string inside my servlet .Now I just have to set the value in the jsp ....

Thanks in advance

[502 byte] By [Ayan@Indiaa] at [2007-11-27 1:46:49]
# 1

Try this:

in the servlet, store the string value in the session scope:

...

String stringValue;

...

request.getSession().setAttribute("stringName", stringValue);

...

In the JSP, access the string value stored in the session scope:

<textarea name="text_area"><%= session.getAttribute("stringName") %></textarea>

toon_macharisa at 2007-7-12 1:08:53 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...