1. did you check the same property name in your messages.properties file.
2. ActionMapping is not deprecated. Reads the docs again. It saya "would
have been deprecated". in fact, this class has 2 more subclasses.



>-----Original Message-----
>From: f f [mailto:[EMAIL PROTECTED]
>Sent: Thursday, February 12, 2004 8:26 AM
>To: [EMAIL PROTECTED]
>Subject: 2 PROBLEMs-Please Help
>
>
>Hi gurus,
>I have 2 problems(or may be 2 bug reports) :
>
>1. The point is IT CAN'T SAVE ERRORS !
>Here is some relevant codes(some of them are simplified)
>===============================================================
>from TrySubmitOrderAction.java(on execute method) :
>  // if object under the name found so use it, otherwise create
>one, and put it on
>  // session.
>  ShoppingCartLocal cart=ShoppingCartUtilWeb.getObjectOnSession(session);
>
>  /////// alternative 1. CODE BELOW IS THE BUG
>  if(cart.isEmpty()){
>     System.out.println("Cart is Empty");
>   errors.add(ActionErrors.GLOBAL_ERROR,new
>ActionError("errors.cartIsEmtpy"));
>  }
>  if(!errors.isEmpty()){
>   saveErrors(request,errors);
>   System.out.println("errors saved");
>   return mapping.findForward("failure"); // forward to /common/error.jsp
>  }
>  //// CODE ABOVE IS THE BUG
>  //////// alternative 2. IF ALTERNATIVE 1 can't save errors !
>  /**
>  if(cart.isEmpty()){
>   return mapping.findForward("failureCartIsEmpty"); // forward to
>/common/error.jsp
>  }
>  */
>
>from /common/error.jsp :
><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="h" %>
><h:errors />
><%-- more jsp && html tags --%>
>
>from console :
>INFO  [TilesRequestProcessor] Tiles definition factory found for
>request processor ''.
>INFO  [STDOUT] Cart is Empty  <<<<<<<<<<<<<<<<<<<<<< LOOK A THIS
>INFO  [STDOUT] errors saved   <<<<<<<<<<<<<<<<<<<<<< AND THIS TOO
>INFO  [PropertyMessageResources] Initializing,
>config='org.apache.struts.taglib.html.LocalStrings', returnNull=true
>from server.log :
>DEBUG [org.apache.struts.action.RequestProcessor] Processing a
>'GET' for path '/trySubmitOrder'
>DEBUG [org.apache.struts.action.RequestProcessor]  Setting user locale 'en'
>DEBUG [org.apache.struts.util.RequestUtils]  Looking for
>ActionForm bean instance in scope 'request' under attribute key
>'SubmitOrderForm'
>DEBUG [org.apache.struts.util.RequestUtils]  Creating new
>ActionForm instance of type 'proj.web.form.SubmitOrderForm'
>DEBUG [org.apache.struts.util.RequestUtils]  --> {SubmitOrderForm :  }
>DEBUG [org.apache.struts.action.RequestProcessor]  Storing
>ActionForm bean instance in scope 'request' under attribute key
>'SubmitOrderForm'
>DEBUG [org.apache.struts.action.RequestProcessor]  Populating bean
>properties from this request
>DEBUG [org.apache.struts.action.RequestProcessor]  Looking for
>Action instance for class proj.web.action.TrySubmitOrderAction
>DEBUG [org.apache.struts.action.RequestProcessor]   Creating new
>Action instance
>INFO  [STDOUT] Cart is Empty
>INFO  [STDOUT] errors saved
>DEBUG [org.apache.struts.tiles.TilesRequestProcessor]
>processForwardConfig(/common/error.jsp, false)
>DEBUG [org.apache.struts.tiles.xmlDefinition.I18nFactorySet] Can't
>open file '/WEB-INF/tiles-config_en.xml'
>DEBUG [org.apache.struts.tiles.TilesRequestProcessor]
>'/common/error.jsp' - processed as uri
>DEBUG [org.apache.struts.action.RequestProcessor]
>processForwardConfig(ForwardConfig[name=failure,path=/common/error.
>jsp,redirect=false,contextRelative=false])
>
>from struts-config.xml
>I don't specify the input attribute because It needs no validation.
>    <action
>      path="/trySubmitOrder"
>      type="proj.web.action.TrySubmitOrderAction"
>      name="SubmitOrderForm"
>      scope="request"
>      unknown="false"
>      validate="false"
>    >
>      <forward
>        name="success"
>        path="/order/orderPage.jsp"
>        redirect="false"
>      />
>      <forward
>        name="failure"
>        path="/common/error.jsp"
>        redirect="false"
>      />
>      <forward
>        name="failureCartIsEmtpy"
>        path="/failureCartIsEmtpyInserter.jsp" // indirectly
>insert /common/error.jsp,
>        redirect="false"
>      />
>    </action>
>===============================================================
>fortunately threre is only one strange Action like this.
>note : don't criticize my System.out.println-s ,please. I've tried
>Log4J but I can't configure it to print log to the console on JBoss.
>
>2. Both ActionMapping and ActionForward are deprecated, so I
>replaced ALL ActionForward to ForwardConfig, and ActionMapping to
>ActionConfig on my source files.
> And my report is ..  why ActionForward
>execute(ActionMapping,ActionForm,HttpServletRequest,HttpServletResponse)
> is not deprecated and subtituded with :
> ForwardConfig execute
>ActionConfig,ActionForm,HttpServletRequest,HttpServletResponse)
> or other similar method.
>  At last, I had to undo ALL of my changes.
>
>Thanks for your answers,
>Fredrich.
>
>
>
>---------------------------------
>Do you Yahoo!?
>Yahoo! Finance: Get your refund fast by filing online


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to