• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP to Jsp integration

 
Sonal Sharma
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I want to do is get the result of a bean in a string and add it as an attribute of the request object.then forward this attribute or string object to another jsp page.But I am getting IllegalThreadState Exception
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
Krishnamoorthy Vuyala Muralidharan
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sonal Sharma

You should to use RequestDispatcher to forward the first.jsp to second.jsp.
Before forwarding it to the second.jsp you should put the Bean object in the request attribute.
___________________________________________________

req.setAttribute("BeanName",bean);

RequestDispatcher rq = request.getRequestDispatcher('/second.jsp'); // you should write the path that is appropriate to your case

rq.forward(req,res);
___________________________________________________

In this way, you can access the bean in the second.jsp

Hope this helps.

Kind regards
Kris
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!