[vlma-devel] commit: Fix Spring behaviour when adding an adapter. (Adrien Grand )

git version control git at videolan.org
Sun May 11 12:47:18 CEST 2008


vlma | branch: master | Adrien Grand <jpountz at jpountz.net> | Sun May 11 12:33:09 2008 +0200| [8218c0fa5f6139ea319c0152063f81eff365c454]

Fix Spring behaviour when adding an adapter.

> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=8218c0fa5f6139ea319c0152063f81eff365c454
---

 .../web/server/ServersAdapterAddController.java    |    5 ++---
 web/src/main/webapp/WEB-INF/VLMa-servlet.xml       |    1 +
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/web/src/main/java/org/videolan/vlma/web/server/ServersAdapterAddController.java b/web/src/main/java/org/videolan/vlma/web/server/ServersAdapterAddController.java
index 0646f36..e4d893a 100644
--- a/web/src/main/java/org/videolan/vlma/web/server/ServersAdapterAddController.java
+++ b/web/src/main/java/org/videolan/vlma/web/server/ServersAdapterAddController.java
@@ -30,6 +30,7 @@ import javax.servlet.http.HttpServletResponse;
 import org.springframework.validation.BindException;
 import org.springframework.web.servlet.ModelAndView;
 import org.springframework.web.servlet.mvc.SimpleFormController;
+import org.springframework.web.servlet.view.RedirectView;
 import org.videolan.vlma.common.Data;
 import org.videolan.vlma.common.server.Server;
 import org.videolan.vlma.common.adapter.Adapter;
@@ -65,9 +66,7 @@ public class ServersAdapterAddController extends SimpleFormController {
                 }
             }
         }
-        ModelAndView mav = new ModelAndView();
-        mav.addObject("server", data.getServer(server));
-        return mav;
+        return new ModelAndView(getSuccessView(), "server", data.getServer(server).getId());
     }
 
     @Override
diff --git a/web/src/main/webapp/WEB-INF/VLMa-servlet.xml b/web/src/main/webapp/WEB-INF/VLMa-servlet.xml
index 8165acd..0bd2f78 100644
--- a/web/src/main/webapp/WEB-INF/VLMa-servlet.xml
+++ b/web/src/main/webapp/WEB-INF/VLMa-servlet.xml
@@ -79,6 +79,7 @@
         <property name="commandClass" value="org.videolan.vlma.web.server.ServersAdapterAdd" />
         <property name="validator" ref="serversAdapterAddValidator" />
         <property name="formView" value="serversadapteradd" />
+        <property name="successView" value="redirect:serversview.htm" />
     </bean>
 
     <bean id="serversAdapterRemoveValidator" class="org.videolan.vlma.web.server.ServersAdapterRemoveValidator" />



More information about the vlma-devel mailing list