You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Hunter Hillegas <li...@lastonepicked.com> on 2001/10/03 00:53:33 UTC

Problems Including Servlet Response in Tags...

I'm building some tags and having some trouble...

I am including a Servlet response in a tag like this:

try {
    pageContext.include("/groundswellController?action=tagGetNews");
}
catch (Exception e) {
    System.out.println("Error including Servlet request: " + e);
}

This doesn't throw an exception, so I assume that it is processing...

The above servlet call creates a Vector of objects and places it into the
REQUEST scope via setAttribute().

Then I have a JSP that calls the above referenced tag, which in theory
should then put the Vector into the request scope.

Trying to reference that Vector from the test JSP:

Vector theNewsCollection =
(Vector)request.getAttribute("theNewsCollection");
        
        if (theNewsCollection == null) {
            %>The news collection is null...<%
        }

Guess what, this page reads that the collection is null...

I donĀ¹t suspect the servlet's internal processing since I know the method
that creates the collection is working (it is used in other parts of the
application - I just created a new exposure to it)...

Any ideas?

Hunter