request工具类
This commit is contained in:
parent
8d119b0e4a
commit
a296f7180f
|
@ -1,12 +1,13 @@
|
|||
package com.zheng.upms.sso.client.util;
|
||||
package com.zheng.common.util;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Enumeration;
|
||||
|
||||
/**
|
||||
* request工具类
|
||||
* Created by ZhangShuzheng on 2016/12/12.
|
||||
*/
|
||||
public class RequestParameterUtil {
|
||||
public class RequestUtil {
|
||||
|
||||
/**
|
||||
* 移除request指定参数
|
|
@ -1,28 +0,0 @@
|
|||
package com.zheng.upms.admin.controller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 示例controller
|
||||
* Created by shuzheng on 2016/12/16.
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/hello")
|
||||
public class HelloController {
|
||||
|
||||
private static Logger _log = LoggerFactory.getLogger(HelloController.class);
|
||||
|
||||
@RequestMapping("")
|
||||
@ResponseBody
|
||||
public String index() {
|
||||
return new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date());
|
||||
}
|
||||
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
package com.zheng.upms.admin.controller;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 后台controller
|
||||
* Created by shuzheng on 2016/12/18.
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/manage")
|
||||
public class ManageController {
|
||||
|
||||
private static Logger _log = LoggerFactory.getLogger(ManageController.class);
|
||||
|
||||
@RequestMapping(value = {"", "/index"})
|
||||
public String index() {
|
||||
return "/manage/index";
|
||||
}
|
||||
|
||||
}
|
|
@ -46,7 +46,7 @@ public class SSOController {
|
|||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("")
|
||||
@RequestMapping(value = "", method = RequestMethod.GET)
|
||||
public String index(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
String system_name = request.getParameter("system_name");
|
||||
String backurl = request.getParameter("backurl");
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package com.zheng.upms.admin.controller;
|
||||
package com.zheng.upms.admin.controller.manage;
|
||||
|
||||
import com.zheng.upms.dao.model.UpmsSystemExample;
|
||||
import com.zheng.upms.rpc.api.UpmsSystemService;
|
|
@ -1,42 +0,0 @@
|
|||
package com.zheng.upms.sso.client.util;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletRequestWrapper;
|
||||
import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by ZhangShuzheng on 2016/12/12.
|
||||
*/
|
||||
public class MyHttpServletRequestWrapper extends HttpServletRequestWrapper {
|
||||
|
||||
private Map params = new HashMap();
|
||||
|
||||
public MyHttpServletRequestWrapper(HttpServletRequest request) {
|
||||
super(request);
|
||||
//params = request.getParameterMap();
|
||||
}
|
||||
|
||||
public void removeParameter(String name) {
|
||||
params.remove(name);
|
||||
}
|
||||
|
||||
public Map getParameterMap() {
|
||||
return params;
|
||||
}
|
||||
|
||||
public String getParameter(String name) {
|
||||
return (String) params.get(name);
|
||||
}
|
||||
|
||||
public Enumeration getParameterNames() {
|
||||
return Collections.enumeration(params.keySet());
|
||||
}
|
||||
|
||||
public String[] getParameterValues(String name) {
|
||||
return (String[])params.get(name);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue