[vlma-devel] commit: Idem when removing 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:48:20 2008 +0200| [614bee822fd6abaec4b31f1c1d677749e75e4ace]

Idem when removing an adapter.

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

 .../web/server/ServersAdapterAddController.java    |    3 +--
 .../web/server/ServersAdapterRemoveController.java |    4 +---
 web/src/main/webapp/WEB-INF/VLMa-servlet.xml       |    1 +
 3 files changed, 3 insertions(+), 5 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 e4d893a..3346601 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,7 +30,6 @@ 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;
@@ -66,7 +65,7 @@ public class ServersAdapterAddController extends SimpleFormController {
                 }
             }
         }
-        return new ModelAndView(getSuccessView(), "server", data.getServer(server).getId());
+        return new ModelAndView(getSuccessView(), "server", server);
     }
 
     @Override
diff --git a/web/src/main/java/org/videolan/vlma/web/server/ServersAdapterRemoveController.java b/web/src/main/java/org/videolan/vlma/web/server/ServersAdapterRemoveController.java
index 75af7a3..e349c7d 100644
--- a/web/src/main/java/org/videolan/vlma/web/server/ServersAdapterRemoveController.java
+++ b/web/src/main/java/org/videolan/vlma/web/server/ServersAdapterRemoveController.java
@@ -54,9 +54,7 @@ public class ServersAdapterRemoveController extends SimpleFormController {
         String name = ((ServersAdapterAdd) command).getName();
 
         data.removeAdapter(server, name);
-        ModelAndView mav = new ModelAndView();
-        mav.addObject("server", data.getServer(server));
-        return mav;
+        return new ModelAndView(getSuccessView(), "server", server);
     }
 
     @Override
diff --git a/web/src/main/webapp/WEB-INF/VLMa-servlet.xml b/web/src/main/webapp/WEB-INF/VLMa-servlet.xml
index 0bd2f78..798938a 100644
--- a/web/src/main/webapp/WEB-INF/VLMa-servlet.xml
+++ b/web/src/main/webapp/WEB-INF/VLMa-servlet.xml
@@ -90,6 +90,7 @@
         <property name="commandClass" value="org.videolan.vlma.web.server.ServersAdapterAdd" />
         <property name="validator" ref="serversAdapterRemoveValidator" />
         <property name="formView" value="serversadapterremove" />
+        <property name="successView" value="redirect:serversview.htm" />
     </bean>
 
     <bean id="ServersStartCheckVLCController" class="org.videolan.vlma.web.server.ServersStartCheckVLCController">



More information about the vlma-devel mailing list