phpsrvlt.jar : servlet.java ../../ext/java/reflect.java
@test -e net || mkdir net
@test -e net/php || mkdir net/php
- @echo library=sapi>net/php/reflect.properties
- @echo library=sapi>net/php/servlet.properties
+ @echo library=php4>net/php/reflect.properties
+ @echo library=php4>net/php/servlet.properties
@cp servlet.java net/php
@cp ../../ext/java/reflect.java net/php
javac net/php/reflect.java
{
this.request=request;
this.response=response;
+
+ String servletPath=request.getServletPath();
+ String contextPath=getServletContext().getRealPath(servletPath);
+
send(request.getMethod(), request.getQueryString(),
- request.getPathInfo(), getPathTranslated(),
+ request.getPathInfo(), contextPath,
request.getContentType(), request.getContentLength(),
request.getRemoteUser());
super.destroy();
}
- /******************************************************************/
- /* utility function */
- /******************************************************************/
-
- String getPathTranslated() {
- /* I have no idea why this has to be this hard... */
- String servletPath=request.getServletPath();
- String contextPath=getServletContext().getRealPath(servletPath);
- servletPath=servletPath.replace('/',slash);
- contextPath=contextPath.substring(0,contextPath.lastIndexOf(slash));
- return contextPath+servletPath;
- }
}