dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #30343
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15401: use HttpServletResponse.sendRedirect instead of relying of RedirectView which we don't use in the...
------------------------------------------------------------
revno: 15401
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-05-26 11:06:51 +0200
message:
use HttpServletResponse.sendRedirect instead of relying of RedirectView which we don't use in the view-chain anymore, fixes issues with redirecting from /api and /api/ => /api/resources
modified:
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/IndexController.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/IndexController.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/IndexController.java 2014-05-22 12:40:24 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/webapi/controller/IndexController.java 2014-05-26 09:06:51 +0000
@@ -29,10 +29,12 @@
*/
import org.springframework.stereotype.Controller;
-import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
/**
* @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
*/
@@ -44,14 +46,14 @@
//--------------------------------------------------------------------------
@RequestMapping( value = "/api", method = RequestMethod.GET )
- public String getIndex( Model model )
+ public void getIndex( HttpServletResponse response ) throws IOException
{
- return "redirect:/api/resources";
+ response.sendRedirect( "/api/resources" );
}
@RequestMapping( value = "/", method = RequestMethod.GET )
- public String getIndexWithSlash( Model model )
+ public void getIndexWithSlash( HttpServletResponse response ) throws IOException
{
- return "redirect:/api/resources";
+ response.sendRedirect( "/api/resources" );
}
}