You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Vincent Massol <vm...@pivolis.com> on 2003/08/10 13:31:29 UTC
RE: When w'd JspTestCase's pageContext return null?
Hi Karthik,
I have written this simple test:
public class TestJspContext extends JspTestCase
{
public void testPageContext()
{
assertNotNull("Page context should not be null", pageContext);
}
}
and it runs fine here. Can you try it?
Thanks
-Vincent
> -----Original Message-----
> From: karthik Guru [mailto:karthik_guru2000@yahoo.com]
> Sent: 25 July 2003 08:56
> To: Cactus Users List
> Subject: When w'd JspTestCase's pageContext return null?
>
> Hi
>
> I'm using JspTestCase to tes my JSP. This is my
> testXXX method where am accessing pageContext as given
> in the example. Am getting a null pointer exception in
> that line. Is there any reasonĀ for the pageContext
> field to be null?
>
> thanks,
> karthik
>
> public void testCompareScenarios() throws
> TestcaseException,ServletException,IOException {
>
> System.out.println("testCompareScenarios()");
>
> MarkdownDetails MDDetails = new MarkdownDetails();
>
> MarkdownGroups MDGroups = new MarkdownGroups();
>
> MarkdownScenarios MDScenarios = new
> MarkdownScenarios();
>
> session.setAttribute("mode", "M");
>
> MDDetails.init(request);
>
> session.setAttribute("MDDetails",MDDetails);
>
> MDGroups.init(request);
>
> session.setAttribute("MDGroups",MDGroups);
>
> session.setAttribute("MDScenarios",MDScenarios);
>
> String pathToJSP =
> "/mdo-
>
app/ScenarioComparison.jsp?selScenarioIDs=2006|2007&selMinDates=2003/Jul
/2
>
7|2003/Jul/27&selMaxDates=2003/Oct/04|2003/Oct/04&selScenarioIndexes=0|1
";
>
> pageContext.forward(pathToJSP);
>
> WTable wTable = (WTable)
> session.getAttribute("SCEN_COMP_DATA");
>
> printObject(wTable);
>
> }
>
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org