Announcement Announcement Module
Collapse
No announcement yet.
Where are the Pros?? I am doing something wroung? Using redirect all the time Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Where are the Pros?? I am doing something wroung? Using redirect all the time

    I started programming Spring about 3 weeks ago. I did Struts some year back. Most of my project is working but I dont think I did it right or I am using the right design. I can see that on successView i am always doing a redirect so i know i must be doing something wroung.

    Below is my example

    Screen 1: Controller(controller A) extends AbstractController this screen displays a list of account numbers. Each account number has a href that points to the 2nd Screen.

    Screen 2: Controller(controller B) extends extends SimpleFormController. In the formBackingObject i get the account number and look it up in the database and then returns the account to be displayed. I this point the user can make changes and then click on submit. The control will go back to controller B in the onSubmit funcation. In this funcation i updated the database and then do a "return new ModelAndView(getSuccessView(), model);" Which in most of my cases just displays the Screen1 with the list of the data should i be using a redirect????


    Code:
    <bean id="keyrec_security_updateController"
    		class="com.medco.wms.web.WMSPReceivingDisplayFormController">
    		<property name="commandName">
    			<value>receivingrow</value>
    		</property>
    		<property name="commandClass">
    			<value>com.medco.wms.dao.ReceivingRow</value>
    		</property>
    		<property name="formView">
    			<value>keyrec_security_update</value>
    		</property>
    		<property name="successView">
    			<value>redirect:list_keyrec.wms</value>
    		</property>
    		<property name="WMSService" ref="wmsService" />
    	</bean>
Working...
X