jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stewart Wachs <Stewart.Wa...@trustvesta.com>
Subject Trouble retrieving request parameters...
Date Tue, 17 Dec 2002 02:19:23 GMT
I found some interesting behavior while trying to write a unit test for a
Taglib...

 

To retrieve request parameters from inside the Taglib I use
pageContext.getRequest().getParameter("foobar").

 

While this works when making requests from a web browser, it fails to
retrieve the request parameter that I setup

In my test fixture.

 

...

        request.setAttribute(PROGRAM, Constants.FOO_BAR);

        tag.setPageContext(this.pageContext);

 

        int result = tag.doStartTag();

 

        assertEquals(tag.SKIP_BODY, result);

        assertNull(pageContext.getSession().getAttribute(SHOPPING_CART));

        assertNull(pageContext.getSession().getAttribute(PRODUCT_LIST));

...

 

However, if I change my Taglib code to retrieve request parameters by using
pageContext.getAttribute("foobar", PageContext.REQUEST_SCOPE) the unit test
passes, but the web browser request fails. Any ideas of what's going on
here?

 

 

 

 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message