struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew J. Vincent" <...@informatics.jax.org>
Subject Best Practice - Correct usage???
Date Wed, 03 May 2006 14:24:16 GMT
Hello all,

I have an application to edit some data stored in the database.  I have 
2 situations.

1.  When a user clicks New or Edit Mouse, the user is brought to a form 
that either displays an empty form or one that is pre-populated.  This 
is done with the following mapping:

<pre>
      <action path = "/mouseAction"
              type = "org.jax.mgi.mtb.jaxpathwi.actions.MouseDispatchAction"
              name = "MouseSubmitForm"
              scope = "request"
              validate = "true"
              parameter = "dispatch"
              input = "mouse.jsp">
         <forward name="setupSuccess"
                  path="/WEB-INF/jsp/mouse.jsp"/> 
         <forward name="insertSuccess"
                  path="/WEB-INF/jsp/mouse.jsp"/> 
         <forward name="updateSuccess"
                  path="/WEB-INF/jsp/mouse.jsp"/> 
      </action> 
</pre>

This works fine, but upon successful insert why couldn't I just forward 
it back to the "setupSuccess" portion?  Like the following:

<pre>
      <action path = "/mouseAction"
              type = "org.jax.mgi.mtb.jaxpathwi.actions.MouseDispatchAction"
              name = "MouseSubmitForm"
              scope = "request"
              validate = "true"
              parameter = "dispatch"
              input = "mouse.jsp">
         <forward name="setupSuccess"
                  path="/WEB-INF/jsp/mouse.jsp"/> 
         <forward name="insertSuccess"
                  path="/mouseAction.do"/> 
         <forward name="updateSuccess"
                  path="/WEB-INF/jsp/mouse.jsp"/> 
      </action> 
</pre>

Do I have to do something different in my Action class?  It is running 
in an infinite loop and eventually running out of memory.

2.  When a user updates a mouse, I want them to be directed to a summary 
screen of the mouse which has the following mapping:

<pre>
      <action path = "/mouseSummary"
              type = "org.jax.mgi.mtb.jaxpathwi.actions.MouseSummaryAction"
              scope="request">
         <forward name="success" path="/WEB-INF/jsp/mouseSummary.jsp"/>
      </action>     
</pre>
    
would I change my action mapping to the following

<pre>
      <action path = "/mouseAction"
              type = "org.jax.mgi.mtb.jaxpathwi.actions.MouseDispatchAction"
              name = "MouseSubmitForm"
              scope = "request"
              validate = "true"
              parameter = "dispatch"
              input = "mouse.jsp">
         <forward name="setupSuccess"
                  path="/WEB-INF/jsp/mouse.jsp"/> 
         <forward name="insertSuccess"
                  path="/mouseAction.do"/> 
         <forward name="updateSuccess"
                  path="/mouseSummary.do"/> 
      </action> 
</pre>

But how does one pass in the variables that mouse summary needs to know 
like the id of the mouse?

Am I making any sense to anyone?

Thanks!

Matt


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


Mime
View raw message