simpleweb-support Mailing List for Simple (Page 32)
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: Henry V. <hen...@ge...> - 2005-02-25 14:35:46
|
Thanks a lot Niel Your help has been great and apreciated. In the same context, wich object i must implement to intercept the Service.prepare(LoaderEngine, Object) to pass my custom configs specialy = for reflective services? Can you give me an example? Merci beaucoup. -----Original Message----- From: sim...@li... [mailto:sim...@li...]On Behalf Of Niall Gallagher Sent: Friday, February 25, 2005 2:28 AM To: sim...@li... Subject: Re: [Simpleweb-Support] How to pass information to BasicService? Hi Henry, The Service method has a prepare(LoaderEngine, Object) method. You can pa= ss anything you like as that Object. A good Service implementation to look a= t subclassing would be the ReflectionService object. Here you can pass any object you would like as an initialization parameter. If this method does not suit, consider using a ProtocolHandler to populate the Session used b= y the Request the Service can then check the session for your properties. Example code could be: class MyService extends ReflectionService { public void prepare(Map data) { // do somthing with properties } public void process(Request req, Response resp) throws Exception { // use the initialization parameters here } } Niall ----- Original Message ----- From: "Henry Voyer" <hen...@ge...> To: sim...@li... Subject: [Simpleweb-Support] How to pass information to BasicService? Date: Thu, 24 Feb 2005 16:58:58 -0500 > > 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=3D6595&alloc_id=3D14396&op=3Dclick > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support -- ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm ------------------------------------------------------- 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_id=14396&op=3Dick _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: Niall G. <ni...@em...> - 2005-02-25 07:28:00
|
Hi Henry, The Service method has a prepare(LoaderEngine, Object) method. You can pass= anything you like as that Object. A good Service implementation to look at= subclassing would be the ReflectionService object. Here you can pass any o= bject you would like as an initialization parameter. If this method does no= t suit, consider using a ProtocolHandler to populate the Session used by th= e Request the Service can then check the session for your properties. Examp= le code could be: class MyService extends ReflectionService { public void prepare(Map data) { // do somthing with properties } public void process(Request req, Response resp) throws Exception { // use the initialization parameters here } } Niall ----- Original Message ----- From: "Henry Voyer" <hen...@ge...> To: sim...@li... Subject: [Simpleweb-Support] How to pass information to BasicService? Date: Thu, 24 Feb 2005 16:58:58 -0500 >=20 > Hi everyone. >=20 > Is there a Simple way to pass custom information to a BasicService ? >=20 > 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. >=20 > Any idea how to acheive this ? >=20 > Regards. >=20 > henry >=20 >=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: Christophe R. <cr...@ac...> - 2005-02-24 22:30:02
|
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 |
From: Henry V. <hen...@ge...> - 2005-02-24 21:59:12
|
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 |
From: PA <pet...@gm...> - 2005-02-24 00:00:10
|
On Feb 24, 2005, at 00:47, David Flanagan wrote: > I'm using Simple inside an application that restricts incoming IP > addresses, typically by calling > Request.getInetAddress().isSiteLocalAddress(). Hmmm... using IPv4 addresses for checking anything is very much unreliable for anything outside of a local subnet... and even then... java.net.InetAddress works as expected. But perhaps you are excepting too much of it considering what IPv4 can or cannot do in practice. In a nutshell, you cannot identify anything consistently with just an IPv4 address. Perhaps you should reconsider your filtering scheme altogether. Cheers -- PA, Onnay Equitursay http://alt.textdrive.com/ |
From: David F. <da...@da...> - 2005-02-23 23:47:44
|
Hi Niall (or other Simple users), I'm using Simple inside an application that restricts incoming IP addresses, typically by calling Request.getInetAddress().isSiteLocalAddress(). One of my users is reporting that occasionally they get a message from my application saying: Cannot connect: Host /46.9.155.1 is not licensed. Another time it happened with 46.1.5.3 I have no idea where these 46.x.x.x addresses are coming from. According to whois, the whole address block is reserved. I'm not a networking expert, and neither is my user, so I don't know if their site has some kind of proxy or firewall or router that uses the 46.x.x.x address block. Or, is there any kind of known bug with Request.getInetAddress()? Could it be that Simple is sometimes returning a bad address? Thanks for any insight you have, David Flanagan |
From: Henry V. <hen...@ge...> - 2005-02-22 16:18:23
|
Just an update. to use your own mapper System.setProperty("simple.http.load.mapper", "com.my.Test.CustomMapper"); MapperEngine engine =3D new MapperEngine(); ProtocolHandler handler =3D HandlerFactory.getInstance(engine); Connection connection =3D ConnectionFactory.getConnection(handler); connection.connect(new ServerSocket(80)); The mapper must have the following constructor public CustomMapperMapper(Context context) Hope this helps other peoples. Regards. -----Original Message----- From: sim...@li... [mailto:sim...@li...]On Behalf Of Henry Voyer Sent: Tuesday, February 22, 2005 9:34 AM To: sim...@li... Subject: RE: [Simpleweb-Support] Whats the best way to use the mapper? Hi and thanks for the answer. Right now im really confused to how to set the mapper to my engine. EX MapperEngine engine =3D new MapperEngine(); // Where do i set the PrefixMapper to my engine ???? ProtocolHandler handler =3D HandlerFactory.getInstance(engine); Connection connection =3D ConnectionFactory.getConnection(handler); connection.connect(new ServerSocket(80)); thanks Henry -----Original Message----- From: sim...@li... [mailto:sim...@li...]On Behalf Of Niall Gallagher Sent: Tuesday, February 22, 2005 1:48 AM To: sim...@li... Subject: Re: [Simpleweb-Support] Whats the best way to use the mapper? Hi Henry, To take the mapping from a file have a look at the PrefixMapper or the PatternMapper. Both of these take the mappings from a file. They are loca= ted in the package simple.http.load and rely on a mapper.properties file to acquire mappings. Niall ----- Original Message ----- From: "Henry Voyer" <hen...@ge...> To: sim...@li... Subject: [Simpleweb-Support] Whats the best way to use the mapper? Date: Mon, 21 Feb 2005 17:27:28 -0500 > > Hi everyone > > im trying to use a custom mapper that reads the mapping from a file. > Is there an example or a way to simply to this? > > Regards and thanks > > 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=3D6595&alloc_id=3D14396&op=3Dclick > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support -- ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm ------------------------------------------------------- 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_id=14396&op=3Dick _______________________________________________ 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_ide95&alloc_id=14396&op=3Dick _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: Henry V. <hen...@ge...> - 2005-02-22 14:34:05
|
Hi and thanks for the answer. Right now im really confused to how to set the mapper to my engine. EX MapperEngine engine =3D new MapperEngine(); // Where do i set the PrefixMapper to my engine ???? ProtocolHandler handler =3D HandlerFactory.getInstance(engine); Connection connection =3D ConnectionFactory.getConnection(handler); connection.connect(new ServerSocket(80)); thanks Henry -----Original Message----- From: sim...@li... [mailto:sim...@li...]On Behalf Of Niall Gallagher Sent: Tuesday, February 22, 2005 1:48 AM To: sim...@li... Subject: Re: [Simpleweb-Support] Whats the best way to use the mapper? Hi Henry, To take the mapping from a file have a look at the PrefixMapper or the PatternMapper. Both of these take the mappings from a file. They are loca= ted in the package simple.http.load and rely on a mapper.properties file to acquire mappings. Niall ----- Original Message ----- From: "Henry Voyer" <hen...@ge...> To: sim...@li... Subject: [Simpleweb-Support] Whats the best way to use the mapper? Date: Mon, 21 Feb 2005 17:27:28 -0500 > > Hi everyone > > im trying to use a custom mapper that reads the mapping from a file. > Is there an example or a way to simply to this? > > Regards and thanks > > 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=3D6595&alloc_id=3D14396&op=3Dclick > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support -- ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm ------------------------------------------------------- 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_id=14396&op=3Dick _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: Niall G. <ni...@em...> - 2005-02-22 06:52:03
|
Hi, Here I am assuming that you are talking about the transfer encoding. Simple= will by default use chunked transfer encoding unless the request is made u= sing HTTP/1.0 or less. For HTTP/1.1 encodings if you specify the content le= ngth the message body will not be encoded also if you specify a Connection = header with the close token then the message will remain unencoded, however= this will close the pipeline. You can specify the encoding using the Response.set methods to set any of t= he following: Connection: close Content-Length: <number> Transfer-Encoding: chunked Regards, Niall ----- Original Message ----- From: "Henry Voyer" <hen...@ge...> To: sim...@li... Subject: [Simpleweb-Support] SimpleWeb and encoding Date: Mon, 21 Feb 2005 16:33:44 -0500 >=20 > Hi everyone >=20 > im looking into this web server and im curious about how the encoding is > managed. >=20 > Is there a way to set the default encoding or it does a passthrought ? >=20 > Thanks >=20 > henry >=20 >=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: Niall G. <ni...@em...> - 2005-02-22 06:47:49
|
Hi Henry, To take the mapping from a file have a look at the PrefixMapper or the Patt= ernMapper. Both of these take the mappings from a file. They are located in= the package simple.http.load and rely on a mapper.properties file to acqui= re mappings. Niall ----- Original Message ----- From: "Henry Voyer" <hen...@ge...> To: sim...@li... Subject: [Simpleweb-Support] Whats the best way to use the mapper? Date: Mon, 21 Feb 2005 17:27:28 -0500 >=20 > Hi everyone >=20 > im trying to use a custom mapper that reads the mapping from a file. > Is there an example or a way to simply to this? >=20 > Regards and thanks >=20 > henry >=20 >=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-21 22:27:39
|
Hi everyone im trying to use a custom mapper that reads the mapping from a file. Is there an example or a way to simply to this? Regards and thanks henry |
From: Henry V. <hen...@ge...> - 2005-02-21 21:33:57
|
Hi everyone im looking into this web server and im curious about how the encoding is managed. Is there a way to set the default encoding or it does a passthrought ? Thanks henry |
From: PA <pet...@gm...> - 2005-01-10 11:18:59
|
On Jan 07, 2005, at 07:49, Niall Gallagher wrote: > Documentation is shmthing that I have spent little time on Talking of documentation... this is perhaps something which might interest you: "dydoc is a toolkit for generating API documentation from jar files." http://alt.textdrive.com/dydoc/ Cheers, PA. |
From: Michael \Luni\ L. <lun...@ya...> - 2005-01-07 19:42:33
|
Niall, The diagram is great. Thanks. Luni --- Niall Gallagher <ni...@em...> wrote: > Hi, > > > Where's the rest of the tutorial? > > Documentation is shmthing that I have spent little time on, I > really should improve the tutorial. However, with time > constraints it is difficult. Especially since everything is > second nature to me, its hard to be objective and write from > the perspective of a user. If you have any ideas or material > you would like to contribute I will make sure to include them. > > > You should copy the example off of Brian's blog. I doubt > it's > > just me, but as Simple is an embeddable server, my goal is > to > > embed it into my application. Which means that my services > will > > be encluded in the same .jar as the rest of the application. > > And that just doesn't seem to work with a MapperEngine. > > You can do this by extending the MapperEngine and providing > the name of the JAR archive as the file classpath. This should > be fairly easy to do. Have a look at > MapperEngine(Context,File) or perhaps LoaderEngine(Context, > URL[]) if you wish to bypass mapping altogether. > > > The basic issue is that Simple is designed around a bunch of > > Factories, Engines, Managers, Contexts, and Services. I > can't > > tell what each of these types is supposed to be doing to a > > request. The javadoc isn't clear. Perhaps an annotated > diagram > > would clear up how all these classes fit together. It seems > > very powerful and incredibly flexible, if only I could > > understand the architecture as well as the author. > > Try this diagram: > > http://simpleweb.sourceforge.net/images/design.gif > > Niall > > > Michael Libes > > > > > > > > ------------------------------------------------------- > > 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://productguide.itmanagersjournal.com/ > > _______________________________________________ > > Simpleweb-Support mailing list > > Sim...@li... > > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > -- > ___________________________________________________________ > Sign-up for Ads Free at Mail.com > http://promo.mail.com/adsfreejump.htm > > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from > ThinkGeek. > It's fun and FREE -- well, > almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > |
From: Michael \Luni\ L. <lun...@ya...> - 2005-01-07 19:41:03
|
Niall, OK. Can you provide the code snippet that would be used in place of implementing getPath()? Note that I'm running a patched version of Simple, where I implemented getPath() in http.RequestParser. It's a rather small change, costing one field (Token path), two methods (getPath and createPath), and one extra pass through the URI to find any '?' (which could be optimized within the logic which calculates uri.off and uri.len). Luni --- Niall Gallagher <ni...@em...> wrote: > Hi > > > The Request.getParameters() method returns the query > parameters of a > > request. And the getURI() method returns the complete URI. > But there > > is no method to reutrn just the path portion of he request: > the URI > > minus the parameters. I think this would be a useful thing > to add. > > I have done this because typically the Context.getRequestPath > can retrieve the path information. Also this allows a Context > to perform URI to path resolutions, if desired by an > implementation. However, although not very convinient you can > use the simple.util.parse.URIParser (much faster than the > java.net.URI) to extract all the information you could > possibly want, and the implementation is very fast, even for > very complex URI's with encoding in chinese or other such > URI's which need to be heavily encoded in UTF. > > Niall > -- > ___________________________________________________________ > Sign-up for Ads Free at Mail.com > http://promo.mail.com/adsfreejump.htm > > > > ------------------------------------------------------- > The SF.Net email is sponsored by: Beat the post-holiday blues > Get a FREE limited edition SourceForge.net t-shirt from > ThinkGeek. > It's fun and FREE -- well, > almost....http://www.thinkgeek.com/sfshirt > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > |
From: Niall G. <ni...@em...> - 2005-01-07 06:49:34
|
Hi, > Where's the rest of the tutorial? Documentation is shmthing that I have spent little time on, I really should= improve the tutorial. However, with time constraints it is difficult. Espe= cially since everything is second nature to me, its hard to be objective an= d write from the perspective of a user. If you have any ideas or material y= ou would like to contribute I will make sure to include them. > You should copy the example off of Brian's blog. I doubt it's > just me, but as Simple is an embeddable server, my goal is to > embed it into my application. Which means that my services will > be encluded in the same .jar as the rest of the application. > And that just doesn't seem to work with a MapperEngine. You can do this by extending the MapperEngine and providing the name of the= JAR archive as the file classpath. This should be fairly easy to do. Have = a look at MapperEngine(Context,File) or perhaps LoaderEngine(Context, URL[]= ) if you wish to bypass mapping altogether. > The basic issue is that Simple is designed around a bunch of > Factories, Engines, Managers, Contexts, and Services. I can't > tell what each of these types is supposed to be doing to a > request. The javadoc isn't clear. Perhaps an annotated diagram > would clear up how all these classes fit together. It seems > very powerful and incredibly flexible, if only I could > understand the architecture as well as the author. Try this diagram: http://simpleweb.sourceforge.net/images/design.gif Niall =20 > Michael Libes >=20 >=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://productguide.itmanagersjournal.com/ > _______________________________________________ > 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: Niall G. <ni...@em...> - 2005-01-07 06:40:39
|
Hi, > There are two Delgate classes. "simple.http.session.Delegate" > and "simple.template.Delegate" The first is an Session > subclass, the second a Environment subclass. Yes, this is a design pattern I use to describe somthing that is used as a = delegate. It should not be used or viewed, it should also have package scop= e. > There are two DocumentFactory classes. One for Velocity > templates and another for Groovy templates. I suppose few > people will use both... Yes, again these should be hidden from general use. > There are two Maintainer.java's. > "simple.http.session.Maintainer" and > "simple.template.Maintainer" The first is an interface, the > second a subclass Thread and implementor of Monitor. >=20 > There are three Monitor.java's. "simple.util.lease.Monitor", > "simple.template.Monitor", and "simple.http.Monitor". The first > two are interfaces, the third a class that implements > "InputMonitor" and "OutputMonitor". >=20 > There are four Processor classes, three ProxyOutputStream > classes, three Registry classes, and two Resolver classes. >=20 > In almost all these cases, the duplicates are not public classes > and interfaces. However, having duplicate names is one of the > reasons I (and others) are having such a hard time getting > Simple up and running. I'm now wondering how many times > yesterday I looked at the wrong class when reading through the > code. >=20 > Perhaps using the old "I" prefix on interfaces would be a good > first step to making the code more obvious. Then a few more > description terms as suffixes on these duplicate names. And > then perhaps simple.http.io, simple.httpd.load.map and > simple.httpd.load.rmi sub-packages to help separate the classes > further into functions. Point taken, I generally tend to reuse names that I like and am farmiliar w= ith. Hopefully these should be hidden from general use. I will make a note = of this in future if people are finding it confusing. Niall --=20 ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm |
From: Niall G. <ni...@em...> - 2005-01-07 06:36:25
|
Hi > The Request.getParameters() method returns the query parameters of a > request. And the getURI() method returns the complete URI. But there > is no method to reutrn just the path portion of he request: the URI > minus the parameters. I think this would be a useful thing to add. I have done this because typically the Context.getRequestPath can retrieve = the path information. Also this allows a Context to perform URI to path res= olutions, if desired by an implementation. However, although not very convi= nient you can use the simple.util.parse.URIParser (much faster than the jav= a.net.URI) to extract all the information you could possibly want, and the = implementation is very fast, even for very complex URI's with encoding in c= hinese or other such URI's which need to be heavily encoded in UTF. Niall --=20 ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm |
From: Niall G. <ni...@em...> - 2005-01-07 06:30:29
|
Hi David, =20 > I'd like to request a convenience method for issuing HTTP redirects. > Something like Response.redirect(String url). Sounds like a good idea, I will consider it for the next release, which I h= ope will be soon. > Have you made the conscious choice to require knowledge of the HTTP > protocol in order to use Simple effectively? Or do you plan to add > convenience methods for querying things like referrers and performing > common techniques like redirecting responses? The thing is, is that the more convenience methods you add the more complic= ated things get. It was my intention to add only the methods required, with= a few commonly required conveniences. > Finally, I can't tell from the Response javadoc whether I can just call > commit() after setting my redirect headers, or whether I need to call > getOutputStream().close() to send the response along with an empty > response body. Perhaps you could clarify this. You must always close the OutputStream, I have thought about adding another= convenience method like Response.close which would replace the Response.ge= tOutputStream.close. If I get around to it I will add it. The reason the Se= rvice has to explicitly close the stream is because this is the only way as= ynchronous/parallell processing of requests on the same HTTP pipeline can b= e achieved, such features are very useful for heavily loaded servers perfor= ming database operations or for proxying to another HTTP server for a respo= nse.=20 =20 Niall --=20 ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm |
From: David F. <da...@da...> - 2004-12-28 19:20:57
|
Hi, I'd like to request a convenience method for issuing HTTP redirects. Something like Response.redirect(String url). In general, the Request and Response interfaces seem to fully capture the power of the HTTP protocol, but using them requires knowledge of that protocol. So far, I've had to refer to the protocol twice now: to find the spelling of the Referer field and to look up the 302 redirect response code and the Location header. Have you made the conscious choice to require knowledge of the HTTP protocol in order to use Simple effectively? Or do you plan to add convenience methods for querying things like referrers and performing common techniques like redirecting responses? Finally, I can't tell from the Response javadoc whether I can just call commit() after setting my redirect headers, or whether I need to call getOutputStream().close() to send the response along with an empty response body. Perhaps you could clarify this. Thanks, David Flanagan |
From: Michael \Luni\ L. <lun...@ya...> - 2004-12-23 23:10:32
|
David, Ah yes, the getURI() in the sample code doesn't work once a query string is appened to the request. I added getPath() into the four files enclosed. Michael --- David Flanagan <da...@da...> wrote: > > The Request.getParameters() method returns the query > parameters of a > request. And the getURI() method returns the complete URI. > But there > is no method to reutrn just the path portion of he request: > the URI > minus the parameters. I think this would be a useful thing to > add. > > David Flanagan > > > ------------------------------------------------------- > 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://productguide.itmanagersjournal.com/ > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > |
From: Michael \Luni\ L. <lun...@ya...> - 2004-12-23 22:42:42
|
--- "Michael \"Luni\" Libes" <lun...@ya...> wrote: > Where's the rest of the tutorial? The enclosed source code is based on David Flanagan's efforts at a) getting Simple up and running, and b) serving both dynamic and static content from the same "Engine". 1. Throw this into the Simple/source tree 2. 'cd' to your Simple directory 3. run 'ant all' 4. run 'java -cp jar\simple-2.5.3.jar simple.sample.Application 8080 .' 5. Fire up a browser and go visit 'http://127.0.0.1:8080/'. This will run the simple.sample.HttpService code. 6. Visit 'http://127.0.0.1:8080/img.gif'. This will run the simple.sample.ImageService code (which will return a blank/invalid image). 7. Visit 'http://127.0.0.1:8080/file/build.xml'. This will load the build.xml file from the current directory. Note that the prefix '/file' is stripped off the request. This sample code skips the complexity of MapperEnginer and LoaderEngine, plus it hides the complexity of FileEngine. Intead, it creates a new subclass of ProtocolHandler which like LoaderEngine, uses simple.util.Resolver to match patterns with Services. Unlike the existing Simple Engine's, the Service classes are expected to be included within the application. If you need dynamically loaded Services, then add a MappingEngine into the RequestHandler like the FileEngine. Set the appropriate pattern (e.g. '*.class') for dynamically loaded classes, and you'll have a basic web server with a mix of files and 'CGI's'. Similar patterns can be added for template-based pages. And finally, note that RequestHandler includes the code from DemoServer in the existing tutorial. I still have no idea how that was supposed to be chained into the requests for HelloService. Niall, note that I've put your copyright header on the top of these files. They are yours to include in Simple and to improve as you see fit. Michael Libes |
From: David F. <da...@da...> - 2004-12-23 22:06:42
|
The Request.getParameters() method returns the query parameters of a request. And the getURI() method returns the complete URI. But there is no method to reutrn just the path portion of he request: the URI minus the parameters. I think this would be a useful thing to add. David Flanagan |
From: Michael \Luni\ L. <lun...@ya...> - 2004-12-23 20:02:15
|
Niall, There are two Delgate classes. "simple.http.session.Delegate" and "simple.template.Delegate" The first is an Session subclass, the second a Environment subclass. There are two DocumentFactory classes. One for Velocity templates and another for Groovy templates. I suppose few people will use both... There are two Maintainer.java's. "simple.http.session.Maintainer" and "simple.template.Maintainer" The first is an interface, the second a subclass Thread and implementor of Monitor. There are three Monitor.java's. "simple.util.lease.Monitor", "simple.template.Monitor", and "simple.http.Monitor". The first two are interfaces, the third a class that implements "InputMonitor" and "OutputMonitor". There are four Processor classes, three ProxyOutputStream classes, three Registry classes, and two Resolver classes. In almost all these cases, the duplicates are not public classes and interfaces. However, having duplicate names is one of the reasons I (and others) are having such a hard time getting Simple up and running. I'm now wondering how many times yesterday I looked at the wrong class when reading through the code. Perhaps using the old "I" prefix on interfaces would be a good first step to making the code more obvious. Then a few more description terms as suffixes on these duplicate names. And then perhaps simple.http.io, simple.httpd.load.map and simple.httpd.load.rmi sub-packages to help separate the classes further into functions. Michael Libes |
From: Michael \Luni\ L. <lun...@ya...> - 2004-12-23 00:37:19
|
Where's the rest of the tutorial? Even with the source code, it's very hard to get anything up and running on Simple. It seems like a great HTTP server, but the initial effort to get a page served is much more than it should be. I noticed the little note at the bottom of the "Getting Started" page of the tutorial to get HelloService to run. I've yet to figure out how to get DemoHandler to get loaded. You should copy the example off of Brian's blog. I doubt it's just me, but as Simple is an embeddable server, my goal is to embed it into my application. Which means that my services will be encluded in the same .jar as the rest of the application. And that just doesn't seem to work with a MapperEngine. Now beyond getting DemoHandler to show up in the processing flow, how do you get both a LoaderEngine and FileEngine into a single server? That part of Mamba isn't available as source. And in any case, I'd bet 99% of the people who use or want to use Simple have at least a static image to serve up. The basic issue is that Simple is designed around a bunch of Factories, Engines, Managers, Contexts, and Services. I can't tell what each of these types is supposed to be doing to a request. The javadoc isn't clear. Perhaps an annotated diagram would clear up how all these classes fit together. It seems very powerful and incredibly flexible, if only I could understand the architecture as well as the author. Michael Libes |