Home » questions » "request" object in jsp page?

"request" object in jsp page?

2006-08-03 20:09:22, Category: Programming & Design
I have page1.jsp and page2.jsp. - In page1.jsp I get request object and set new attribute like this: request.setAttribute("myAtt" , some_value); Then submit it to page2.jsp - In page2.jsp, I try to get this value. But problem here, it return null value. Please let me know How can I cat get "myAtt" in page2.jsp. Thank.

Answers

  1. the_justin

    On 2006-08-03 20:46:02


    how do you retrieve your attribute in your second jsp page ? i've tried this code bellow and it works. jsp2 then will print out 'hello'. hope this can help you out with your problem
  2. zoha -

    On 2006-08-03 21:23:45


    u gotta read the value like : String wateverName=request.getParameter("myAtt"); if u still cant get it, try to put some condtion..or do sth to force the page to get the value... still if u can't get it, try to control the values...by System.out.println(); after running u can see the printed values in the tommcat startup... or in console..so u will know what went wrong and why.... i hope it works