• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RequestDispatcher - include

 
Arvind Chavar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have html form which on submitting invokes the servlet.I do the following in doPost method of the servlet
public void doPost(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOException{
RequestDispatcher rd = getServletContext().getRequestDispatcher("/loadBean.jsp");
//request.setAttribute("input",new OmniPacketTesterInputBean());
log(request.getAttribute("input")+"");
log(request+"");
rd.include(request,response);
log(request+"");
log(request.getAttribute("input")+"");
}
What I am trying to do here is forward the request to loadBean.jsp to take care of loading of values. loadBean.jsp looks has only two following lines
<jsp:useBean id="input" scope="request" class="com.sungard.omniconnect.framework.packettester.OmniPacketTesterInputBean"/>
<jsp:setProperty name="input" property="*"/>
So it should cretae an instance of the bean and load the values form request,and when I return to my servlet from this include the bean should be avaialable, but I am getting null.Any idea why this behaviour?

Thanks.
Arvind
 
Arvind Chavar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for the post guys.It was problem with my path settings.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic