cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject cvs commit: xml-cocoon2/src/scratchpad/src/org/apache/cocoon/samples/castor TestBeanAction.java
Date Tue, 11 Jun 2002 23:54:54 GMT
vgritsenko    2002/06/11 16:54:54

  Modified:    src/scratchpad/src/org/apache/cocoon/samples/castor
                        TestBeanAction.java
  Log:
  Use ObjectModelHelper instead of deprecated Constants
  
  Revision  Changes    Path
  1.2       +14 -11    xml-cocoon2/src/scratchpad/src/org/apache/cocoon/samples/castor/TestBeanAction.java
  
  Index: TestBeanAction.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/samples/castor/TestBeanAction.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestBeanAction.java	7 Mar 2002 16:09:47 -0000	1.1
  +++ TestBeanAction.java	11 Jun 2002 23:54:54 -0000	1.2
  @@ -1,35 +1,38 @@
   package org.apache.cocoon.samples.castor;
   
  -import java.util.Map;
  -import org.apache.cocoon.environment.Redirector;
  -import org.apache.cocoon.environment.SourceResolver;
   import org.apache.avalon.framework.parameters.Parameters;
  -import org.apache.cocoon.acting.*;
  +
  +import org.apache.cocoon.acting.AbstractAction;
  +import org.apache.cocoon.environment.Context;
  +import org.apache.cocoon.environment.ObjectModelHelper;
  +import org.apache.cocoon.environment.Redirector;
   import org.apache.cocoon.environment.Request;
  -import org.apache.cocoon.Constants;
   import org.apache.cocoon.environment.Session;
  -import org.apache.cocoon.environment.Context;
  +import org.apache.cocoon.environment.SourceResolver;
  +
  +import java.util.Map;
   
   
   public class TestBeanAction extends AbstractAction {
   
     public TestBeanAction() {
     }
  -  public Map act(Redirector redirector, SourceResolver resolver, Map objectmodel, String
src, Parameters param) throws java.lang.Exception {
  -      Request request =(Request)objectmodel.get(Constants.REQUEST_OBJECT);
  -      Context context = (Context)objectmodel.get(Constants.CONTEXT_OBJECT);
  +
  +  public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String
src, Parameters param) throws java.lang.Exception {
  +      Request request = ObjectModelHelper.getRequest(objectModel);
  +      Context context = ObjectModelHelper.getContext(objectModel);
         if(context != null)
           request.setAttribute("Wale",new  TestBean("Wale in the big sea","context"));
   
         Session session =request.getSession(true);
         session.setAttribute("Mouse",new  TestBean("Liveing in the session","session"));
  -      objectmodel.put("Lion", new TestBean("Lion:walking on the sitemap","sitemap") );
  +      objectModel.put("Lion", new TestBean("Lion:walking on the sitemap","sitemap") );
         request.setAttribute("Hamster",new TestBean("Hamster:Wer hat nach mir gefragt","request")
 );
         session.setAttribute("Elefant",new  TestBean("Elefant:from Africa","session"));
         request.setAttribute("Elefant",new  TestBean("Elefant:from India","request"));
   
   
  -      return objectmodel;
  +      return objectModel;
   
     }
   }
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message