struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Shneyderman" <a...@law.columbia.edu>
Subject Action Chaining problems
Date Mon, 28 Jul 2003 23:23:37 GMT
I have a need to chain actions and my code looks like:

OperationConfig oc = new OperationConfig ();
        
if ((oc.getStep () == null) || "".equals (oc.getStep ().trim ())) {
   oc.setStep (DEFAULT_STEP);
}

if ((oc.getOperation () == null) || "".equals (oc.getOperation ().trim
())) {
   oc.setOperation (DEFAULT_OP);
}
        
ActionForward af = mapping.findForward ("navigate.step" + oc.getStep
());
        
//System.out.println ("Hash code: " + ((Object) request).hashCode ());
//System.out.println ("To string: " + ((Object) request).toString ());

if (af != null) {
   request.setAttribute (Constants.REQATTRIBUTE_OPCFG, oc);

//for (Enumeration enum = request.getAttributeNames();
enum.hasMoreElements // (); ) {
//   String key = (String) enum.nextElement ();
//     System.out.println ("Key: " + key + "; Class: " +
//request.getAttribute (key).getClass().getName ());
//            }
            
   return af;
} else { // TODO: this is an error.
   return null;
}

Now when my action that I chain to gets the request it actualy does not
get the attribute that I set. As the matter of fact my request object is
completely different instance (which I really could care less about, as
long the content stays there).

Can someone shed some light on this?
My redirect is false.

Thanks,
Alex.

PS here is the output of the commented code:

Hash code: 5738457
To string: org.apache.catalina.core.ApplicationHttpRequest@578fd9
Key: javax.servlet.request.cipher_suite; Class: java.lang.String
Key: org.apache.struts.action.MESSAGE; Class:
org.apache.struts.util.PropertyMessageResources
Key: javax.servlet.request.key_size; Class: java.lang.Integer
Key: org.apache.struts.action.mapping.instance; Class:
org.apache.struts.action.ActionMapping
Key: Logon; Class: org.apache.struts.validator.DynaValidatorForm
Key: edu.columbia.law.gls.opcfg; Class:
edu.columbia.law.gls.OperationConfig
Key: NavigatorForm; Class: org.apache.struts.action.DynaActionForm
Key: org.apache.struts.action.MODULE; Class:
org.apache.struts.config.impl.ModuleConfigImpl

Similar output of the action chained to:


Hash code: 4727831
To string: org.apache.coyote.tomcat4.CoyoteRequestFacade@482417
-- it is null
Key: javax.servlet.request.cipher_suite; Class: java.lang.String
Key: org.apache.struts.action.MESSAGE; Class:
org.apache.struts.util.PropertyMessageResources
Key: javax.servlet.request.key_size; Class: java.lang.Integer
Key: org.apache.struts.action.mapping.instance; Class:
org.apache.struts.action.ActionMapping
Key: org.apache.struts.action.MODULE; Class:
org.apache.struts.config.impl.ModuleConfigImpl

As you can see the request and its content is changed. Why is that?



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


Mime
View raw message