Understanding Grizzly part I: Embedding Grizzly HTTP Web Server in 5 lines
Posted by jfarcand on December 8, 2006 at 2:33 PM EST
This blog has moved here
Related Topics >>
Blog Links >>
- Login or register to post comments
- Printer-friendly version
- jfarcand's blog
- 3222 reads






Comments
by energyglassfish - 2008-06-29 11:11
hi how to publish my papers help me pleaseby jfarcand - 2008-01-28 10:14
Which version are you using? startEndpoint block because it start listening on the port you selected. Try using SelectorThread.listen() method or spawn a thread that invoke startEndpoint(). Next time if you can post your question on users@grizzly.dev.java.net....a lot of code/peoples can help! Thanks!by ermhawi - 2008-01-28 09:59
Hi, I am trying to use this example in my implementation of a binding component in JBI, but for some reason the call to selectorThread.startEndpoint() hangs forever. If I implement it as a standalone java application it works as it should, but not within JBI (in glassfish). Any idea what might be the problem?by jfarcand - 2007-03-05 09:42
Hi, have you added the proper location when you started Grizzly. Something like java -jar grizzly.jar 8082 PATH_TO_INDEX.html? Thanks!by paipiski - 2007-03-04 16:16
Hi, I tried your code to run WebServer by starting SelectorThread but when i tried to get index.html file from the server, it return blank page example http://localhost:8082/index.html , i just want to access some static file, let me know how to do this.I have index.html file in the start directory. I used port 8082 . Thanks for your great work. Paiby jfarcand - 2007-02-13 17:15
Right. By default, the SelectorThread will execute on the same thread as the client. To implement what you want, just do SelectorThread.start() instead of SelectorThread.startEndpoint(). Thanks!by tblack - 2007-02-13 16:49
Jean-Francois, I tried to start two SelectorThread endpoints in one class and the first thread never returned to allow the main to start the second. How can I accomplish this? My end goal is to basically create two simple servers on ports 8080 and 9090 and create a pass-through proxy where the input request stream of the first is wired to the second server whose port is being held open indefinitely. Any idea on the simplest way to create this? Jeff