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 "Frank J. Buono" <Fr...@ExceptionalSoftware.com> on 2003/01/15 16:43:46 UTC

getRequestDispatcher()/JSP Test problem

Hi:
 
I've got the getRequestDispathcher() and forward() methods working; however,
the .jsp file can't find (load) the beans it references. HTML is returned, as expected,
in endXXX() from the .jsp file.
 
Per the output (below) it appears that port # and URL are wrong in the request
to the JSP - it's getting port 80; we're using port 7001...
 
We're using weblogic 7.0 and the ServletTestRunner. 
 
Is this a configuration problem?
 
Thanks.
 
Frank
 
 
public void testFrank() throws java.io.IOException, ServletException
    {
           System.out.println ( "CACTUS_CONTEXT_URL_PROPERTY: " +
           System.getProperty (Configuration.CACTUS_CONTEXT_URL_PROPERTY ) );
      
           RequestDispatcher rd = 
           config.getServletContext().getRequestDispatcher(
           "/jsp/weSimpleXmlQueryWithTest.jsp?selectClause=sysdate&fromClause=dual");
 
           System.out.println ( "path: " + request.getRequestURL() );
           rd.forward(request, response);

    }
 
     public void endFrank(WebResponse webResponse)
    {
           WebRequest wr = webResponse.getWebRequest();
            System.out.println ( "wr: " + wr );
            System.out.println("   IN endFrank***: " + webResponse.getText());
            assertEquals("we're in!", "we're in!");
    }
 
*** Output from our test servlet
CACTUS_CONTEXT_URL_PROPERTY: http://john2:7001/WeSimpleQuery
ServletContext.getServerInfo: WebLogic WebLogic Server 7.0 SP1  
                              Mon Sep 9 22:46:58 PDT 2002 206753 
request.getRequestURL: http://john2:80/WeSimpleQuerynullnull
 
*** Output from our JSP
***
JSP:request.getServerPort: 80
JSP:request.getURL: http://john2:80/WeSimpleQuery/jsp/weSimpleXmlQueryWithTest.jsp