simpleweb-support Mailing List for Simple (Page 3)
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: Jerome L. <jl...@re...> - 2014-03-29 02:11:37
|
Hi all, We just released a new stable version of Restlet Framework: http://blog.restlet.com/2014/03/27/restlet-framework-2-2-0-and-2-3-m1-released/ It includes version 5.1 of Simple as an extension HTTP/HTTPS server connector. Restlet developers like the performance/size profile of Simple. Also, I would be interested to know what are the plans for next version of Simple. Any client-side or SPDY/HTTP 2.0 support planned? Thanks! Jérôme |
From: Niall G. <gal...@ya...> - 2014-03-21 09:00:38
|
Hi, Yes this is correct, if the value is null then there are no more to be acquired. There probably should be a count exposed for convenience. However for now you will just have to iterate until you get null. I personally use getValues mostly. Niall -------------------------------------------- On Tue, 18/3/14, Vincent Tencé <vt...@gm...> wrote: Subject: Re: [Simpleweb-Support] How do I get the complete list of http headers that have a specific name To: "Simple support and user issues" <sim...@li...> Received: Tuesday, 18 March, 2014, 8:19 PM Thanks Niall, I missed that. I'm a bit confused when reading the javadoc of the different versions of this method. Here's what I understand: getValue(name) returns the header value for the first header with that namegetValue(name, index) returns the value for the index header with that namegetValues(name) returns the parsed tokens of the all headers with that name Am I correct ? When using the form with the index, how do I know how many headers exist with the same name? Thanks for you help,-- Vincent 2014-03-18 22:33 GMT-04:00 Niall Gallagher <gal...@ya...>: See http://www.simpleframework.org/doc/javadoc/org/simpleframework/http/RequestHeader.html#getValue(java.lang.String, int) -------------------------------------------- On Tue, 18/3/14, Vincent Tencé <vt...@gm...> wrote: Subject: [Simpleweb-Support] How do I get the complete list of http headers that have a specific name To: sim...@li... Received: Tuesday, 18 March, 2014, 3:25 PM Hi guys, I'm trying to get the list of http headers that have a specific name (in this case, I'm looking for all Accept-Encoding headers). The Request#getValues(name) method only return headers that are acceptable. I need the complete list so that I know why ones the client will not accept. How would you do that? Thanks,-- Vincent -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech -----Inline Attachment Follows----- _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech -----Inline Attachment Follows----- _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: Vincent T. <vt...@gm...> - 2014-03-19 03:19:17
|
Thanks Niall, I missed that. I'm a bit confused when reading the javadoc of the different versions of this method. Here's what I understand: getValue(name) returns the header value for the first header with that name getValue(name, index) returns the value for the index header with that name getValues(name) returns the parsed tokens of the all headers with that name Am I correct ? When using the form with the index, how do I know how many headers exist with the same name? Thanks for you help, -- Vincent 2014-03-18 22:33 GMT-04:00 Niall Gallagher <gal...@ya...>: > See > http://www.simpleframework.org/doc/javadoc/org/simpleframework/http/RequestHeader.html#getValue(java.lang.String, > int) > -------------------------------------------- > On Tue, 18/3/14, Vincent Tencé <vt...@gm...> wrote: > > Subject: [Simpleweb-Support] How do I get the complete list of http > headers that have a specific name > To: sim...@li... > Received: Tuesday, 18 March, 2014, 3:25 PM > > Hi guys, > I'm trying to get the list of http headers > that have a specific name (in this case, I'm looking for > all Accept-Encoding headers). > The Request#getValues(name) method only return > headers that are acceptable. I need the complete list so > that I know why ones the client will not accept. How would > you do that? > > Thanks,-- Vincent > > > > -----Inline Attachment Follows----- > > > ------------------------------------------------------------------------------ > Learn Graph Databases - Download FREE O'Reilly Book > "Graph Databases" is the definitive new guide to graph > databases and their > applications. Written by three acclaimed leaders in the > field, > this first edition is now available. Download your free book > today! > http://p.sf.net/sfu/13534_NeoTech > -----Inline Attachment Follows----- > > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > ------------------------------------------------------------------------------ > Learn Graph Databases - Download FREE O'Reilly Book > "Graph Databases" is the definitive new guide to graph databases and their > applications. Written by three acclaimed leaders in the field, > this first edition is now available. Download your free book today! > http://p.sf.net/sfu/13534_NeoTech > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > |
From: Niall G. <gal...@ya...> - 2014-03-19 02:36:28
|
See http://www.simpleframework.org/doc/javadoc/org/simpleframework/http/RequestHeader.html#getValue(java.lang.String, int) -------------------------------------------- On Tue, 18/3/14, Vincent Tencé <vt...@gm...> wrote: Subject: [Simpleweb-Support] How do I get the complete list of http headers that have a specific name To: sim...@li... Received: Tuesday, 18 March, 2014, 3:25 PM Hi guys, I'm trying to get the list of http headers that have a specific name (in this case, I'm looking for all Accept-Encoding headers). The Request#getValues(name) method only return headers that are acceptable. I need the complete list so that I know why ones the client will not accept. How would you do that? Thanks,-- Vincent -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech -----Inline Attachment Follows----- _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: Vincent T. <vt...@gm...> - 2014-03-18 22:25:40
|
Hi guys, I'm trying to get the list of http headers that have a specific name (in this case, I'm looking for all Accept-Encoding headers). The Request#getValues(name) method only return headers that are acceptable. I need the complete list so that I know why ones the client will not accept. How would you do that? Thanks, -- Vincent |
From: Niall G. <gal...@ya...> - 2014-02-04 12:12:16
|
I would not use that project, it was a pretty much a test and is in no way supported. Use the tutorials on the www.simpleframework.org and you should be able to do what you want. P.S new InetSocketAddress(host, port) will do the trick. -------------------------------------------- On Sun, 2/2/14, Yang Hong <yan...@ho...> wrote: Subject: [Simpleweb-Support] Server IP Address & Mamba source code To: "sim...@li..." <sim...@li...> Received: Sunday, 2 February, 2014, 11:08 PM Dear SIMPLE team and all, (1) I read the tutorial on SIMPLE website http://www.simpleframework.org/doc/tutorial/tutorial.php and server.properties from mamba-1.1.tar I can NOT find how to specify IP address of server. (1a) From the tutorial SocketAddress address = new InetSocketAddress(port); connection.connect(address); (1b) From server.properties server.port=80 Therefore, it seems that we can only specify the server port, while we have to use localhost as default IP address of the server. (2) Mamba-1.1.tar does NOT include the source code for mamba-1.1.jar (executable jar file) (2a) in the folder of mamba-1.1, we can NOT find the subfolder "src" (2b) server.properties allows us to set the parameters of SSL, but the tutorial does NOT provide how to establish HTTPS connection (2c) when replacing simple-2.4.jar with simple-5.1.6.jar, we can NOT start the server using java -Dserver.properties=server.properties mamba.serve.Server (3) My question is here: Would you please let me know how to set the server's IP address and how to establish a HTTPS/SSL connection? Thank you very much for your help in advance. Best regards, Yang Hong -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Managing the Performance of Cloud-Based Applications Take advantage of what the Cloud has to offer - Avoid Common Pitfalls. Read the Whitepaper. http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk -----Inline Attachment Follows----- _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: Yang H. <yan...@ho...> - 2014-02-03 07:08:56
|
Dear SIMPLE team and all, (1) I read the tutorial on SIMPLE website http://www.simpleframework.org/doc/tutorial/tutorial.php and server.properties from mamba-1.1.tar I can NOT find how to specify IP address of server. (1a) From the tutorial SocketAddress address = new InetSocketAddress(port); connection.connect(address); (1b) From server.properties server.port=80 Therefore, it seems that we can only specify the server port, while we have to use localhost as default IP address of the server. (2) Mamba-1.1.tar does NOT include the source code for mamba-1.1.jar (executable jar file) (2a) in the folder of mamba-1.1, we can NOT find the subfolder "src" (2b) server.properties allows us to set the parameters of SSL, but the tutorial does NOT provide how to establish HTTPS connection (2c) when replacing simple-2.4.jar with simple-5.1.6.jar, we can NOT start the server using java -Dserver.properties=server.properties mamba.serve.Server (3) My question is here: Would you please let me know how to set the server's IP address and how to establish a HTTPS/SSL connection? Thank you very much for your help in advance. Best regards, Yang Hong |
From: Arul D. <ar...@ac...> - 2013-12-26 09:19:23
|
Hi, This method is removed in the latest release and replaced with getClientCertificate(). Is there a way to get the user principal from the request? Thanks! Arul |
From: Jorge V. <jmv...@cr...> - 2013-11-07 10:49:15
|
Hello Niall, thanks for answering, o notice that the entity part is gone too. how is that treated now? I assume that when you say that the only difference between Form and Query is the Part data, it means that the request now is formed in a different way, so if i want to create a httpclient request, where does this parts fit? Because i think i'm doing it wrong. Thanks in advance, Jorge Vicente ________________________________ From: Niall Gallagher [gal...@ya...] Sent: 07 November 2013 06:15 To: Simple support and user issues Subject: Re: [Simpleweb-Support] HTTP Post using Simpleframework 5.1.6 Hi Jorge, I can confirm the only change between Form and Query is the absence of the Part data that is send with a multipart form encoded POST. Other than that it is exactly the same. I got rid of Form because I thought it was one of those things that was a little too convenient and may interfere with your interpretation of the request. I can also confirm that 5.1.6 should be far more stable than any previous release of Simple and is being used in a very high througput site as we speak, with well over a million transactions per hour. Niall On Wednesday, 6 November 2013 10:48 PM, Jorge Vicente <jmv...@it...> wrote: Hello, I recently update the simpleframework library from the version 4.1.21 to the new 5.1.6 and things started to fall in pieces. The main problem is the absence of the Form data. I updated all my methods to get the form data from the query and pass it as parameters. But i think i'm doing something wrong, because it keeps failing in some spots. I think one of the problems as to do with the fact that now the post parameters are going in the httpclient parameters, and not in the entity as post parameters. Can someone point me in a tutorial on how to do this, something that explains the conversion from the 4.1.21 post method to the 5.1.6 new system. One of the problems that prevents me from doing something like this ( http://stackoverflow.com/a/8129350 ) as to do with the fact that the simpleframework already as an entity that i need to maintaine, and when converting to the HttpPost i don't know how to add the simpleframewokr entity and the entity sugested in the stackoverflow comentary. Can someone give me some directions??? Thanks in advance. Jorge Vicente ------------------------------------------------------------------------------ November Webinars for C, C++, Fortran Developers Accelerate application performance with scalable programming models. Explore techniques for threading, error checking, porting, and tuning. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk _______________________________________________ Simpleweb-Support mailing list Sim...@li...<mailto:Sim...@li...> https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: Niall G. <gal...@ya...> - 2013-11-07 06:15:21
|
Hi Jorge, I can confirm the only change between Form and Query is the absence of the Part data that is send with a multipart form encoded POST. Other than that it is exactly the same. I got rid of Form because I thought it was one of those things that was a little too convenient and may interfere with your interpretation of the request. I can also confirm that 5.1.6 should be far more stable than any previous release of Simple and is being used in a very high througput site as we speak, with well over a million transactions per hour. Niall On Wednesday, 6 November 2013 10:48 PM, Jorge Vicente <jmv...@it...> wrote: Hello, I recently update the simpleframework library from the version 4.1.21 to the new 5.1.6 and things started to fall in pieces. The main problem is the absence of the Form data. I updated all my methods to get the form data from the query and pass it as parameters. But i think i'm doing something wrong, because it keeps failing in some spots. I think one of the problems as to do with the fact that now the post parameters are going in the httpclient parameters, and not in the entity as post parameters. Can someone point me in a tutorial on how to do this, something that explains the conversion from the 4.1.21 post method to the 5.1.6 new system. One of the problems that prevents me from doing something like this (http://stackoverflow.com/a/8129350 ) as to do with the fact that the simpleframework already as an entity that i need to maintaine, and when converting to the HttpPost i don't know how to add the simpleframewokr entity and the entity sugested in the stackoverflow comentary. Can someone give me some directions??? Thanks in advance. Jorge Vicente ------------------------------------------------------------------------------ November Webinars for C, C++, Fortran Developers Accelerate application performance with scalable programming models. Explore techniques for threading, error checking, porting, and tuning. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: Jorge V. <jmv...@it...> - 2013-11-06 11:47:57
|
Hello, I recently update the simpleframework library from the version 4.1.21 to the new 5.1.6 and things started to fall in pieces. The main problem is the absence of the Form data. I updated all my methods to get the form data from the query and pass it as parameters. But i think i'm doing something wrong, because it keeps failing in some spots. I think one of the problems as to do with the fact that now the post parameters are going in the httpclient parameters, and not in the entity as post parameters. Can someone point me in a tutorial on how to do this, something that explains the conversion from the 4.1.21 post method to the 5.1.6 new system. One of the problems that prevents me from doing something like this (* http://stackoverflow.com/a/8129350 <http://stackoverflow.com/a/8129350> *) as to do with the fact that the simpleframework already as an entity that i need to maintaine, and when converting to the HttpPost i don't know how to add the simpleframewokr entity and the entity sugested in the stackoverflow comentary. Can someone give me some directions??? Thanks in advance. Jorge Vicente |
From: -=}\\*/{=- <rui...@gm...> - 2013-06-27 12:08:37
|
previous versions used to implement session support... i have adapted it to my engine. if you cannot find it available for download i can send you the code i have. niall: i think that this is such a common feature that you could still supply the code as an example or make it available as a separate download. []r. On 27 June 2013 10:49, Niall Gallagher <gal...@ya...> wrote: > This will not be happening, session logic is very easy to implement. I > think its a bad idea to integrate session logic in to a HTTP server like > servlets has done. Your better off implementing your own session logic. > > --- On *Wed, 26/6/13, Centoria <co...@ce...>* wrote: > > > From: Centoria <co...@ce...> > Subject: [Simpleweb-Support] Simple http server embed + session management > To: sim...@li... > Received: Wednesday, 26 June, 2013, 6:41 AM > > > Hi, > > I try to use some java http server for writting web app only using jdk. > > I wrote some "hello world" test with your framework. But a don't found > some classe for managing session like (HttpServletSession). > > Can you tell about this future in your server ? > > Thank's > > -----Inline Attachment Follows----- > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > > -----Inline Attachment Follows----- > > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li...<http://mc/compose?to=Sim...@li...> > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by Windows: > > Build for Windows Store. > > http://p.sf.net/sfu/windows-dev2dev > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > |
From: Niall G. <gal...@ya...> - 2013-06-27 09:49:18
|
This will not be happening, session logic is very easy to implement. I think its a bad idea to integrate session logic in to a HTTP server like servlets has done. Your better off implementing your own session logic. --- On Wed, 26/6/13, Centoria <co...@ce...> wrote: From: Centoria <co...@ce...> Subject: [Simpleweb-Support] Simple http server embed + session management To: sim...@li... Received: Wednesday, 26 June, 2013, 6:41 AM Hi, I try to use some java http server for writting web app only using jdk. I wrote some "hello world" test with your framework. But a don't found some classe for managing session like (HttpServletSession). Can you tell about this future in your server ? Thank's -----Inline Attachment Follows----- ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev -----Inline Attachment Follows----- _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: Centoria <co...@ce...> - 2013-06-26 13:54:32
|
Hi, I try to use some java http server for writting web app only using jdk. I wrote some "hello world" test with your framework. But a don't found some classe for managing session like (HttpServletSession). Can you tell about this future in your server ? Thank's |
From: Niall G. <gal...@ya...> - 2013-06-06 07:25:31
|
Try this public class MyServer implements org.simpleframework.transport.Server { private Server delegateServer; public MyServer(Server delegateServer){ this.delegateServer = delegateServer; } public void process(Socket socket){ socket.getSSLEngine().setNeedClientAuth(true); delegateServer.process(socket); }} --- On Tue, 4/6/13, Mike Deck <mik...@gm...> wrote: From: Mike Deck <mik...@gm...> Subject: [Simpleweb-Support] SSL Client Authentication To: sim...@li... Received: Tuesday, 4 June, 2013, 6:33 PM Is there a good way to configure Simple to require a valid client certificate when using an SSL connection? I have the following bare-bones server and I would like to know what the correct process is to enable client certificate authentication on it. Any help would be much appreciated. Thanks,Mike -------Begin Example----- public static void main(String[] args) throws Exception { Container container = createContainer(); Server server = new ContainerServer(container); Connection connection = new SocketConnection(server); SocketAddress address = new InetSocketAddress(8443); KeyManagerFactory km = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); KeyStore serverKeystore = KeyStore.getInstance(KeyStore.getDefaultType()); try(InputStream keystoreFile = new FileInputStream(SERVER_KEYSTORE_PATH)) { serverKeystore.load(keystoreFile, "asdfgh".toCharArray()); } km.init(serverKeystore, "asdf".toCharArray()); TrustManagerFactory tm = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); KeyStore caKeystore = KeyStore.getInstance(KeyStore.getDefaultType()); try(InputStream caCertFile = new FileInputStream(CA_CERT_PATH)) { caKeystore.load(caCertFile, "asdfgh".toCharArray()); } tm.init(caKeystore); SSLContext sslContext = SSLContext.getInstance("TLS"); sslContext.init(km.getKeyManagers(), tm.getTrustManagers(), null); sslContext.getDefaultSSLParameters().setNeedClientAuth(true); connection.connect(address, sslContext); } -----Inline Attachment Follows----- ------------------------------------------------------------------------------ How ServiceNow helps IT people transform IT departments: 1. A cloud service to automate IT design, transition and operations 2. Dashboards that offer high-level views of enterprise services 3. A single system of record for all IT processes http://p.sf.net/sfu/servicenow-d2d-j -----Inline Attachment Follows----- _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: Mike D. <mik...@gm...> - 2013-06-05 01:33:52
|
Is there a good way to configure Simple to require a valid client certificate when using an SSL connection? I have the following bare-bones server and I would like to know what the correct process is to enable client certificate authentication on it. Any help would be much appreciated. Thanks, Mike -------Begin Example----- public static void main(String[] args) throws Exception { Container container = createContainer(); Server server = new ContainerServer(container); Connection connection = new SocketConnection(server); SocketAddress address = new InetSocketAddress(8443); KeyManagerFactory km = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); KeyStore serverKeystore = KeyStore.getInstance(KeyStore.getDefaultType()); try(InputStream keystoreFile = new FileInputStream(SERVER_KEYSTORE_PATH)) { serverKeystore.load(keystoreFile, "asdfgh".toCharArray()); } km.init(serverKeystore, "asdf".toCharArray()); TrustManagerFactory tm = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); KeyStore caKeystore = KeyStore.getInstance(KeyStore.getDefaultType()); try(InputStream caCertFile = new FileInputStream(CA_CERT_PATH)) { caKeystore.load(caCertFile, "asdfgh".toCharArray()); } tm.init(caKeystore); SSLContext sslContext = SSLContext.getInstance("TLS"); sslContext.init(km.getKeyManagers(), tm.getTrustManagers(), null); sslContext.getDefaultSSLParameters().setNeedClientAuth(true); connection.connect(address, sslContext); } |
From: Alvaro G. <alv...@gm...> - 2013-04-30 09:51:06
|
Hi, I would belive what you say but, I have another but simpler test. I can send you the code if you want a simple Asynchron invokation...just an empty task with a simple sleep. If you send 10 request from "Soap-ui" (Loadtest) you will se that the simpleframe get blocked. We use for logging log4j, but it should not matter. Just try it before you say anything I think you test it yourself. - Klient Soap-ui Loadtest 10 request the code: public class TestAsynchronousServiceContainer implements Container { private final ExecutorService executor; public class TestTask implements Runnable{ public void run() { long recievedTime = System.currentTimeMillis(); try { System.out.println("Timeout in millis " + 10000); long timeOutStarted = System.currentTimeMillis(); System.out.println("Timeout startade " + new Date(timeOutStarted)); // pauseReqAnswer(messageTimeOut); Thread.sleep(10000); System.out.println("The response time was: " + recievedTime + " ms "); } catch(Exception e) { e.printStackTrace(); } } } public TestAsynchronousServiceContainer() { this.executor = Executors.newCachedThreadPool(); // this.executor = Executors.newFixedThreadPool(100); } @Override public void handle(Request request, Response response) { System.out.println("receiving request " + request.getAddress().toString()); // Task task = new Task(request, response, cfg); TestTask task = new TestTask(); executor.execute(task); System.out.println("Executing task"); } } public static void main(String[] list) throws Exception { Container container = new TestAsynchronousServiceContainer(); Server server = new ContainerServer(container); Connection connection = new SocketConnection(server); InetSocketAddress address = new InetSocketAddress(8888); String hostName = getLocalHostName(); LOG.info("HTTP SERVER STARTING at url: http://" + hostName + ":" + cfg.getServerPort()); connection.connect(address); } I have had 3 developers with about 10 years experience and every one of them have got the same result. Remember they run a SOAP-UI klient 2013/4/30 Niall Gallagher <gal...@ya...> > Hi Alvaro, > > This is simply not true, there is something wrong with your test code, not > sure what exactly but I would recommend you take a closer look at your code. > > Niall > > --- On *Tue, 30/4/13, Alvaro Guillermo <alv...@gm...>* wrote: > > > From: Alvaro Guillermo <alv...@gm...> > Subject: [Simpleweb-Support] Asynchronous services get blocked > To: Sim...@li... > Received: Tuesday, 30 April, 2013, 1:38 AM > > > nice and easy to use but there seems to be a problem when you use several > thread. I have a timeout for certain type of request the code is quite > straightforward. I looks like the example, ie. > > > this.executor = Executors.newCachedThreadPool(); > @Override > public void handle(Request request, Response response) > { > > LOG.info("receiving request " + request.getAddress().toString()); > Task task = new Task(request, response, cfg); > executor.execute(task); > LOG.info("Executing task"); > } > > There is two differences In the Task compared to the examples in the > homepage, > > 1)I have a Thread.sleep(millis) > > 2) I used Executors.newCachedThreadPool > > I tried the same sniper code outside the simpleframework and It worked > fine. The problem is that it seems that when you have big loads of > requests the simpleframework get a blocked handling like 3 requests at the > time, ie. and it does not handle more request until the current Threads > have runned completetly. > > In my eyes it should continue to handle requests even if some threads are > sleeping, if you are using threads, the same sniper code outside > simpleframework works fine so I don't think it has to do with the code. I > tried also without Thread.sleep but I let the "task" do a lot of things > that took about 10 seconds to finish. The same problem here simpleframework > get blocked until it was finished with the current tasks, despite the fact > it was supposed to run asynchronously. The same code works fine outside > simpleframework, when I put it in a "main" class instead. > > I need some hints och help with this issue. > ------------------------------ > > > > -----Inline Attachment Follows----- > > > ------------------------------------------------------------------------------ > Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET > Get 100% visibility into your production application - at no cost. > Code-level diagnostics for performance bottlenecks with <2% overhead > Download for free and get started troubleshooting in minutes. > http://p.sf.net/sfu/appdyn_d2d_ap1 > > -----Inline Attachment Follows----- > > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li...<http://mc/compose?to=Sim...@li...> > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > ------------------------------------------------------------------------------ > Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET > Get 100% visibility into your production application - at no cost. > Code-level diagnostics for performance bottlenecks with <2% overhead > Download for free and get started troubleshooting in minutes. > http://p.sf.net/sfu/appdyn_d2d_ap1 > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > -- Alvaro Rubio M. Sc. (Computer and System sciences) Swedish Tax Agency, Swedish Enforcement Authority (Skatteverket, kronofogden), Stockholm Phone +46 (0)767252832 Mobile +46 (0)720010966 |
From: Niall G. <gal...@ya...> - 2013-04-30 09:38:01
|
Hi Alvaro, This is simply not true, there is something wrong with your test code, not sure what exactly but I would recommend you take a closer look at your code. Niall --- On Tue, 30/4/13, Alvaro Guillermo <alv...@gm...> wrote: From: Alvaro Guillermo <alv...@gm...> Subject: [Simpleweb-Support] Asynchronous services get blocked To: Sim...@li... Received: Tuesday, 30 April, 2013, 1:38 AM nice and easy to use but there seems to be a problem when you use several thread. I have a timeout for certain type of request the code is quite straightforward. I looks like the example, ie. this.executor = Executors.newCachedThreadPool(); @Override public void handle(Request request, Response response) { LOG.info("receiving request " + request.getAddress().toString()); Task task = new Task(request, response, cfg); executor.execute(task); LOG.info("Executing task"); } There is two differences In the Task compared to the examples in the homepage, 1)I have a Thread.sleep(millis) 2) I used Executors.newCachedThreadPoolI tried the same sniper code outside the simpleframework and It worked fine. The problem is that it seems that when you have big loads of requests the simpleframework get a blocked handling like 3 requests at the time, ie. and it does not handle more request until the current Threads have runned completetly. In my eyes it should continue to handle requests even if some threads are sleeping, if you are using threads, the same sniper code outside simpleframework works fine so I don't think it has to do with the code. I tried also without Thread.sleep but I let the "task" do a lot of things that took about 10 seconds to finish. The same problem here simpleframework get blocked until it was finished with the current tasks, despite the fact it was supposed to run asynchronously. The same code works fine outside simpleframework, when I put it in a "main" class instead. I need some hints och help with this issue. -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET Get 100% visibility into your production application - at no cost. Code-level diagnostics for performance bottlenecks with <2% overhead Download for free and get started troubleshooting in minutes. http://p.sf.net/sfu/appdyn_d2d_ap1 -----Inline Attachment Follows----- _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: Alvaro G. <alv...@gm...> - 2013-04-30 08:38:13
|
nice and easy to use but there seems to be a problem when you use several thread. I have a timeout for certain type of request the code is quite straightforward. I looks like the example, ie. this.executor = Executors.newCachedThreadPool(); @Override public void handle(Request request, Response response) { LOG.info("receiving request " + request.getAddress().toString()); Task task = new Task(request, response, cfg); executor.execute(task); LOG.info("Executing task"); } There is two differences In the Task compared to the examples in the homepage, 1)I have a Thread.sleep(millis) 2) I used Executors.newCachedThreadPool I tried the same sniper code outside the simpleframework and It worked fine. The problem is that it seems that when you have big loads of requests the simpleframework get a blocked handling like 3 requests at the time, ie. and it does not handle more request until the current Threads have runned completetly. In my eyes it should continue to handle requests even if some threads are sleeping, if you are using threads, the same sniper code outside simpleframework works fine so I don't think it has to do with the code. I tried also without Thread.sleep but I let the "task" do a lot of things that took about 10 seconds to finish. The same problem here simpleframework get blocked until it was finished with the current tasks, despite the fact it was supposed to run asynchronously. The same code works fine outside simpleframework, when I put it in a "main" class instead. I need some hints och help with this issue. ------------------------------ |
From: Niall G. <gal...@ya...> - 2013-04-24 08:35:14
|
This is caused by erasure, T is not available at runtime. Java does not allow it. --- On Tue, 23/4/13, Hardik Upadhyay <hup...@as...> wrote: > From: Hardik Upadhyay <hup...@as...> > Subject: [Simpleweb-Support] Xml To Java Object conversion > To: "sim...@li..." <sim...@li...> > Received: Tuesday, 23 April, 2013, 5:31 AM > > > > > > > > > > > > > > > > I am converting xml file to java object using > simpleframework. I am using generics since my xml's > internal nodes gets changing. But simpleframework throws an > error while converting. Here is my sample code: > @Root(name = "searchresult", strict = false) > public class ResponseVO<T> > { > > @ElementList(entry = "document", inline = true) > > public List<T> elementVOList = new ArrayList<T>(); > > > public List<T> > getElementsVOList() > > { > > return elementVOList; > > } > > > public void setElementsVOList(List<T>list) > > { > > elementVOList = list; > > } > } > ResponseVO is container for various other VOs as > bellow: > @Root(name > = > "document", strict > = > false) > public class Projects_Display_VO > { > > > @Element(name = "projectname") > > private String projectName; > > > > @Attribute(name = "id") > > private int tmpid; > > > public int getTmpid() > > { > > return tmpid; > > } > > > public void setTmpid(int tmpid) > > { > > this.tmpid = tmpid; > > } > > /** > > * ProjectId > > */ > > > @Element(name = "projectid") > > private String projectID; > > > > public String getProjectName() > > { > > return projectName; > > } > > > public void setProjectName(String projectName) > > { > > this.projectName = projectName; > > } > > > public int getProjectID() > > { > > return Integer.parseInt(projectID); > > } > > > public void setProjectID(String projectID) > > { > > this.projectID = projectID; > > } > } > And the XML file is As bellow: > <searchresult> > <query>id:(PROJ2 PROJ6)</query> > <document id="0"> > > <projectid>2</projectid> > > <projectname>Redundant Demo Project</projectname> > > <doctype>Projects</doctype> > > <summary>||Demo Project</summary> > > <title>Redundant Demo Project</title> > </document> > > <document > id="1"> > <projectid>6</projectid> > <projectname>Redundant Demo Project2</projectname> > > <doctype>Projects</doctype> > > <summary>||Main terminal links.</summary> > > <title>Terminal 5 Project</title> > </document> > </searchresult> > The code for conversion is as bellow: > ResponseVO<Projects_Display_VO> resp = (ResponseVO<Projects_Display_VO>) SerializationUtil.deserialize(ResponseVO.class, reader); > Here i am using serializer from simpleframework. But it > throws following error > Exception::Attribute 'id' does not have a match in class java.lang.Object at line 5 > org.simpleframework.xml.core.AttributeException: Attribute 'id' does not have a match in class java.lang.Object at line 5 > at org.simpleframework.xml.core.Composite.readAttribute(Composite.java:555) > at org.simpleframework.xml.core.Composite.readAttributes(Composite.java:474) > at org.simpleframework.xml.core.Composite.readSection(Composite.java:387 > > > > > > I don’t understand > whats going wrong here. Does simpleframework supports > generics ? Or am I doing something wrong ? > > Best Regards > > Hardik Upadhyay > > > > > > > > -----Inline Attachment Follows----- > > ------------------------------------------------------------------------------ > Try New Relic Now & We'll Send You this Cool Shirt > New Relic is the only SaaS-based application performance > monitoring service > that delivers powerful full stack analytics. Optimize and > monitor your > browser, app, & servers with just a few lines of code. > Try New Relic > and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr > -----Inline Attachment Follows----- > > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > |
From: Hardik U. <hup...@as...> - 2013-04-23 12:44:50
|
I am converting xml file to java object using simpleframework. I am using generics since my xml's internal nodes gets changing. But simpleframework throws an error while converting. Here is my sample code: @Root(name = "searchresult", strict = false) public class ResponseVO<T> { @ElementList(entry = "document", inline = true) public List<T> elementVOList = new ArrayList<T>(); public List<T> getElementsVOList() { return elementVOList; } public void setElementsVOList(List<T>list) { elementVOList = list; } } ResponseVO is container for various other VOs as bellow: @Root(name = "document", strict = false) public class Projects_Display_VO { @Element(name = "projectname") private String projectName; @Attribute(name = "id") private int tmpid; public int getTmpid() { return tmpid; } public void setTmpid(int tmpid) { this.tmpid = tmpid; } /** * ProjectId */ @Element(name = "projectid") private String projectID; public String getProjectName() { return projectName; } public void setProjectName(String projectName) { this.projectName = projectName; } public int getProjectID() { return Integer.parseInt(projectID); } public void setProjectID(String projectID) { this.projectID = projectID; } } And the XML file is As bellow: <searchresult> <query>id:(PROJ2 PROJ6)</query> <document id="0"> <projectid>2</projectid> <projectname>Redundant Demo Project</projectname> <doctype>Projects</doctype> <summary>||Demo Project</summary> <title>Redundant Demo Project</title> </document> <document id="1"> <projectid>6</projectid> <projectname>Redundant Demo Project2</projectname> <doctype>Projects</doctype> <summary>||Main terminal links.</summary> <title>Terminal 5 Project</title> </document> </searchresult> The code for conversion is as bellow: ResponseVO<Projects_Display_VO> resp = (ResponseVO<Projects_Display_VO>) SerializationUtil.deserialize(ResponseVO.class, reader); Here i am using serializer from simpleframework. But it throws following error Exception::Attribute 'id' does not have a match in class java.lang.Object at line 5 org.simpleframework.xml.core.AttributeException: Attribute 'id' does not have a match in class java.lang.Object at line 5 at org.simpleframework.xml.core.Composite.readAttribute(Composite.java:555) at org.simpleframework.xml.core.Composite.readAttributes(Composite.java:474) at org.simpleframework.xml.core.Composite.readSection(Composite.java:387 I don't understand whats going wrong here. Does simpleframework supports generics ? Or am I doing something wrong ? Best Regards Hardik Upadhyay |
From: Laurent <lma...@sm...> - 2013-04-10 15:05:53
|
Yes the server should be up and listening after that code. HTTP needs two line feeds (2 body.println*()*) after the request for it to respond. Laurent Marchal. On 4/10/13 9:35 AM, Dave Alvarado wrote: > Thanks for your help. Should I be able to telnet to that port after > running that command? When I debug my JUnit test after having this > > @BeforeClass > > public static final void setupTestServer() throws IOException > > { > > Container container = new TestContainer(OK); > > final Server server = new ContainerServer(container); > > final Connection connection = new SocketConnection(server); > > final SocketAddress address = new InetSocketAddress(8083); > > connection.connect(address); > > } // setupTestServer > > > I'm not able to telnet to localhost on port 8083. Below is the server > I set up. I'm pausing the code through debugging so theoretically the > server should still be alive (but I think I'm wrong on that one). > > > > public class TestContainer implements Container { > > > private String defaultMsg; > > public TestContainer(final String defaultMsg) > > { > > this.defaultMsg = defaultMsg; > > } // TestContainer > > public void handle(Request request, Response response) { > > try { > > final PrintStream body = response.getPrintStream(); > > long time = System.currentTimeMillis(); > > response.setValue("Content-Type", "text/plain"); > > response.setValue("Server", "Test/1.0 (Simple 5.0)"); > > response.setDate("Date", time); > > response.setDate("Last-Modified", time); > > body.println(defaultMsg); > > body.close(); > > } catch(Exception e) { > > e.printStackTrace(); > > } > > } > > > } > > > > > ------------------------------------------------------------------------ > Date: Tue, 9 Apr 2013 15:21:02 -0500 > From: lma...@sm... > To: sim...@li... > Subject: Re: [Simpleweb-Support] How do I cusotmize the port on which > my server listens? > > Yes just change > > new InetSocketAddress(8080); > > with > > new InetSocketAddress(9999); or any port number you need. > > Regards, > Laurent Marchal. > > > On 4/9/13 3:17 PM, Dave Alvarado wrote: > > Hi, Thanks but I'm not seeing it. Neither the "HelloWorld" > example or the "AsynchronousService" seem to change the default > port of 8080 on which the server listens. > > I assume this line > > SocketAddress address= new InetSocketAddress(8080); > > refers to connecting to a running server. > > Which example are you referring to? - Dave > > ------------------------------------------------------------------------ > Date: Tue, 9 Apr 2013 14:43:43 -0500 > From: lma...@sm... <mailto:lma...@sm...> > To: sim...@li... > <mailto:sim...@li...> > Subject: Re: [Simpleweb-Support] How do I cusotmize the port on > which my server listens? > > Hi, > > Here's an example from the tutorial. You might want to read it > http://www.simpleframework.org/doc/tutorial/tutorial.php > > public static void main(String[] list) throws Exception { > Container container= new HelloWorld(); > Server server= new ContainerServer(container); > Connection connection= new SocketConnection(server); > SocketAddress address= new InetSocketAddress(8080); > > connection.connect(address); > } > > > Regards, > Laurent Marchal > > On 4/9/13 11:38 AM, Dave Alvarado wrote: > > Hi, > > I'm using the latest version of the Simple framework. How do > I customize the port on which my server listens? It seems to > be 8080 by default, but that port is being used by something > else on my system. I'm using the server creation from the > example: > > public class TestContainer implements Container { > > > public void handle(Request request, Response response) { > > try { > > final PrintStream body = response.getPrintStream(); > > long time = System.currentTimeMillis(); > > response.set("Content-Type", "text/plain"); > > response.set("Server", "Test/1.0 (Simple 4.0)"); > > response.setDate("Date", time); > > response.setDate("Last-Modified", time); > > body.println("Hello World"); > > body.close(); > > } catch(Exception e) { > > e.printStackTrace(); > > } > > } > > > } > > > Thanks, - Dave > > > > ------------------------------------------------------------------------------ > Precog is a next-generation analytics platform capable of advanced > analytics on semi-structured data. The platform includes APIs for building > apps and a phenomenal toolset for data science. Developers can use > our toolset for easy data analysis & visualization. Get a free account! > http://www2.precog.com/precogplatform/slashdotnewsletter > > > > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... <mailto:Sim...@li...> > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > ------------------------------------------------------------------------------ > Precog is a next-generation analytics platform capable of advanced > analytics on semi-structured data. The platform includes APIs for > building apps and a phenomenal toolset for data science. > Developers can use our toolset for easy data analysis & > visualization. Get a free account! > http://www2.precog.com/precogplatform/slashdotnewsletter > _______________________________________________ Simpleweb-Support > mailing list Sim...@li... > <mailto:Sim...@li...> > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > ------------------------------------------------------------------------------ > Precog is a next-generation analytics platform capable of advanced > analytics on semi-structured data. The platform includes APIs for building > apps and a phenomenal toolset for data science. Developers can use > our toolset for easy data analysis & visualization. Get a free account! > http://www2.precog.com/precogplatform/slashdotnewsletter > > > > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... <mailto:Sim...@li...> > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > ------------------------------------------------------------------------------ > Precog is a next-generation analytics platform capable of advanced > analytics on semi-structured data. The platform includes APIs for > building apps and a phenomenal toolset for data science. Developers > can use our toolset for easy data analysis & visualization. Get a free > account! http://www2.precog.com/precogplatform/slashdotnewsletter > _______________________________________________ Simpleweb-Support > mailing list Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > ------------------------------------------------------------------------------ > Precog is a next-generation analytics platform capable of advanced > analytics on semi-structured data. The platform includes APIs for building > apps and a phenomenal toolset for data science. Developers can use > our toolset for easy data analysis & visualization. Get a free account! > http://www2.precog.com/precogplatform/slashdotnewsletter > > > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: Dave A. <lar...@ms...> - 2013-04-10 14:35:26
|
Thanks for your help. Should I be able to telnet to that port after running that command? When I debug my JUnit test after having this @BeforeClass public static final void setupTestServer() throws IOException { Container container = new TestContainer(OK); final Server server = new ContainerServer(container); final Connection connection = new SocketConnection(server); final SocketAddress address = new InetSocketAddress(8083); connection.connect(address); } // setupTestServer I'm not able to telnet to localhost on port 8083. Below is the server I set up. I'm pausing the code through debugging so theoretically the server should still be alive (but I think I'm wrong on that one). public class TestContainer implements Container { private String defaultMsg; public TestContainer(final String defaultMsg) { this.defaultMsg = defaultMsg; } // TestContainer public void handle(Request request, Response response) { try { final PrintStream body = response.getPrintStream(); long time = System.currentTimeMillis(); response.setValue("Content-Type", "text/plain"); response.setValue("Server", "Test/1.0 (Simple 5.0)"); response.setDate("Date", time); response.setDate("Last-Modified", time); body.println(defaultMsg); body.close(); } catch(Exception e) { e.printStackTrace(); } } } Date: Tue, 9 Apr 2013 15:21:02 -0500 From: lma...@sm... To: sim...@li... Subject: Re: [Simpleweb-Support] How do I cusotmize the port on which my server listens? Yes just change new InetSocketAddress(8080); with new InetSocketAddress(9999); or any port number you need. Regards, Laurent Marchal. On 4/9/13 3:17 PM, Dave Alvarado wrote: Hi, Thanks but I'm not seeing it. Neither the "HelloWorld" example or the "AsynchronousService" seem to change the default port of 8080 on which the server listens. I assume this line SocketAddress address = new InetSocketAddress(8080); refers to connecting to a running server. Which example are you referring to? - Dave Date: Tue, 9 Apr 2013 14:43:43 -0500 From: lma...@sm... To: sim...@li... Subject: Re: [Simpleweb-Support] How do I cusotmize the port on which my server listens? Hi, Here's an example from the tutorial. You might want to read it http://www.simpleframework.org/doc/tutorial/tutorial.php public static void main(String[] list) throws Exception { Container container = new HelloWorld(); Server server = new ContainerServer(container); Connection connection = new SocketConnection(server); SocketAddress address = new InetSocketAddress(8080); connection.connect(address); } Regards, Laurent Marchal On 4/9/13 11:38 AM, Dave Alvarado wrote: Hi, I'm using the latest version of the Simple framework. How do I customize the port on which my server listens? It seems to be 8080 by default, but that port is being used by something else on my system. I'm using the server creation from the example: public class TestContainer implements Container { public void handle(Request request, Response response) { try { final PrintStream body = response.getPrintStream(); long time = System.currentTimeMillis(); response.set("Content-Type", "text/plain"); response.set("Server", "Test/1.0 (Simple 4.0)"); response.setDate("Date", time); response.setDate("Last-Modified", time); body.println("Hello World"); body.close(); } catch(Exception e) { e.printStackTrace(); } } } Thanks, - Dave ------------------------------------------------------------------------------ Precog is a next-generation analytics platform capable of advanced analytics on semi-structured data. The platform includes APIs for building apps and a phenomenal toolset for data science. Developers can use our toolset for easy data analysis & visualization. Get a free account! http://www2.precog.com/precogplatform/slashdotnewsletter _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support ------------------------------------------------------------------------------ Precog is a next-generation analytics platform capable of advanced analytics on semi-structured data. The platform includes APIs for building apps and a phenomenal toolset for data science. Developers can use our toolset for easy data analysis & visualization. Get a free account! http://www2.precog.com/precogplatform/slashdotnewsletter _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support ------------------------------------------------------------------------------ Precog is a next-generation analytics platform capable of advanced analytics on semi-structured data. The platform includes APIs for building apps and a phenomenal toolset for data science. Developers can use our toolset for easy data analysis & visualization. Get a free account! http://www2.precog.com/precogplatform/slashdotnewsletter _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support ------------------------------------------------------------------------------ Precog is a next-generation analytics platform capable of advanced analytics on semi-structured data. The platform includes APIs for building apps and a phenomenal toolset for data science. Developers can use our toolset for easy data analysis & visualization. Get a free account! http://www2.precog.com/precogplatform/slashdotnewsletter _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: Laurent <lma...@sm...> - 2013-04-09 20:21:14
|
Yes just change new InetSocketAddress(8080); with new InetSocketAddress(9999); or any port number you need. Regards, Laurent Marchal. On 4/9/13 3:17 PM, Dave Alvarado wrote: > Hi, Thanks but I'm not seeing it. Neither the "HelloWorld" example or > the "AsynchronousService" seem to change the default port of 8080 on > which the server listens. > > I assume this line > > SocketAddress address= new InetSocketAddress(8080); > refers to connecting to a running server. > Which example are you referring to? - Dave > > ------------------------------------------------------------------------ > Date: Tue, 9 Apr 2013 14:43:43 -0500 > From: lma...@sm... > To: sim...@li... > Subject: Re: [Simpleweb-Support] How do I cusotmize the port on which > my server listens? > > Hi, > > Here's an example from the tutorial. You might want to read it > http://www.simpleframework.org/doc/tutorial/tutorial.php > public static void main(String[] list) throws Exception { > Container container= new HelloWorld(); > Server server= new ContainerServer(container); > Connection connection= new SocketConnection(server); > SocketAddress address= new InetSocketAddress(8080); > > connection.connect(address); > } > > Regards, > Laurent Marchal > > On 4/9/13 11:38 AM, Dave Alvarado wrote: > > Hi, > > I'm using the latest version of the Simple framework. How do I > customize the port on which my server listens? It seems to be > 8080 by default, but that port is being used by something else on > my system. I'm using the server creation from the example: > > public class TestContainer implements Container { > > > public void handle(Request request, Response response) { > > try { > > final PrintStream body = response.getPrintStream(); > > long time = System.currentTimeMillis(); > > response.set("Content-Type", "text/plain"); > > response.set("Server", "Test/1.0 (Simple 4.0)"); > > response.setDate("Date", time); > > response.setDate("Last-Modified", time); > > body.println("Hello World"); > > body.close(); > > } catch(Exception e) { > > e.printStackTrace(); > > } > > } > > > } > > > Thanks, - Dave > > > > ------------------------------------------------------------------------------ > Precog is a next-generation analytics platform capable of advanced > analytics on semi-structured data. The platform includes APIs for building > apps and a phenomenal toolset for data science. Developers can use > our toolset for easy data analysis & visualization. Get a free account! > http://www2.precog.com/precogplatform/slashdotnewsletter > > > > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... <mailto:Sim...@li...> > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > ------------------------------------------------------------------------------ > Precog is a next-generation analytics platform capable of advanced > analytics on semi-structured data. The platform includes APIs for > building apps and a phenomenal toolset for data science. Developers > can use our toolset for easy data analysis & visualization. Get a free > account! http://www2.precog.com/precogplatform/slashdotnewsletter > _______________________________________________ Simpleweb-Support > mailing list Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > ------------------------------------------------------------------------------ > Precog is a next-generation analytics platform capable of advanced > analytics on semi-structured data. The platform includes APIs for building > apps and a phenomenal toolset for data science. Developers can use > our toolset for easy data analysis & visualization. Get a free account! > http://www2.precog.com/precogplatform/slashdotnewsletter > > > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: Dave A. <lar...@ms...> - 2013-04-09 20:18:03
|
Hi, Thanks but I'm not seeing it. Neither the "HelloWorld" example or the "AsynchronousService" seem to change the default port of 8080 on which the server listens. I assume this line SocketAddress address = new InetSocketAddress(8080);refers to connecting to a running server.Which example are you referring to? - Dave Date: Tue, 9 Apr 2013 14:43:43 -0500 From: lma...@sm... To: sim...@li... Subject: Re: [Simpleweb-Support] How do I cusotmize the port on which my server listens? Hi, Here's an example from the tutorial. You might want to read it http://www.simpleframework.org/doc/tutorial/tutorial.php public static void main(String[] list) throws Exception { Container container = new HelloWorld(); Server server = new ContainerServer(container); Connection connection = new SocketConnection(server); SocketAddress address = new InetSocketAddress(8080); connection.connect(address); } Regards, Laurent Marchal On 4/9/13 11:38 AM, Dave Alvarado wrote: Hi, I'm using the latest version of the Simple framework. How do I customize the port on which my server listens? It seems to be 8080 by default, but that port is being used by something else on my system. I'm using the server creation from the example: public class TestContainer implements Container { public void handle(Request request, Response response) { try { final PrintStream body = response.getPrintStream(); long time = System.currentTimeMillis(); response.set("Content-Type", "text/plain"); response.set("Server", "Test/1.0 (Simple 4.0)"); response.setDate("Date", time); response.setDate("Last-Modified", time); body.println("Hello World"); body.close(); } catch(Exception e) { e.printStackTrace(); } } } Thanks, - Dave ------------------------------------------------------------------------------ Precog is a next-generation analytics platform capable of advanced analytics on semi-structured data. The platform includes APIs for building apps and a phenomenal toolset for data science. Developers can use our toolset for easy data analysis & visualization. Get a free account! http://www2.precog.com/precogplatform/slashdotnewsletter _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support ------------------------------------------------------------------------------ Precog is a next-generation analytics platform capable of advanced analytics on semi-structured data. The platform includes APIs for building apps and a phenomenal toolset for data science. Developers can use our toolset for easy data analysis & visualization. Get a free account! http://www2.precog.com/precogplatform/slashdotnewsletter _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support |