本文整理了Java中org.geoserver.ows.Request.setHttpRequest
方法的一些代码示例,展示了Request.setHttpRequest
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.setHttpRequest
方法的具体详情如下:
包路径:org.geoserver.ows.Request
类名称:Request
方法名:setHttpRequest
[英]Allows callbacks to override the http request
[中]允许回调重写http请求
代码示例来源:origin: geoserver/geoserver
request.setHttpRequest(httpRequest);
request.setHttpResponse(httpResponse);
代码示例来源:origin: geoserver/geoserver
public void testParseKVP() throws Exception {
URL url = getClass().getResource("applicationContext.xml");
FileSystemXmlApplicationContext context =
new FileSystemXmlApplicationContext(url.toString());
Dispatcher dispatcher = (Dispatcher) context.getBean("dispatcher");
MockHttpServletRequest request = new MockHttpServletRequest();
request.setContextPath("/geoserver");
request.addParameter("service", "hello");
request.addParameter("request", "Hello");
request.addParameter("message", "Hello world!");
request.setQueryString("service=hello&request=hello&message=Hello World!");
Request req = new Request();
req.setHttpRequest(request);
dispatcher.parseKVP(req);
Message message = (Message) dispatcher.parseRequestKVP(Message.class, req);
assertEquals(new Message("Hello world!"), message);
}
代码示例来源:origin: geoserver/geoserver
protected void setUp() throws Exception {
super.setUp();
HelloWorld helloWorld = new HelloWorld();
Service service =
new Service(
"hello",
helloWorld,
new Version("1.0.0"),
Collections.singletonList("hello"));
request =
new MockHttpServletRequest() {
public int getServerPort() {
return 8080;
}
};
request.setScheme("http");
request.setServerName("localhost");
request.setContextPath("geoserver");
response = new MockHttpServletResponse();
handler = new DefaultServiceExceptionHandler();
requestInfo = new Request();
requestInfo.setHttpRequest(request);
requestInfo.setHttpResponse(response);
requestInfo.setService("hello");
requestInfo.setVersion("1.0.0");
}
代码示例来源:origin: org.geoserver/gs-gwc
request.setHttpRequest(
new VirtualServiceRequest(
request.getHttpRequest(),
layerName));
} else if (localPublished != null) {
request.setHttpRequest(
new VirtualServiceRequest(
request.getHttpRequest(), localPublished.getName(), null, null));
代码示例来源:origin: org.geoserver.extension/control-flow
Request buildRequest(String gsCookieValue) {
Request request = new Request();
MockHttpServletRequest httpRequest = new MockHttpServletRequest();
request.setHttpRequest(httpRequest);
request.setHttpResponse(new MockHttpServletResponse());
if(gsCookieValue != null) {
httpRequest.addCookie(new Cookie(UserFlowController.COOKIE_NAME, gsCookieValue));
}
return request;
}
}
代码示例来源:origin: org.geoserver.extension/control-flow
Request buildRequest(String ipAddress, String proxyIp) {
Request request = new Request();
MockHttpServletRequest httpRequest = new MockHttpServletRequest();
request.setHttpRequest(httpRequest);
request.setHttpResponse(new MockHttpServletResponse());
if (ipAddress != null && !ipAddress.equals("")) {
httpRequest.setRemoteAddr(ipAddress);
} else {
httpRequest.setRemoteAddr("127.0.0.1");
}
if (!proxyIp.equals("")) {
httpRequest.setHeader("x-forwarded-for", proxyIp + ", " + ipAddress);
}
return request;
}
内容来源于网络,如有侵权,请联系作者删除!