Pārlūkot izejas kodu

/print and /print/export can only be visited using GET

sunyj 7 gadi atpakaļ
vecāks
revīzija
8519feac29

+ 3 - 2
report/src/main/java/com/uas/report/controller/PrintController.java

@@ -15,6 +15,7 @@ import org.dom4j.DocumentException;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
 
@@ -120,7 +121,7 @@ public class PrintController {
 	 * @throws JRException
      * @throws ServletException
 	 */
-	@RequestMapping
+	@RequestMapping(method = RequestMethod.GET)
 	public void print(@RequestParam String id, HttpServletRequest request, HttpServletResponse response)
 			throws JRException, IOException, DocumentException, SQLException, ServletException {
         switch (getPrintParameter(id, request, response).getPrintType()) {
@@ -162,7 +163,7 @@ public class PrintController {
      * @throws IOException
      * @throws JRException
      */
-    @RequestMapping("/export")
+    @RequestMapping(value = "/export", method = RequestMethod.GET)
     @ResponseBody
     public void export(@RequestParam String id, String exportFileType, Boolean flush, HttpServletRequest request,
 			HttpServletResponse response) throws JRException, IOException, DocumentException, SQLException {