I've attached my web.xml, struts-config.xml, action class,
cactus.properties, and action test class.
It's just a small project to test cactus, httpunit, and struts test case.
The application works fine using the browser until I run the tests. Then
I'll only get a blank page
for feature.do, instead of the requested page. No errors, though.
If anything else is needed, let me know.
Thanks.
----- Original Message -----
From: "Jason Arndt" <[EMAIL PROTECTED]>
To: "Cactus Users List" <[EMAIL PROTECTED]>
Sent: Wednesday, March 12, 2003 12:52 PM
Subject: Re: followRedirects is false
> If you could send me your war file...I could probably
> help you out, but without seeing everything it's hard
> to tell. Sorry.
>
> I did have one other thought though....is your
> ServletTestRedirector servlet that you're using
> protected?
>
> --- Joseph Milora <[EMAIL PROTECTED]> wrote:
> > I've done the same.
> > Only difference is yours works and mine doesn't.
> >
> > I hope someone can shed some light on this error
> > message.
> > At least under what scenarios it can be thrown.
> >
> > Thanks in advance,
> > Joe Milora
> >
> >
> > ----- Original Message -----
> > From: "Jason Arndt" <[EMAIL PROTECTED]>
> > To: "Cactus Users List"
> > <[EMAIL PROTECTED]>
> > Sent: Tuesday, March 11, 2003 1:03 PM
> > Subject: Re: followRedirects is false
> >
> >
> > > I'm using the latest CVS of both from yesterday
> > > 3/11/2003. I
> > >
> > > However, to get strutstest to build I had to
> > modify
> > > some of the strutstest import statements because
> > the
> > > wrapper classes have been moved into a new
> > 'wrapper'
> > > package in cactus.
> > >
> > > I'm using commons-httpclient-2.0alpha3.jar and
> > > aspectjrt-1.0.6.jar.
> > >
> > > I did have a problem using httpclient-2.0alpha2
> > and
> > > never figured out why, but alpha3 fixed the
> > problem.
> > >
> > >
> > > --- Joseph Milora <[EMAIL PROTECTED]> wrote:
> > > > Hi Jason,
> > > >
> > > > 1. The setRequestPathInfo call matches my
> > > > struts-config.xml file
> > > > 2. According to the log files the action is
> > never
> > > > being executed.
> > > > Calling actionPerform() in the test case
> > does
> > > > not generate any errors, though.
> > > >
> > > > As far as verifying the forward, I get the
> > following
> > > > error message:
> > > >
> > > > was expecting '/mistura/feature.do' but received
> > > >
> > >
> >
>
'http://[host][port]/mistura/ServletRedirector/feature?Cactus_TestMethod=tes
> >
>
tCorrectScope&Cactus_TestClass=us.mistura.web.actions.FeatureActionTEST&Cact
> > us_AutomaticSession=true&Cactus_Service=CALL_TEST'
> > > >
> > > > The url doesn't look right.
> > > >
> > > > What versions of cactus and struts test case are
> > you
> > > > using?
> > > >
> > > > Thanks,
> > > >
> > > > Joe Milora
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > ----- Original Message -----
> > > > From: "Jason Arndt" <[EMAIL PROTECTED]>
> > > > To: "Cactus Users List"
> > > > <[EMAIL PROTECTED]>
> > > > Sent: Monday, March 10, 2003 4:26 PM
> > > > Subject: Re: followRedirects is false
> > > >
> > > >
> > > > > Hi Joe,
> > > > >
> > > > > I'm still not sure if I know what's going
> > wrong
> > > > > because everything looks good, but 2 things
> > you
> > > > can
> > > > > try:
> > > > >
> > > > > 1. the setRequestPathInfo() call must match
> > > > exactly
> > > > > what's in your struts-config.xml - verify that
> > it
> > > > is
> > > > > correct...should it be '/feature.do' vs
> > > > 'feature.do'
> > > > >
> > > > > 2. can you put some logging in you action
> > class
> > > > to
> > > > > make sure it's being called and if so, what's
> > > > > happening? specfically, what ActionForward it
> > is
> > > > > calling.
> > > > >
> > > > > let me know if you get any further...
> > > > >
> > > > > --- Joseph Milora <[EMAIL PROTECTED]> wrote:
> > > > > > Thanks for the reply Jason.
> > > > > >
> > > > > > As noted previously, I'm using JBoss
> > security
> > > > with
> > > > > > my username and password
> > > > > > stored in an Oracle
> > > > > > database and form authentication on the web
> > > > side.
> > > > > > My cactus.properties file contains
> > > > > >
> > > > > >
> > cactus.contextURL=http://[host]:[port]/[context]
> > > > > >
> > cactus.servletRedirectorName=ServletRedirector
> > > > > > cactus.enableLogging=true
> > > > > >
> > > > > >
> > > > > > In my beginXXX method I have
> > > > > >
> > > > > > webRequest.setAuthentication(new
> > > > > > FormAuthentication("username",
> > > > > > "password"));
> > > > > >
> > > > > > the testXXX method contains:
> > > > > >
> > > > > > setPathRequestInfo("feature.do");
> > > > > > setRequestParameter("name", "name");
> > > > > > setRequestParameter("description",
> > > > "description");
> > > > > > actionPerform();
> > > > > > verifyForward("feature");
> > > > > >
> > > > > > When I run the test without the
> > verifyForward, I
> > > > > > receive some "INFO:Redirect
> > > > > > requested but followRedirects
> > > > > > is disabled" messages. The test also
> > displays an
> > > > OK
> > > > > > message, but the EJB
> > > > > > methods aren't being called.
> > > > > >
> > > > > > When the verifyForward method is left in I
> > > > receive:
> > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
testXXX(us.mistura.web.actions.FeatureActionTEST)junit.framework.AssertionFa
> > > > > > iledError: was expecting
> > '/mistura/feature.do'
> > > > but
> > > > > > received
> > > > > >
> > > > >
> > > >
> > >
> >
>
'http://[host]:[port]/mistura/ServletRedirector/feature?Cactus_TestMethod=te
> > > > > >
> > > > >
> > > >
> > >
> >
>
stCorrectScope&Cactus_TestClass=us.mistura.web.actions.FeatureActionTEST&Cac
> > > > > >
> > > >
> > tus_AutomaticSession=true&Cactus_Service=CALL_TEST'
> > > > > >
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
> servletunit.struts.Common.verifyForwardPath(Common.java:241)
> > > > > >
> > > > > > at
> > > > > >
> > > > >
> > > >
> > >
> >
>
servletunit.struts.CactusStrutsTestCase.verifyForward(CactusStrutsTestCase.j
> > > > > > ava:535)
> > > > > >
> > > > > > at
> > > > > >
> >
> === message truncated ===
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Web Hosting - establish your business online
> http://webhosting.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app >
<context-param>
<param-name>
javax.servlet.jsp.jstl.fmt.locale
</param-name>
<param-value>
en-US
</param-value>
</context-param>
<context-param>
<param-name>
javax.servlet.jsp.jstl.fmt.localizationContext
</param-name>
<param-value>
resources/application
</param-value>
</context-param>
<!--
To use non XDoclet filters, create a filters.xml file that
contains the additional filters (eg Sitemesh) and place it in your
project's merge dir. Don't include filter-mappings in this file,
include them in a file called filter-mappings.xml and put that in
the same directory.
-->
<!--
To use non XDoclet filter-mappings, create a filter-mappings.xml file that
contains the additional filter-mappings and place it in your
project's merge dir.
-->
<!--
To use non XDoclet listeners, create a listeners.xml file that
contains the additional listeners and place it in your
project's merge dir.
-->
<servlet>
<servlet-name>
ServletRedirector
</servlet-name>
<servlet-class>
org.apache.cactus.server.ServletTestRedirector
</servlet-class>
</servlet>
<servlet>
<servlet-name>
action
</servlet-name>
<servlet-class>
org.apache.struts.action.ActionServlet
</servlet-class>
<init-param>
<param-name>
config
</param-name>
<param-value>
/WEB-INF/struts-config.xml
</param-value>
</init-param>
<init-param>
<param-name>
debug
</param-name>
<param-value>
2
</param-value>
</init-param>
<init-param>
<param-name>
detail
</param-name>
<param-value>
2
</param-value>
</init-param>
<load-on-startup>
2
</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>
ServletRedirector
</servlet-name>
<url-pattern>
/ServletRedirector
</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>
action
</servlet-name>
<url-pattern>
*.do
</url-pattern>
</servlet-mapping>
<!--
To specify mime mappings, create a file named mime-mappings.xml, put it in your project's mergedir.
Organize mime-mappings.xml following this DTD slice:
<!ELEMENT mime-mapping (extension, mime-type)>
-->
<welcome-file-list>
<welcome-file>
jstl-index.jsp
</welcome-file>
<welcome-file>
index.jsp
</welcome-file>
</welcome-file-list>
<!--
To specify error pages, create a file named error-pages.xml, put it in your project's mergedir.
Organize error-pages.xml following this DTD slice:
<!ELEMENT error-page ((error-code | exception-type), location)>
-->
<taglib>
<taglib-uri>
/tags/struts-bean
</taglib-uri>
<taglib-location>
/WEB-INF/struts-bean.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>
/tags/struts-logic
</taglib-uri>
<taglib-location>
/WEB-INF/struts-logic.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>
/tags/struts-html
</taglib-uri>
<taglib-location>
/WEB-INF/struts-html.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>
/tags/struts-nested
</taglib-uri>
<taglib-location>
/WEB-INF/struts-nested.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>
/tags/struts-template
</taglib-uri>
<taglib-location>
/WEB-INF/struts-template.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>
/tags/struts-tiles
</taglib-uri>
<taglib-location>
/WEB-INF/struts-tiles.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>
/tags/struts-html-el
</taglib-uri>
<taglib-location>
/WEB-INF/struts-html-el.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>
/tags/struts-logic-el
</taglib-uri>
<taglib-location>
/WEB-INF/struts-logic-el.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>
/tags/struts-bean-el
</taglib-uri>
<taglib-location>
/WEB-INF/struts-bean-el.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>
http://java.sun.com/jstl/fmt
</taglib-uri>
<taglib-location>
/WEB-INF/fmt.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>
http://java.sun.com/jstl/c
</taglib-uri>
<taglib-location>
/WEB-INF/c.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>
http://java.sun.com/jstl/x
</taglib-uri>
<taglib-location>
/WEB-INF/x.tld
</taglib-location>
</taglib>
<taglib>
<taglib-uri>
http://java.sun.com/jstl/sql
</taglib-uri>
<taglib-location>
/WEB-INF/sql.tld
</taglib-location>
</taglib>
<security-constraint>
<web-resource-collection>
<web-resource-name>
Restricted
</web-resource-name>
<description>
Restricted access
</description>
<url-pattern>
/*
</url-pattern>
<http-method>
HEAD
</http-method>
<http-method>
GET
</http-method>
<http-method>
POST
</http-method>
<http-method>
PUT
</http-method>
<http-method>
DELETE
</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>
admin
</role-name>
</auth-constraint>
<user-data-constraint>
<description>
no description
</description>
<transport-guarantee>
NONE
</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>
FORM
</auth-method>
<realm-name>
Mistura realm
</realm-name>
<form-login-config>
<form-login-page>
/login.jsp
</form-login-page>
<form-error-page>
/error.jsp
</form-error-page>
</form-login-config>
</login-config>
<security-role>
<description>Administration role</description>
<role-name>admin</role-name>
</security-role>
<ejb-ref>
<ejb-ref-name>
ejb/us.mistura.interfaces.requirement.FeatureHome
</ejb-ref-name>
<ejb-ref-type>
Entity
</ejb-ref-type>
<home>
us.mistura.interfaces.requirement.FeatureHome
</home>
<remote>
us.mistura.interfaces.requirement.Feature
</remote>
</ejb-ref>
</web-app>
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<!--
This is a blank Struts configuration file with an example
welcome action/page and other commented sample elements.
Tiles and the Struts Validator are configured using the factory defaults
and are ready-to-use.
NOTE: If you have a generator tool to create the corresponding Java classes
for you, you could include the details in the "form-bean" declarations.
Otherwise, you would only define the "form-bean" element itself, with the
corresponding "name" and "type" attributes, as shown here.
-->
<struts-config>
<!-- ==================================== Data Source Configuration -->
<!--
<data-sources>
<data-source>
<set-property
property="autoCommit"
value="false"/>
<set-property
property="description"
value="Example Data Source Configuration"/>
<set-property
property="driverClass"
value="org.postgresql.Driver"/>
<set-property
property="maxCount"
value="4"/>
<set-property
property="minCount"
value="2"/>
<set-property
property="password"
value="mypassword"/>
<set-property
property="url"
value="jdbc:postgresql://localhost/mydatabase"/>
<set-property
property="user"
value="myusername"/>
</data-source>
</data-sources>
-->
<!-- ======================================== Form Bean Definitions -->
<form-beans>
<form-bean
name="featureForm"
type="org.apache.struts.action.DynaActionForm">
<form-property
name="name"
type="java.lang.String"/>
<form-property
name="description"
type="java.lang.String"/>
</form-bean>
</form-beans>
<!-- ================================= Global Exception Definitions -->
<global-exceptions>
<!-- sample exception handler
<exception
key="expired.password"
type="app.ExpiredPasswordException"
path="/changePassword.jsp"/>
end sample -->
</global-exceptions>
<!-- =================================== Global Forward Definitions -->
<global-forwards>
<!-- Default forward to "Welcome" action -->
<!-- Demonstrates using index.jsp to forward -->
<forward
name="welcome"
path="/Welcome.do"/>
<forward
name="secure"
path="/secure.do"/>
<forward
name="feature"
path="/feature.do"/>
<forward
name="login"
path="/login.do"/>
</global-forwards>
<!-- =================================== Action Mapping Definitions -->
<action-mappings
type="org.apache.struts.config.SecureActionConfig">
<!-- Default "Welcome" action -->
<!-- Forwards to Welcome.jsp -->
<action
path="/Welcome"
type="org.apache.struts.actions.ForwardAction"
parameter="/WEB-INF/pages/Welcome.jsp"/>
<action
path="/feature"
type="org.apache.struts.actions.ForwardAction"
parameter="/WEB-INF/pages/feature.jsp"/>
<action
path="/login"
type="org.apache.struts.actions.ForwardAction"
parameter="/login.jsp"/>
<action
path="/secure"
type="com.web.SSLaction"
scope="request">
<set-property property="secure" value="true"/>
</action>
</action-mappings>
<!-- ===================================== Controller Configuration -->
<!--
<controller
processorClass="org.apache.struts.tiles.TilesRequestProcessor"/>
-->
<controller
processorClass="org.apache.struts.action.SecureRequestProcessor" />
<!-- ================================ Message Resources Definitions -->
<message-resources parameter="resources.application"/>
<!-- ======================================= Plug Ins Configuration -->
<!-- ========== Tiles plugin =================== -->
<!-- -->
<!--
This plugin initialize Tiles definition factory. This later can takes some
parameters explained here after. The plugin first read parameters from web.xml, then
overload them with parameters defined here. All parameters are optional.
The plugin should be declared in each struts-config file.
- definitions-config: (optional)
Specify configuration file names. There can be several comma
separated file names (default: ?? )
- moduleAware: (optional - struts1.1)
Specify if the Tiles definition factory is module aware. If true (default),
there will be one factory for each Struts module.
If false, there will be one common factory for all module. In this later case,
it is still needed to declare one plugin per module. The factory will be
initialized with parameters found in the first initialized plugin (generally the
one associated with the default module).
true : One factory per module. (default)
false : one single shared factory for all modules
- definitions-parser-validate: (optional)
Specify if xml parser should validate the Tiles configuration file.
true : validate. DTD should be specified in file header. (default)
false : no validation
Paths found in Tiles definitions are relative to the main context.
-->
<!-- comment following if struts1.0.x -->
<!--
<plug-in
className="org.apache.struts.tiles.TilesPlugin">
<set-property
property="definitions-config"
value="/WEB-INF/tiles-defs.xml" />
<set-property property="moduleAware" value="true" />
<set-property property="definitions-parser-validate" value="true" />
</plug-in>
-->
<!-- end comment if struts1.0.x -->
<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property
property="pathnames"
value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
</plug-in>
<plug-in className="org.apache.struts.action.SecurePlugIn">
<set-property property="httpPort" value="8092"/>
<set-property property="httpsPort" value="8443"/>
<set-property property="enable" value="true"/>
</plug-in>
</struts-config>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]