if (page != null) {
ServletRequest servletRequest;
try {
- servletRequest = new ServletRequest(request);
+ servletRequest = new ServletRequest(request, this);
} catch (URISyntaxException use1) {
throw new IOException("Could not create URI from " + request.getRequestURI(), use1);
}
import java.net.URI;
import java.net.URISyntaxException;
+import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import net.pterodactylus.util.web.Method;
public class ServletRequest extends Request {
private final HttpServletRequest servletRequest;
+ private final HttpServlet servlet;
/**
* @param uri
* @param method
* @throws URISyntaxException
*/
- public ServletRequest(javax.servlet.http.HttpServletRequest servletRequest) throws URISyntaxException {
+ public ServletRequest(javax.servlet.http.HttpServletRequest servletRequest, HttpServlet servlet) throws URISyntaxException {
super(new URI(servletRequest.getRequestURI()), Method.valueOf(servletRequest.getMethod().toUpperCase()));
this.servletRequest = servletRequest;
+ this.servlet = servlet;
}
/**
return servletRequest;
}
+ /**
+ * @return the servlet
+ */
+ public HttpServlet getServlet() {
+ return servlet;
+ }
+
}