The tutorial has
public void handle(Request request, Response response)
{
// Print the requested URI path
String message = "Resource URI: " + request.getResourceRef() + '\n'
+ "Base URI: " + request.getBaseRef() + '\n'
+ "Relative path: " +
request.getRelativePart() + '\n'
+ "Query string: " +
request.getResourceRef().getQuery();
response.setEntity(message, MediaType.TEXT_PLAIN);
}
Re-using this I have
VirtualHost vh = container.getDefaultHost();
vh.attach("/dir", application);
....
public void handle(Request request, Response response) {
Method m = request.getMethod();
if (m.getName() == "GET"){
// Print the requested URI path
String message = "Resource URI: " + request.getResourceRef() + '\n'
+ "Base URI: " + request.getBaseRef() + '\n'
+ "Relative path: " + request.getRelativePart() + '\n'
+ "Query string: " + request.getResourceRef().getQuery();
System.out.println(message);
When I browse to http://localhost:8182/dir/file.ext?param=1
The debug output shows
INFO: Request now comitted to a response. Notifying
11-Nov-2006 11:09:17 org.safehaus.asyncweb.io.PooledAllocator releaseBytes
WARNING: Recycled bytes 48768 exceeds limit (5000). Discarding
Method is GET
Resource URI: http://localhost:8182/dir/abk.css
Base URI: http://localhost:8182/dir
Relative path: /abk.css
Query string: null
The file returned has
<link rel="STYLESHEET" href="abk.css" type="text/css">
which (guessing) is where the relative path information comes from.
Is this wrong - I find it confusing.
regards
--
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk