This commit is contained in:
shengzhang
2021-04-23 19:46:37 +08:00
parent 9a2e14d147
commit 79d7967e0d
35 changed files with 516 additions and 196 deletions

View File

@@ -66,11 +66,19 @@ public class SaRequestForServlet implements SaRequest {
}
/**
* 返回当前请求的URL
* 返回当前请求path (不包括上下文名称)
*/
@Override
public String getRequestURI() {
return request.getRequestURI();
public String getRequestPath() {
return request.getServletPath();
}
/**
* 返回当前请求的类型
*/
@Override
public String getMethod() {
return request.getMethod();
}
}

View File

@@ -59,4 +59,14 @@ public class SaResponseForServlet implements SaResponse {
response.addCookie(cookie);
}
/**
* 在响应头里写入一个值
*/
@Override
public SaResponse setHeader(String name, String value) {
response.setHeader(name, value);
return this;
}
}