simpleweb-support Mailing List for Simple (Page 31)
Brought to you by:
niallg
You can subscribe to this list here.
2004 |
Jan
(1) |
Feb
(4) |
Mar
(2) |
Apr
(14) |
May
(22) |
Jun
(15) |
Jul
(9) |
Aug
(2) |
Sep
(7) |
Oct
(4) |
Nov
(2) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(7) |
Feb
(16) |
Mar
(17) |
Apr
|
May
(12) |
Jun
(4) |
Jul
(22) |
Aug
(50) |
Sep
(8) |
Oct
(23) |
Nov
(9) |
Dec
(50) |
2006 |
Jan
(6) |
Feb
(7) |
Mar
(8) |
Apr
(3) |
May
(13) |
Jun
(4) |
Jul
(2) |
Aug
|
Sep
(1) |
Oct
|
Nov
(6) |
Dec
(7) |
2007 |
Jan
(11) |
Feb
(3) |
Mar
(17) |
Apr
(21) |
May
(9) |
Jun
(4) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(8) |
Nov
(14) |
Dec
(3) |
2008 |
Jan
(3) |
Feb
|
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
(4) |
Aug
(4) |
Sep
(15) |
Oct
(9) |
Nov
(6) |
Dec
(2) |
2009 |
Jan
(29) |
Feb
(2) |
Mar
(8) |
Apr
(14) |
May
(4) |
Jun
(13) |
Jul
(5) |
Aug
|
Sep
|
Oct
(4) |
Nov
(3) |
Dec
(7) |
2010 |
Jan
|
Feb
(2) |
Mar
(61) |
Apr
(9) |
May
(10) |
Jun
(9) |
Jul
(10) |
Aug
(7) |
Sep
(15) |
Oct
(5) |
Nov
(2) |
Dec
(3) |
2011 |
Jan
(11) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
(4) |
Oct
|
Nov
(6) |
Dec
(9) |
2012 |
Jan
|
Feb
(1) |
Mar
(2) |
Apr
(3) |
May
(2) |
Jun
|
Jul
(17) |
Aug
|
Sep
|
Oct
|
Nov
(10) |
Dec
(5) |
2013 |
Jan
(2) |
Feb
(4) |
Mar
|
Apr
(12) |
May
|
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
(1) |
2014 |
Jan
|
Feb
(2) |
Mar
(6) |
Apr
|
May
|
Jun
(20) |
Jul
(12) |
Aug
(4) |
Sep
(3) |
Oct
(5) |
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2017 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Alex C. <al...@cl...> - 2005-05-04 21:10:51
|
Niall Gallagher wrote: >Look at simple.http.load.ActiveService, it does >exactly what you want. In response to your last >question, I think that offloading the back-end IO to a >non-blocking system would be a win. I see no >difference in a proxy acting as a client versus a >non-proxy server. If you reverse the processing >technique used by Simple I think you would have a very >efficient proxy server. I have thought about such a >proxy server in the past, however I have not had time >to implement it even though I am sure you could modify >simple.http.* to achieve it. > > Niall, Thanks for your response. I can see from the source code that ActiveService always spawns a new thread, obviously it would be better to make use of a thread pool, but that should be a pretty simple change. It's not obvious how the IO layer knows when the service's response is complete; the Thread isn't visible, so you can't join() it, and there's no FutureResult or similar handle for polling... OK, never mind, I just found the OutputMonitor. :) Interesting design choice to have the OutputStream drive the completion. So it looks like I could give the Request and Response to some other thread and have the Service's thread forget about them entirely--the IO layer would detect when the response was considered to be complete and adopt the response (carrying its socket in tow) at that point. -0xe1a |
From: Enrique R. <ero...@ap...> - 2005-05-04 01:37:53
|
Hi, Niall, I've been thinking for some time that you ought to check out "MINA," a NIO framework gaining widespread adoption at Apache. We currently have teams working on LDAP, Kerberos, DNS, DHCP, NTP, SMTP, and IMAP, as well as SSL, SASL, and other filter support. http://directory.apache.org/subprojects/network/index.html There's some super-basic HTTP example code at the bottom of that page that might give you a quick idea of how it works. -enrique Niall Gallagher wrote: > Hi Alex, > > Look at simple.http.load.ActiveService, it does > exactly what you want. In response to your last > question, I think that offloading the back-end IO to a > non-blocking system would be a win. I see no > difference in a proxy acting as a client versus a > non-proxy server. If you reverse the processing > technique used by Simple I think you would have a very > efficient proxy server. I have thought about such a > proxy server in the past, however I have not had time > to implement it even though I am sure you could modify > simple.http.* to achieve it. > > Hope this helps, > Niall |
From: Niall G. <gal...@ya...> - 2005-05-03 23:54:00
|
Hi Alex, Look at simple.http.load.ActiveService, it does exactly what you want. In response to your last question, I think that offloading the back-end IO to a non-blocking system would be a win. I see no difference in a proxy acting as a client versus a non-proxy server. If you reverse the processing technique used by Simple I think you would have a very efficient proxy server. I have thought about such a proxy server in the past, however I have not had time to implement it even though I am sure you could modify simple.http.* to achieve it. Hope this helps, Niall --- Alex Cruise <al...@cl...> wrote: > Hi there, > > According to my cursory research on the subject, > asynchronous IO is not > seen as a huge win for Java servlet environments, > since any given thread > is generally either waiting in the pool doing > nothing or fully utilized > servicing a servlet request. The only exception > I've seen general > agreement on is that a large number of sockets in > the keepalive state > can be efficiently handled using a smaller number of > threads. > > On the other hand, I'm working on a proxy server > that effectively pauses > a request thread for 5-500 milliseconds while a > backend server does its > own processing. It would be great if I could > somehow take those backend > sockets off the request processing threads' "hands" > and have maybe a > handful of dedicated backend IO threads sending the > backend requests, > waiting for their responses and receiving them. > > So what I'd need would be a way to drop a given > request (with its > associated socket) from the current processing > thread, and pick it up > later on. > > While I'm sure I can accomplish this using a "raw" > NIO implementation, > I'm keen to stand on the shoulders of giants. Is > there anything > resembling what I'm looking for in Simple? If not, > would it be a major > challenge to add it? And last but certainly not > least, am I way > off-base in my assertion that offloading the > back-end IO to a > non-blocking system would be a win? > > Thanks, > > -0xe1a > > > ------------------------------------------------------- > This SF.Net email is sponsored by: NEC IT Guy Games. > Get your fingers limbered up and give it your best > shot. 4 great events, 4 > opportunities to win big! Highest score wins.NEC IT > Guy Games. Play to > win an NEC 61 plasma display. Visit > http://www.necitguy.com/?r=20 > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > Niall Gallagher __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Alex C. <al...@cl...> - 2005-05-03 18:04:15
|
Hi there, According to my cursory research on the subject, asynchronous IO is not seen as a huge win for Java servlet environments, since any given thread is generally either waiting in the pool doing nothing or fully utilized servicing a servlet request. The only exception I've seen general agreement on is that a large number of sockets in the keepalive state can be efficiently handled using a smaller number of threads. On the other hand, I'm working on a proxy server that effectively pauses a request thread for 5-500 milliseconds while a backend server does its own processing. It would be great if I could somehow take those backend sockets off the request processing threads' "hands" and have maybe a handful of dedicated backend IO threads sending the backend requests, waiting for their responses and receiving them. So what I'd need would be a way to drop a given request (with its associated socket) from the current processing thread, and pick it up later on. While I'm sure I can accomplish this using a "raw" NIO implementation, I'm keen to stand on the shoulders of giants. Is there anything resembling what I'm looking for in Simple? If not, would it be a major challenge to add it? And last but certainly not least, am I way off-base in my assertion that offloading the back-end IO to a non-blocking system would be a win? Thanks, -0xe1a |
From: PA <pet...@gm...> - 2005-03-26 17:20:01
|
Hello, Anyone feel like porting this to Simple? :)) http://www.betaversion.org/~pier/wiki/display/pier/ A+simple+approach+to+WebDAV Cheers -- PA, Onnay Equitursay http://alt.textdrive.com/ |
From: Niall G. <gal...@ya...> - 2005-03-23 04:01:32
|
Hi Luce, I think there are several ways to do this, the cleanest of these would be to use the java.util.jar package to examine the contents of the Jar file before locating and extracting the gif image. This is what the Velocity JarResourceLoader uses. I think it would go somting like this: String target = request.getURI(); JarInputStream file = new JarInputStream("site.jar"); while(...){ JarFileEntry entry = file.getNextJarEntry(); if(entry.getName().equals(target)){ file.read(buffer, 0, size); } } That should allow you to read a resource from any Jar file. However, this would almost certainly require a cache if you are going to implement such a Service. Have a look at simple.util.cache.Cache. Also, you might like to try exploding the Jar file into a temporary directory. This is what Tomcat and other Servlet engines do with War files. Finally, I thing this should work: ClassLoader loader = new URLClassLoader(new File("site.jar").toURL()); InputStream stream = loader.getResourceAsStream("image.gif"); Hope this helps. Niall --- Luce Chandon <lu...@se...> wrote: > Hi, > > I was wondering if it is possible to use simpleweb > to retrieve files > located within a jar file. > > I have a jar file (site.jar) which contains numerous > .html and .gif > files. I am able to retrieve the .html files (using > VelocityTemplate) > but cannot work out how to retrieve the .gif files. > > Any help would be appreciated. > > Regards > > Luce > -- > ------------------------------------------------------------------------ > *Semantia Pty Ltd* > PO Box 7301, St Kilda Road > Melbourne, Victoria 3004 > > Tel: + 61 3 9419 9773 > ------------------------------------------------------------------------ > > This email is intended for the use of the individual > or entity named > above and may contain information that is > confidential and privileged. > If you are not the intended recipient you are hereby > notified that any > dissemination, distribution or copying of this email > is strictly > prohibited. If you have received this email in error > please immediately > notify us by return email or telephone +61 3 9419 > 9773 and destroy the > original message. Thank you. > > ------------------------------------------------------------------------ > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT > Products from real users. > Discover which products truly live up to the hype. > Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > Niall Gallagher __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ |
From: Luce C. <lu...@se...> - 2005-03-20 12:44:39
|
Hi, I was wondering if it is possible to use simpleweb to retrieve files located within a jar file. I have a jar file (site.jar) which contains numerous .html and .gif files. I am able to retrieve the .html files (using VelocityTemplate) but cannot work out how to retrieve the .gif files. Any help would be appreciated. Regards Luce -- ------------------------------------------------------------------------ *Semantia Pty Ltd* PO Box 7301, St Kilda Road Melbourne, Victoria 3004 Tel: + 61 3 9419 9773 ------------------------------------------------------------------------ This email is intended for the use of the individual or entity named above and may contain information that is confidential and privileged. If you are not the intended recipient you are hereby notified that any dissemination, distribution or copying of this email is strictly prohibited. If you have received this email in error please immediately notify us by return email or telephone +61 3 9419 9773 and destroy the original message. Thank you. ------------------------------------------------------------------------ |
From: PA <pet...@gm...> - 2005-03-19 08:29:23
|
Hi Niall, On Mar 18, 2005, at 01:35, Niall Gallagher wrote: > I have had a look at you implementation in LUA. Just > wondering, you have taken a different approach on a > few things, any ideas you think might be useful in > Simple? Well, the implementation itself is quite different as the underlying=20 language and VM are very much different. That said, I think that=20 conceptually they are very close. Or to put it another way, Simple is=20 very much the inspiration for LuaWeb :) Both Simple and LuaWeb provides 3 main functionalities as I see it: an=20= event dispatcher, a core HTTP engine and the scaffolding for an app=20 server. Concurrent event dispatching in Lua is handled quite differently than=20 in Simple as Lua provides coroutine instead of threads: "Non-Preemptive Multithreading" http://www.lua.org/pil/9.4.html The end result being somewhat similar to java.nio selectors as well as=20= what Simple itself does: limit the number to threads while keeping=20 concurrency high nonetheless. The HTTP engine itself is quite similar in both implementation:=20 requests, responses, services, etc. In both libraries, an HTTP engine=20 is defined as a set of services which handle a subset of the URL=20 namespace. Finally, there is the app server scaffolding. This is perhaps where=20 Simple and LuaWeb diverge the most. But this is somewhat to be expected=20= as everyone has their own like and dislike about how an app server=20 should behave. Even ZO=CB, while happily using Simple since the summer = of=20 2003, has its own implementation of an app server build on top of=20 Simple itself... Perhaps one thing which would be beneficial though, is to have the=20 Simple HTTP engine emphasize the HTTP methods themselves (e.g. GET vs=20 HEAD vs OPTIONS, etc). For example, in LuaWeb, the default HTTP service implements HEAD in=20 terms of GET. That way all the services can handle a HEAD request=20 out-of-the-box. In contrast, each Simple services has to explicitly=20 switch between the different HTTP methods in their process() method. As=20= an illustration, contrast the implementation of=20 simple.http.serve.FileResource and LWFileService: http://dev.alt.textdrive.com/file/LW/LWFileService.lua The same applies for OPTIONS which is implemented by the default=20 LWService in terms of what HTTP methods a service effectively provides. Emphasizing the HTTP methods upfront provides a nice logical=20 distinction between what your custom service needs to do, as there is=20 no need for conditional execution (e.g. GET vs POST vs DELETE). Most likely there are other differences here and there, but, all in=20 all, I found both library quite similar in purpose if not in execution=20= :) Cheers -- PA, Onnay Equitursay http://alt.textdrive.com/ |
From: Henry V. <hen...@ge...> - 2005-03-18 14:20:40
|
Hi andy i had the same problem a while ago. the solution is to implement a custom mapper and then configure it. Or extends it and when the custom files then redirect to the good class ex. MyCustomMapper implements mapper override or implement the getClass(String target) Then System.setProperty("simple.http.load.mapper", "com.MyCustomMapper"); MapperEngine engine = new MapperEngine(); Connection connection = ConnectionFactory.getConnection(engine); connection.connect(new ServerSocket(8080)); A+ -----Original Message----- From: sim...@li... [mailto:sim...@li...]On Behalf Of Andy Madigan Sent: Thursday, March 17, 2005 10:04 PM To: simpleweb Subject: [Simpleweb-Support] Howto use PatternMapper? I am currently using the following code to run a simple test server: import simple.http.connect.*; import simple.http.serve.*; import simple.http.load.*; import java.net.*; public class TestServer { public static void main(String[] list) throws Exception { MapperEngine engine = new MapperEngine(); Connection connection = ConnectionFactory.getConnection(engine); connection.connect(new ServerSocket(8080)); } } I am wondering how I can tell the MapperEngine to associate *.ssjs with a particular service. I think I would use a PatternMapper for this, but how? I would prefer to do this w/o the use of exernal files (such as a properties file). Mozilla Firefox - Fast, Secure, Powerful Web Browser Get it at www.mozilla.org for Free! Firefox Users - Put Firefox in your tagline/signature! ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: Andy M. <and...@ya...> - 2005-03-18 03:03:46
|
I am currently using the following code to run a simple test server: import simple.http.connect.*; import simple.http.serve.*; import simple.http.load.*; import java.net.*; public class TestServer { public static void main(String[] list) throws Exception { MapperEngine engine = new MapperEngine(); Connection connection = ConnectionFactory.getConnection(engine); connection.connect(new ServerSocket(8080)); } } I am wondering how I can tell the MapperEngine to associate *.ssjs with a particular service. I think I would use a PatternMapper for this, but how? I would prefer to do this w/o the use of exernal files (such as a properties file). Mozilla Firefox - Fast, Secure, Powerful Web Browser Get it at www.mozilla.org for Free! Firefox Users - Put Firefox in your tagline/signature! |
From: Andy M. <and...@ya...> - 2005-03-18 02:55:20
|
Nevermind, 2.5.4 works, no idea why it wouldn't download when I clicked the link before, sry. --- Niall Gallagher <gal...@ya...> wrote: > Hi, > > Strange exception, ill have a look at it in more > detail. If you want to download 2.5.4 then go to the > following URL: > > http://simpleweb.sourceforge.net/download > > I am no longer using the SF download feature as it > requires the use of SSH and FTP. > > My guess is that this is a problem with gij as the > Scheduler is quite heavily tested and has worked since > java 1.2.x. Also the Scheduler is fully thread safe. > > Niall > > > --- Andy Madigan <and...@ya...> wrote: > > I'm trying to run a basic demo server using Simple > > on gij 3.4 (Debian > > Sid BTW). > > > > Here's the code I'm using: > > import simple.http.connect.*; > > import simple.http.serve.*; > > import simple.http.load.*; > > import java.net.*; > > > > public class TestServer { > > > > public static void main(String[] list) throws > > Exception { > > MapperEngine engine = new MapperEngine(new > > FileContext(),new > > java.io.File(".").getCanonicalFile(), null); > > Connection connection = > > ConnectionFactory.getConnection(engine); > > connection.connect(new ServerSocket(8080)); > > } > > } > > > > Note that the MapperEngine constructor call had to > > be changed b/c of an > > apparent quirk in java.io.File in classpath. When I > > run this and try to > > get my browser to connect I get: > > java.lang.IllegalMonitorStateException > > at simple.util.schedule.Scheduler.dequeue > > (Scheduler.java:183) > > at simple.http.Processor.execute > > (Processor.java:110) > > at simple.http.Processor.run (Processor.java:77) > > at java.lang.Thread.run (Thread.java:705) > > at java.lang.VMThread.callRun (VMThread.java:119) > > at java.lang.Thread.callRun (Thread.java:391) > > at java.lang.VirtualMachine.runThread > > (VirtualMachine.java:137) > > > > I tried to download Simple 2.5.4, but it doesn't > > seem to be on SF?? > > > > Mozilla Firefox - Fast, Secure, Powerful Web Browser > > Get it at www.mozilla.org for Free! > > Firefox Users - Put Firefox in your > > tagline/signature! > > > > > > > ------------------------------------------------------- > > SF email is sponsored by - The IT Product Guide > > Read honest & candid reviews on hundreds of IT > > Products from real users. > > Discover which products truly live up to the hype. > > Start reading now. > > > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > > _______________________________________________ > > Simpleweb-Support mailing list > > Sim...@li... > > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > Niall Gallagher > > > > __________________________________ > Do you Yahoo!? > Yahoo! Small Business - Try our new resources site! > http://smallbusiness.yahoo.com/resources/ > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real > users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > Mozilla Firefox - Fast, Secure, Powerful Web Browser Get it at www.mozilla.org for Free! Firefox Users - Put Firefox in your tagline/signature! |
From: Andy M. <and...@ya...> - 2005-03-18 02:40:50
|
I thought it might be a problem in gij, but I get the same error under sablevm, which is supposed to be very good. I thinking that the problem might be in classpath. I just realised that that this error sometimes happens under gij, too (when this error occurs, IllegalMonitorState doesn't). java.lang.NullPointerException at simple.util.schedule.SchedulerQueue.dequeue (SchedulerQueue.java) at simple.util.schedule.Scheduler.dequeue (Scheduler.java:183) at simple.http.Processor.execute (Processor.java:110) at simple.http.Processor.run (Processor.java:77) at java.lang.Thread.run (Thread.java:705) at java.lang.VMThread.callRun (VMThread.java:119) at java.lang.Thread.callRun (Thread.java:391) at java.lang.VirtualMachine.runThread (VirtualMachine.java:137) Note that the error comes from the same method, it definetely looks like a threading problem, but that doesn't mean the problem is in Simple. I'l try 2.5.4. --- Niall Gallagher <gal...@ya...> wrote: > Hi, > > Strange exception, ill have a look at it in more > detail. If you want to download 2.5.4 then go to the > following URL: > > http://simpleweb.sourceforge.net/download > > I am no longer using the SF download feature as it > requires the use of SSH and FTP. > > My guess is that this is a problem with gij as the > Scheduler is quite heavily tested and has worked since > java 1.2.x. Also the Scheduler is fully thread safe. > > Niall > > > --- Andy Madigan <and...@ya...> wrote: > > I'm trying to run a basic demo server using Simple > > on gij 3.4 (Debian > > Sid BTW). > > > > Here's the code I'm using: > > import simple.http.connect.*; > > import simple.http.serve.*; > > import simple.http.load.*; > > import java.net.*; > > > > public class TestServer { > > > > public static void main(String[] list) throws > > Exception { > > MapperEngine engine = new MapperEngine(new > > FileContext(),new > > java.io.File(".").getCanonicalFile(), null); > > Connection connection = > > ConnectionFactory.getConnection(engine); > > connection.connect(new ServerSocket(8080)); > > } > > } > > > > Note that the MapperEngine constructor call had to > > be changed b/c of an > > apparent quirk in java.io.File in classpath. When I > > run this and try to > > get my browser to connect I get: > > java.lang.IllegalMonitorStateException > > at simple.util.schedule.Scheduler.dequeue > > (Scheduler.java:183) > > at simple.http.Processor.execute > > (Processor.java:110) > > at simple.http.Processor.run (Processor.java:77) > > at java.lang.Thread.run (Thread.java:705) > > at java.lang.VMThread.callRun (VMThread.java:119) > > at java.lang.Thread.callRun (Thread.java:391) > > at java.lang.VirtualMachine.runThread > > (VirtualMachine.java:137) > > > > I tried to download Simple 2.5.4, but it doesn't > > seem to be on SF?? > > > > Mozilla Firefox - Fast, Secure, Powerful Web Browser > > Get it at www.mozilla.org for Free! > > Firefox Users - Put Firefox in your > > tagline/signature! > > > > > > > ------------------------------------------------------- > > SF email is sponsored by - The IT Product Guide > > Read honest & candid reviews on hundreds of IT > > Products from real users. > > Discover which products truly live up to the hype. > > Start reading now. > > > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > > _______________________________________________ > > Simpleweb-Support mailing list > > Sim...@li... > > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > Niall Gallagher > > > > __________________________________ > Do you Yahoo!? > Yahoo! Small Business - Try our new resources site! > http://smallbusiness.yahoo.com/resources/ > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real > users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > Mozilla Firefox - Fast, Secure, Powerful Web Browser Get it at www.mozilla.org for Free! Firefox Users - Put Firefox in your tagline/signature! |
From: Niall G. <gal...@ya...> - 2005-03-18 00:57:24
|
Hi, Strange exception, ill have a look at it in more detail. If you want to download 2.5.4 then go to the following URL: http://simpleweb.sourceforge.net/download I am no longer using the SF download feature as it requires the use of SSH and FTP. My guess is that this is a problem with gij as the Scheduler is quite heavily tested and has worked since java 1.2.x. Also the Scheduler is fully thread safe. Niall --- Andy Madigan <and...@ya...> wrote: > I'm trying to run a basic demo server using Simple > on gij 3.4 (Debian > Sid BTW). > > Here's the code I'm using: > import simple.http.connect.*; > import simple.http.serve.*; > import simple.http.load.*; > import java.net.*; > > public class TestServer { > > public static void main(String[] list) throws > Exception { > MapperEngine engine = new MapperEngine(new > FileContext(),new > java.io.File(".").getCanonicalFile(), null); > Connection connection = > ConnectionFactory.getConnection(engine); > connection.connect(new ServerSocket(8080)); > } > } > > Note that the MapperEngine constructor call had to > be changed b/c of an > apparent quirk in java.io.File in classpath. When I > run this and try to > get my browser to connect I get: > java.lang.IllegalMonitorStateException > at simple.util.schedule.Scheduler.dequeue > (Scheduler.java:183) > at simple.http.Processor.execute > (Processor.java:110) > at simple.http.Processor.run (Processor.java:77) > at java.lang.Thread.run (Thread.java:705) > at java.lang.VMThread.callRun (VMThread.java:119) > at java.lang.Thread.callRun (Thread.java:391) > at java.lang.VirtualMachine.runThread > (VirtualMachine.java:137) > > I tried to download Simple 2.5.4, but it doesn't > seem to be on SF?? > > Mozilla Firefox - Fast, Secure, Powerful Web Browser > Get it at www.mozilla.org for Free! > Firefox Users - Put Firefox in your > tagline/signature! > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT > Products from real users. > Discover which products truly live up to the hype. > Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > Niall Gallagher __________________________________ Do you Yahoo!? Yahoo! Small Business - Try our new resources site! http://smallbusiness.yahoo.com/resources/ |
From: Andy M. <and...@ya...> - 2005-03-18 00:44:09
|
I'm trying to run a basic demo server using Simple on gij 3.4 (Debian Sid BTW). Here's the code I'm using: import simple.http.connect.*; import simple.http.serve.*; import simple.http.load.*; import java.net.*; public class TestServer { public static void main(String[] list) throws Exception { MapperEngine engine = new MapperEngine(new FileContext(),new java.io.File(".").getCanonicalFile(), null); Connection connection = ConnectionFactory.getConnection(engine); connection.connect(new ServerSocket(8080)); } } Note that the MapperEngine constructor call had to be changed b/c of an apparent quirk in java.io.File in classpath. When I run this and try to get my browser to connect I get: java.lang.IllegalMonitorStateException at simple.util.schedule.Scheduler.dequeue (Scheduler.java:183) at simple.http.Processor.execute (Processor.java:110) at simple.http.Processor.run (Processor.java:77) at java.lang.Thread.run (Thread.java:705) at java.lang.VMThread.callRun (VMThread.java:119) at java.lang.Thread.callRun (Thread.java:391) at java.lang.VirtualMachine.runThread (VirtualMachine.java:137) I tried to download Simple 2.5.4, but it doesn't seem to be on SF?? Mozilla Firefox - Fast, Secure, Powerful Web Browser Get it at www.mozilla.org for Free! Firefox Users - Put Firefox in your tagline/signature! |
From: Niall G. <gal...@ya...> - 2005-03-18 00:35:42
|
Hi, I have had a look at you implementation in LUA. Just wondering, you have taken a different approach on a few things, any ideas you think might be useful in Simple? Niall --- PA <pet...@gm...> wrote: > > On Mar 17, 2005, at 04:37, Niall Gallagher wrote: > > > I am currently working on a demonstration package > and an improved > > introduction so that users can get a server up and > running much > > easier. > > Talking of which, albeit slightly off-topic, I'm > somewhat > re-implementing simple-core in Lua [1]. > > Here is a brief illustration: > > -- create the application server > local anApplication = LWApplication.new( "*", 1080 ) > > -- register a service > anApplication.registerService( > LWDirectoryService.new( "/prefix/", > "/Directory/Path" ) ) > > -- start the application > anApplication.start() > > As easy as 123 :) > > Gory details available online: > > http://dev.alt.textdrive.com/browser/LW/ > > As well as a short introduction to Lua: > > http://alt.textdrive.com/lua/19/lua-story-of-o > > Cheers > > -- > PA, Onnay Equitursay > http://alt.textdrive.com/ > > [1] http://www.lua.org/about.html > > > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT > Products from real users. > Discover which products truly live up to the hype. > Start reading now. > http://ads.osdn.com/?ad_ide95&alloc_id396&op=click > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > Niall Gallagher __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Niall G. <ni...@em...> - 2005-03-18 00:26:29
|
<P>Hi,</P> <P>Here is the JAR file for Mamba 1.1.4. To view the source, simply extract= the jar file using the following command:</P> <P>jar xvf mamba-1.1.4.jar</P> <P>Niall</P> <P> </P> <P><BR><BR>----- Original Message -----<BR>From: sszretter <SSZRETTER@HOTMA= IL.COM><BR>To: sim...@li...<BR>Subject: Re: [Sim= pleweb-Support] simple server, mamba<BR>Date: Thu, 17 Mar 2005 06:25:44 -05= 00<BR><BR></P> <STYLE type=3Dtext/css><!-- blockquote, dl, ul, ol, li { padding-top: 0 ; padding-bottom: 0 } --></STYLE> <DIV><BR></DIV> <DIV>Yes,</DIV> <DIV><BR></DIV> <DIV>Please email, that is great!</DIV> <DIV>Thanks!</DIV> <DIV>Scott</DIV> <DIV><BR></DIV> <BLOCKQUOTE cite=3D"" type=3D"cite">Hi,<BR></BLOCKQUOTE> <BLOCKQUOTE cite=3D"" type=3D"cite">Yes, the Mamba standalonbe sever uses S= imple 2.4. However if you would like i can email you a server implementatio= n that uses the latest version of Simple that can use templates and session= s. I am currently working on a demonstration package and an improved introd= uction so that users can get a server up and running much easier. Let = me know if you would like me to email the server implementation to you.<BR>= </BLOCKQUOTE> <BLOCKQUOTE cite=3D"" type=3D"cite">Niall<BR></BLOCKQUOTE> <DIV><BR><BR></DIV> <DIV><TT>-- </TT></DIV> <DIV>cool software and services: www.eesco.com</DIV><BR> --=20 <p>___________________________________________________________<br>Sign-up f= or Ads Free at Mail.com<br> <a href=3D"http://mail01.mail.com/scripts/payment/adtracking.cgi?bannercode= =3Dadsfreejump01" target=3D"_blank">http://www.mail.com/?sr=3Dsignup</a></p> |
From: PA <pet...@gm...> - 2005-03-17 11:49:21
|
On Mar 17, 2005, at 04:37, Niall Gallagher wrote: > I am currently working on a demonstration package and an improved=20 > introduction so that users=A0can get a server up and running much=20 > easier. Talking of which, albeit slightly off-topic, I'm somewhat=20 re-implementing simple-core in Lua [1]. Here is a brief illustration: -- create the application server local anApplication =3D LWApplication.new( "*", 1080 ) -- register a service anApplication.registerService( LWDirectoryService.new( "/prefix/",=20 "/Directory/Path" ) ) -- start the application anApplication.start() As easy as 123 :) Gory details available online: http://dev.alt.textdrive.com/browser/LW/ As well as a short introduction to Lua: http://alt.textdrive.com/lua/19/lua-story-of-o Cheers -- PA, Onnay Equitursay http://alt.textdrive.com/ [1] http://www.lua.org/about.html |
From: sszretter <ssz...@ho...> - 2005-03-17 11:26:04
|
Yes, Please email, that is great! Thanks! Scott >Hi, > >Yes, the Mamba standalonbe sever uses Simple 2.4. However if you >would like i can email you a server implementation that uses the >latest version of Simple that can use templates and sessions. I am >currently working on a demonstration package and an improved >introduction so that users can get a server up and running much >easier. Let me know if you would like me to email the server >implementation to you. > >Niall > -- cool software and services: www.eesco.com |
From: PA <pet...@gm...> - 2005-03-17 10:27:55
|
On Mar 16, 2005, at 17:55, sszretter wrote: > I am mainly interested in creating a stand alone java app that serves=20= > up static pages and images from the hard disk, as well as objects that=20= > produce html output. Simple sounds like it does this, but is for me=20= > just missing the stand-alone app framework... If you are interested in perusing a full blown application which uses=20 simple-core quite extensively, that a look at ZO=CB: http://zoe.nu/ Mandatory screenshots: http://zoe.nu/itstories/story.php?data=3Dstories&num=3D23&sec=3D2 Source code related to simple-core: http://dev.alt.textdrive.com/browser/ZOE/Applications/ZOE/ http://dev.alt.textdrive.com/browser/ZOE/Frameworks/SZApp/ Cheers -- PA, Onnay Equitursay http://alt.textdrive.com/ |
From: Niall G. <ni...@em...> - 2005-03-17 03:37:27
|
<P>Hi,</P> <P>Yes, the Mamba standalonbe sever uses Simple 2.4. However if you would l= ike i can email you a server implementation that uses the latest version of= Simple that can use templates and sessions. I am currently working on a de= monstration package and an improved introduction so that users can get= a server up and running much easier. Let me know if you would like me to e= mail the server implementation to you.</P> <P>Niall</P> <P><BR><BR>----- Original Message -----<BR>From: sszretter <SSZRETTER@HOTMA= IL.COM><BR>To: sim...@li...<BR>Subject: [Simplew= eb-Support] simple server, mamba<BR>Date: Wed, 16 Mar 2005 11:55:34 -0500<B= R><BR></P> <STYLE type=3Dtext/css><!-- blockquote, dl, ul, ol, li { padding-top: 0 ; padding-bottom: 0 } --></STYLE> <DIV>I am interested in using the Simple engine to serve pages and objects,= but need a starting point. I checked out the mamba engine that uses = Simple, but it uses version 2.4 of Simple. Mamba is probably ac= ceptable if it could use the latest Simple, OR maybe someone has another su= ggestion??</DIV> <DIV><BR></DIV> <DIV>I am mainly interested in creating a stand alone java app that serves = up static pages and images from the hard disk, as well as objects that prod= uce html output. Simple sounds like it does this, but is for me just = missing the stand-alone app framework...</DIV> <DIV><BR></DIV> <DIV><BR></DIV> <DIV><TT>-- </TT></DIV> <DIV>cool software and services: www.eesco.com</DIV><BR> --=20 <p>___________________________________________________________<br>Sign-up f= or Ads Free at Mail.com<br> <a href=3D"http://mail01.mail.com/scripts/payment/adtracking.cgi?bannercode= =3Dadsfreejump01" target=3D"_blank">http://www.mail.com/?sr=3Dsignup</a></p> |
From: sszretter <ssz...@ho...> - 2005-03-16 16:55:52
|
I am interested in using the Simple engine to serve pages and objects, but need a starting point. I checked out the mamba engine that uses Simple, but it uses version 2.4 of Simple. Mamba is probably acceptable if it could use the latest Simple, OR maybe someone has another suggestion?? I am mainly interested in creating a stand alone java app that serves up static pages and images from the hard disk, as well as objects that produce html output. Simple sounds like it does this, but is for me just missing the stand-alone app framework... -- cool software and services: www.eesco.com |
From: Niall G. <ni...@em...> - 2005-02-27 11:55:06
|
Hello All, I have relased version 2.5.4, which contains a minor bug fix and performanc= e enhancements for Groovy templates. Niall --=20 ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm |
From: Niall G. <ni...@em...> - 2005-02-27 11:53:20
|
Hi David, As far as the implementation of Simple goes, the InetAddress is acquired fr= om the Socket.getInetAddress. There are no modifications and I am pretty su= re that it works correctly. It might be worth you while writing a ProtocolH= andler that dumps the HTTP messages to a file, this way you can check to se= e if a proxy is being used.=20 Niall ----- Original Message ----- From: "David Flanagan" <da...@da...> To: sim...@li... Subject: [Simpleweb-Support] bad addresses from Request.getInetAddress() Date: Wed, 23 Feb 2005 15:47:32 -0800 >=20 > Hi Niall (or other Simple users), >=20 > I'm using Simple inside an application that restricts incoming IP=20 > addresses, typically by calling=20 > Request.getInetAddress().isSiteLocalAddress(). >=20 > One of my users is reporting that occasionally they get a message=20 > from my application saying: >=20 > Cannot connect: Host /46.9.155.1 is not licensed. >=20 > Another time it happened with 46.1.5.3 >=20 > I have no idea where these 46.x.x.x addresses are coming from.=20 > According to whois, the whole address block is reserved. I'm not a=20 > networking expert, and neither is my user, so I don't know if their=20 > site has some kind of proxy or firewall or router that uses the=20 > 46.x.x.x address block. >=20 > Or, is there any kind of known bug with Request.getInetAddress()?=20=20 > Could it be that Simple is sometimes returning a bad address? >=20 > Thanks for any insight you have, >=20 > David Flanagan >=20 >=20 > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=3D6595&alloc_id=3D14396&op=3Dclick > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support --=20 ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm |
From: Henry V. <hen...@ge...> - 2005-02-25 16:41:07
|
Ok found out how.... extends ReflectionService and have custom prepare method public void prepare(CustomContainer container) { logger.debug("hello world " + container ); } when the engine is prepared MapperEngine engine = new MapperEngine(new FileContext(),new CustomContainer()); A+ -----Original Message----- From: sim...@li... [mailto:sim...@li...]On Behalf Of Henry Voyer Sent: Friday, February 25, 2005 10:14 AM To: sim...@li... Subject: RE: [Simpleweb-Support] How to pass information to BasicService? hi Cristophe. Thanks for answering. Im more interested in the first answer. But Where do you instanciate your custom context to pass it in the prepare? Wich class is the one i have to implement for the interception and how to configure it? Merci -----Original Message----- From: sim...@li... [mailto:sim...@li...]On Behalf Of Christophe Roudet Sent: Thursday, February 24, 2005 5:31 PM To: sim...@li... Subject: RE: [Simpleweb-Support] How to pass information to BasicService? May be you can override the prepare method in BasicService And use the passed Object. public void prepare(LoaderEngine engine, Object data) { this.myContext = (MyContext) data; } public void process(Request req, Response resp) throws Exception { ... myContext.getXXX(); ... } Or you can create a custom PipelineFactory and set some attributes: public class CustomPipelineFactory extends BufferedPipelineFactory { // ============ // Contructors // ============ public CustomPipelineFactory() { super(); } public CustomPipelineFactory(int size) { super(size); } // =============== // Public method // =============== public Pipeline getInstance(Socket sock) throws IOException { Pipeline pipe = super.getInstance(sock); // sets some attributes pipe.setAttribute("port", new Integer(sock.getPort())); pipe.setAttribute("localPort", new Integer(sock.getLocalPort())); pipe.setAttribute("socket", sock); ... return pipe; } } In your Service: public void process(Request req, Response resp) throws Exception { Attributes attrs = req.getAttributes(); int port = ((Integer) attrs.getAttribute("port")).intValue(); int localPort = ((Integer) attrs.getAttribute("localPort")).intValue(); ... } To set up simpleweb: PipelineFactory pipelineFactory = new CustomPipelineFactory(bufferSize); Connection network = ConnectionFactory.getConnection(myhandler, pipelineFactory); network.connect(new ServerSocket(port)); Christophe > -----Original Message----- > From: sim...@li... [mailto:simpleweb- > sup...@li...] On Behalf Of Henry Voyer > Sent: Thursday, February 24, 2005 4:59 PM > To: sim...@li... > Subject: [Simpleweb-Support] How to pass information to BasicService? > > Hi everyone. > > Is there a Simple way to pass custom information to a BasicService ? > > My container has some information that i would like to pass everytime a > custom BasicService is called. > I know i can use a singleton for this, but i want a more clean > implementation. > > Any idea how to acheive this ? > > Regards. > > henry > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: Henry V. <hen...@ge...> - 2005-02-25 15:14:17
|
hi Cristophe. Thanks for answering. Im more interested in the first answer. But Where do you instanciate your custom context to pass it in the prepare? Wich class is the one i have to implement for the interception and how to configure it? Merci -----Original Message----- From: sim...@li... [mailto:sim...@li...]On Behalf Of Christophe Roudet Sent: Thursday, February 24, 2005 5:31 PM To: sim...@li... Subject: RE: [Simpleweb-Support] How to pass information to BasicService? May be you can override the prepare method in BasicService And use the passed Object. public void prepare(LoaderEngine engine, Object data) { this.myContext = (MyContext) data; } public void process(Request req, Response resp) throws Exception { ... myContext.getXXX(); ... } Or you can create a custom PipelineFactory and set some attributes: public class CustomPipelineFactory extends BufferedPipelineFactory { // ============ // Contructors // ============ public CustomPipelineFactory() { super(); } public CustomPipelineFactory(int size) { super(size); } // =============== // Public method // =============== public Pipeline getInstance(Socket sock) throws IOException { Pipeline pipe = super.getInstance(sock); // sets some attributes pipe.setAttribute("port", new Integer(sock.getPort())); pipe.setAttribute("localPort", new Integer(sock.getLocalPort())); pipe.setAttribute("socket", sock); ... return pipe; } } In your Service: public void process(Request req, Response resp) throws Exception { Attributes attrs = req.getAttributes(); int port = ((Integer) attrs.getAttribute("port")).intValue(); int localPort = ((Integer) attrs.getAttribute("localPort")).intValue(); ... } To set up simpleweb: PipelineFactory pipelineFactory = new CustomPipelineFactory(bufferSize); Connection network = ConnectionFactory.getConnection(myhandler, pipelineFactory); network.connect(new ServerSocket(port)); Christophe > -----Original Message----- > From: sim...@li... [mailto:simpleweb- > sup...@li...] On Behalf Of Henry Voyer > Sent: Thursday, February 24, 2005 4:59 PM > To: sim...@li... > Subject: [Simpleweb-Support] How to pass information to BasicService? > > Hi everyone. > > Is there a Simple way to pass custom information to a BasicService ? > > My container has some information that i would like to pass everytime a > custom BasicService is called. > I know i can use a singleton for this, but i want a more clean > implementation. > > Any idea how to acheive this ? > > Regards. > > henry > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support |