You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Yahzz Yan <ya...@yahoo.com> on 2005/05/24 18:38:16 UTC

Cactus not working well with Struts when url-pattern not use *.do

We are trying to use Cactus Struts testing framework to test our struts application. When we run our suite of tests, we notice that that Cactus corrupts the Struts configuration at runtime which causes the struts form actions to point to an invalid url - which has .do in it whereas our application does not use .do. 
 
To be precise, here is the exact scenario:
1) We have our ActionServlet mapped to /action/*.go and not to *.do
2) We run our suite of tests (cactus tests) and the tests run fine.
3) then we go back to our application and the struts form actions are all broken - they have *.do at the end which is not configured for our application.
4) If we restart the app and not invoke the test suite and test our application, all the forms work well.
 
If we change our servlet mapping to *.do, then everything works fine.
 
It seems like Cactus assumes that the mapping is always *.do.
Has anyone faced a similar problem? do you know how to fix it - other than changing the mapping to *.do. Please advise and thanks.
 
 

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

Re: Cactus not working well with Struts when url-pattern not use *.do

Posted by Martin Gainty <mg...@hotmail.com>.
This is a kluge but did you consider trapping it  the parameter from 
ServletTestCase
String doParam = config.getInitParameter("url-pattern");

then later setting the correct url-pattern
doParam = "*.do"
config.setInitParameter(doParam);

Martin-



----- Original Message ----- 
From: "Yahzz Yan" <ya...@yahoo.com>
To: <us...@struts.apache.org>
Sent: Tuesday, May 24, 2005 12:38 PM
Subject: Cactus not working well with Struts when url-pattern not use *.do


> We are trying to use Cactus Struts testing framework to test our struts 
> application. When we run our suite of tests, we notice that that Cactus 
> corrupts the Struts configuration at runtime which causes the struts form 
> actions to point to an invalid url - which has .do in it whereas our 
> application does not use .do.
>
> To be precise, here is the exact scenario:
> 1) We have our ActionServlet mapped to /action/*.go and not to *.do
> 2) We run our suite of tests (cactus tests) and the tests run fine.
> 3) then we go back to our application and the struts form actions are all 
> broken - they have *.do at the end which is not configured for our 
> application.
> 4) If we restart the app and not invoke the test suite and test our 
> application, all the forms work well.
>
> If we change our servlet mapping to *.do, then everything works fine.
>
> It seems like Cactus assumes that the mapping is always *.do.
> Has anyone faced a similar problem? do you know how to fix it - other than 
> changing the mapping to *.do. Please advise and thanks.
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com 

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