private HttpServletRequest req;
private HttpServletResponse resp;
private String method, path;
- private URL url;
- private Map<?, ?> props = new HashMap();
+ private URL url, context;
+ private MultiMap<String, String> params = null;
+ private Map<Object, Object> props = new HashMap<Object, Object>();
public J2eeRequest(ServletConfig cfg, HttpServletRequest req, HttpServletResponse resp) {
this.cfg = cfg;
q = "";
try {
url = new URL(scheme, host, port, req.getContextPath() + req.getServletPath() + pi + q);
+ context = new URL(scheme, host, port, req.getContextPath());
} catch(MalformedURLException e) {
throw(new Error(e));
}
path = path.substring(1);
}
- public Map<?, ?> props() {
+ public Map<Object, Object> props() {
return(props);
}
- public ServerContext ctx() {
- return(new J2eeContext(cfg, req, resp));
- }
-
public SocketAddress remoteaddr() {
try {
return(new InetSocketAddress(InetAddress.getByName(req.getRemoteAddr()), req.getRemotePort()));
return(url);
}
+ public URL rooturl() {
+ return(context);
+ }
+
+ public ServerContext ctx() {
+ return(ThreadContext.current().server());
+ }
+
public String method() {
return(method);
}
}
public MultiMap<String, String> params() {
- return(null);
+ if(params == null) {
+ params = Params.urlparams(this);
+ if(method == "POST") {
+ MultiMap<String, String> pp = Params.postparams(this);
+ if(pp != null)
+ params.putAll(pp);
+ }
+ }
+ return(params);
}
protected void backflush() {