tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Treves" <dw...@macam98.ac.il>
Subject including servlets in a customed tag
Date Wed, 28 Mar 2001 12:03:24 GMT
Hi,

    I am trying to include a servlet while processing a tag I wrote, I don't need specifically
the request and response of the pageContext of that tag. I tried to include the servlet with
new and with the existing request/response, both way the servlet simply was not included.
it looks like it simply skips the including line.

the tag code is:

try{
  ServletRequest request = pageContext.getRequest();
  request.setAttribute("recipientId",userId); // add an attribute to be passed to the included
file
  
  ServletResponse response = pageContext.getResponse();
  System.out.println("in tag");
  javax.servlet.RequestDispatcher rd = pageContext.getRequest().getRequestDispatcher("/courses/servlet/cacheUsers");
  rd.include(request, response);
  System.out.println("after including (in tag)");
}
catch(javax.servlet.ServletException e){
  System.out.println("ServletException: " + e.getMessage());
}

As you can see there are System outs and both of them printed. (the code was taken from the
doEndTag())

Any idea whats wrong here?


Thanks!
David.

Mime
View raw message