jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <basista.ju...@hypotecnibanka.cz>
Subject RE: Cactus test and Struts
Date Wed, 16 Mar 2005 07:19:09 GMT
It looks like your web-app wasn't successfuly deployed or cactifywar wasn't call. Try to check
log and also if your web.xml contains something like this :

<servlet>
     <servlet-name>ServletRedirector</servlet-name>
     <servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>ServletRedirector</servlet-name>
    <url-pattern>/ServletRedirector</url-pattern>
</servlet-mapping>

Dursik

-----Original Message-----
From: bryan hansen [mailto:bh5k@yahoo.com]
Sent: Tuesday, March 15, 2005 10:41 PM
To: cactus-user@jakarta.apache.org
Subject: Cactus test and Struts


We are using cactus to test some struts actions. I am
getting an error and not sure what the cause is. BTW
if somebody has found a better way to do this, I am
open for suggestions.

We simply add the URI that we want to request and the
appropriate paramaters in the begin method:

private void beginAction(WebRequest request) {
  request.addHeader("URI", "/lease/leaseSummary.do");
  request.addParameter("command", "viewLease");
  request.addParameter("itemId","1301");
  request.addParameter("structureId", "1111");      
}

We then access the action servlet:

public void testAction() throws Exception {
  ActionServlet servlet = new ActionServlet();
  servlet.init(config);
  UserSessionValues usv = new UserSessionValues();
  session.setAttribute("userInfo", usv);   
        
  servlet.doPost(request, response);
        
  UserSessionValues usvSession = (UserSessionValues)
request.getSession().getAttribute("userInfo");
        
   assertNotNull(usvSession);       
          
}


The output from this test results in a bunch of debug
code, but ultimately this:

    [cactus] 14:09:54,114 DEBUG wire: << "HTTP/1.1 404
Invalid path /ServletRedirector was requested[\r][\n]"

I get the same error message on Tomcat and JBoss.

Any ideas?

Thanks,

Bryan

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-user-help@jakarta.apache.org


Mime
View raw message