HTTP Server

115 views
Skip to first unread message

Scott Duensing

unread,
Feb 14, 2013, 5:39:18 PM2/14/13
to web...@googlegroups.com
I've implemented a basic HTTP request handler that basically goes through the motions to discover/collect the needed information for the response and finally hands it back to Webbit with this line:

   response.header("Content-Type", mime).header("Content-Length", data.length).content(data).end();

The first file requested works fine.  FireBug and friends show it moving over the network and the browser attempting to request all the additional files needed to render the page.  However, FireBug also shows each additional request as a 404.  My debug code in my request handler never fires - it's not being called again.

Replacing my handler with the following:

   .add("/", new StaticFileHandler("web"))

Results in the same thing.  :-(  How do I get static content served?  

Thanks!

aslak hellesoy

unread,
Feb 15, 2013, 2:23:04 AM2/15/13
to Webbit
On Thu, Feb 14, 2013 at 10:39 PM, Scott Duensing <scott.d...@gmail.com> wrote:
I've implemented a basic HTTP request handler that basically goes through the motions to discover/collect the needed information for the response and finally hands it back to Webbit with this line:

   response.header("Content-Type", mime).header("Content-Length", data.length).content(data).end();

Can we see the entire method? It's hard to guess without more context.

The first file requested works fine.  FireBug and friends show it moving over the network and the browser attempting to request all the additional files needed to render the page.  However, FireBug also shows each additional request as a 404.  My debug code in my request handler never fires - it's not being called again.

Replacing my handler with the following:

   .add("/", new StaticFileHandler("web"))

Results in the same thing.  :-(  How do I get static content served?  


Aslak

Thanks!

--
You received this message because you are subscribed to the Google Groups "Webbit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webbit+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Scott Duensing

unread,
Feb 15, 2013, 1:27:26 PM2/15/13
to web...@googlegroups.com
I changed my handler from:

   .add("/", new StaticFileHandler("web"))

to:

   .add(new StaticFileHandler("./web"))

and it magically sprung to life.  Thanks for the pointer to go read the chatroom code!  I have no idea how I missed an entire directory full of samples.  <facepalm>


Scott
Reply all
Reply to author
Forward
0 new messages