simpleweb-support Mailing List for Simple (Page 5)
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: -=}\\*/{=- <rui...@gm...> - 2012-07-17 14:28:37
|
hoops, you were talking about uploads from the client... lol, sry, just noticed that now. []r. On 17 July 2012 12:47, Andrew Barlow <and...@de...> wrote: > I wondered if the built in file upload mechanism for Simple would work > with client-side upload "widgets" to show progress bars, etc. > > For example http://blueimp.github.com/jQuery-File-Upload/. > > Also, has anyone looked at being able to resume stalled or partial > uploads, and how this might be achieved with Simple? > Regards, > Andy Barlow > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > |
From: -=}\\*/{=- <rui...@gm...> - 2012-07-17 13:27:51
|
the server that i'm implementing over simple implements uploads... since i inherit the code from previous version i did not check if simple supports this... any way i leave you the code... may not be perfect but is what i got... maybe you find it useful. /* * Copyright 2005 Rui Damas */ package abc.kis.handler; import abc.kis.Quest; import abc.kis.Sponse; import abc.kis.handler.abs.FileNameMatcher; import java.io.IOException; import java.io.InputStream; import java.net.URLConnection; import java.util.Date; /** * A kiss handler to alow file download (upload to the client) width * support for the client to interrupt the download and continue later. */ public class Downloader extends FileNameMatcher { /** * Uploads a requested file to the client if it exists... * requires mime type mapping. * * <p> * Tries to resolve a file (using the <code>toHandle</code> resolver). * if such file is found, it will be sent to the client.<br/> * Before sending the content type is set using the KISSLetConfig mime mapper * and the <code>"Date"</code> header is set to the file's last modified * date.<br/> * Simple skipping (continue download) is supported if an header named * 'range' is found in the request and it's value is 'bytes=????-' * where ???? is the number of bytes to skip in the file's stream to upload * to the client. * </p> * * @return always <code>true</code>. */ @Override public boolean handle(Quest quest, Sponse sponse, URLConnection toUpload) { try { // Support (simple) skipping long firstByteIndex = 0; String range = quest.getHeader("Range"); if (range != null) { if (range.startsWith("bytes=")) { range = range.substring("bytes=".length()); int minusIndex = range.indexOf('-'); if (minusIndex > 0) { range = range.substring(0, minusIndex); } try { firstByteIndex = Long.parseLong(range); quest.logI("Skipping: %d bytes", firstByteIndex); } catch (NumberFormatException nfe) { quest.logT(nfe, "Unable to parse requested range"); } } } // get stream and skip to first byte position InputStream toSend = toUpload.getInputStream(); toSend.skip(firstByteIndex); // set response headers long toSendLength = toUpload.getContentLength(); sponse.setContentLength((int) (toSendLength - firstByteIndex)); sponse.setHeader("Content-range", "bytes " + firstByteIndex + "-" + (toSendLength - 1) + "/" + toSendLength); // set content type String mimeType = quest.getMimeTypes(). getMimeTypeOrDefaultForPath(toUpload.getURL().getPath()); sponse.setContentType(mimeType); // set date to file's last modified date long lastModified = toUpload.getLastModified(); long current = new Date().getTime(); long deltaSeconds = (current - lastModified) / 1000; int deltaSinceCurrent = (60 * 5); sponse.setHeader("Cache-Control", "s-maxage=" + deltaSeconds + deltaSinceCurrent); sponse.setDate("Date", current); sponse.setDate("Expires", current + (1000 * deltaSinceCurrent)); sponse.setDate("Last-Modified", lastModified); // send file stream sponse.send(toSend); quest.logI("Sent as \"%1$s\" ", mimeType); } catch (IOException ioe) { quest.logT(ioe, "File not completely sent"); } return true; } } On 17 July 2012 12:47, Andrew Barlow <and...@de...> wrote: > I wondered if the built in file upload mechanism for Simple would work > with client-side upload "widgets" to show progress bars, etc. > > For example http://blueimp.github.com/jQuery-File-Upload/. > > Also, has anyone looked at being able to resume stalled or partial > uploads, and how this might be achieved with Simple? > Regards, > Andy Barlow > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > |
From: Andrew B. <and...@de...> - 2012-07-17 12:18:21
|
I wondered if the built in file upload mechanism for Simple would work with client-side upload "widgets" to show progress bars, etc. For example http://blueimp.github.com/jQuery-File-Upload/. Also, has anyone looked at being able to resume stalled or partial uploads, and how this might be achieved with Simple? Regards, Andy Barlow |
From: -=}\\*/{=- <rui...@gm...> - 2012-07-13 17:53:49
|
ok... this should take yet a few days... i'm working on the docs, site, and "ornaments"... very happy with the results... and "in fleas" (as in my language) to release it. i'll notify as soon as it's out. [ty]r. On 13 July 2012 07:57, Niall Gallagher <gal...@ya...> wrote: > No. Release at will! > > --- On *Wed, 11/7/12, -=}\*/{=- <rui...@gm...>* wrote: > > > From: -=}\*/{=- <rui...@gm...> > Subject: [Simpleweb-Support] licence... > To: "Simple support and user issues" < > sim...@li...> > Received: Wednesday, 11 July, 2012, 3:00 PM > > > hi, > > i'm not much into licence procedures and is the first time i need 3rd > party libraries for my code to run, i have the code almost ready for its > first release and would like to know if i will be able to put the jars of > simple web and xml in the binary package i intent to distribute under the > GPL and if so if it requires any other additional procedure. > > [ty]r. > > -----Inline Attachment Follows----- > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > > -----Inline Attachment Follows----- > > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li...<http://au.mc1202.mail.yahoo.com/mc/compose?to=Sim...@li...> > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > |
From: Niall G. <gal...@ya...> - 2012-07-13 06:57:10
|
No. Release at will! --- On Wed, 11/7/12, -=}\*/{=- <rui...@gm...> wrote: From: -=}\*/{=- <rui...@gm...> Subject: [Simpleweb-Support] licence... To: "Simple support and user issues" <sim...@li...> Received: Wednesday, 11 July, 2012, 3:00 PM hi, i'm not much into licence procedures and is the first time i need 3rd party libraries for my code to run, i have the code almost ready for its first release and would like to know if i will be able to put the jars of simple web and xml in the binary package i intent to distribute under the GPL and if so if it requires any other additional procedure. [ty]r. -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ -----Inline Attachment Follows----- _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: -=}\\*/{=- <rui...@gm...> - 2012-07-11 22:00:53
|
hi, i'm not much into licence procedures and is the first time i need 3rd party libraries for my code to run, i have the code almost ready for its first release and would like to know if i will be able to put the jars of simple web and xml in the binary package i intent to distribute under the GPL and if so if it requires any other additional procedure. [ty]r. |
From: Kai S. <sch...@gm...> - 2012-07-09 00:04:12
|
I personally don't like dealing with constrictive outside resources, even when dealing with high performance things like HTTP handlings. I use Simple to simply turn an HTTP request from network traffic into classes that I could deal with in my own system. The best way to use Simple, and no offense Nial, is to use it as a basic HTTP decoding and processing engine, as well as way to spit your data back out on the web properly. So many other projects, including dozens of commercial products have tried to give you an "web dev/engineering/multithreaded/blabla/forassistance-call-thisnumber. Simple does provide some more advanced components, but unlike most programs than can work as HTTP capable servers, Simple isn't pretentious. It doesn't actually force you into anything, and that's why I love it. Of course, please do feel free to use Nial's extra code, it's really quite great. I used to be locked into Tomcate or a apache style scenario, where my app would be started by them. Now my app starts Simple, as one of dozens of other services :) -Kai PS: Thanks Nial :) On Sat, Jul 7, 2012 at 11:45 AM, -=}\*/{=- <rui...@gm...> wrote: > ok... > > now i'm curious of what you call "callbacks" and "servicing"... (no need > to explain, not today) :P > > took the Timed class away... rewrote it like the code bellow. > > [thank you]r. > > private int timedCount = 0; > > private void runTimed(Runner runner) { > Thread thread = new Thread(runner, > "Runner-".concat(String.valueOf(timedCount++))); > Quest quest = runner.quest; > thread.start(); > try { > thread.join(questTimeout); > } catch (InterruptedException ex) { > quest.logT(ex, EM_INTERRUPTED); > } finally { > if (thread.isAlive()) { > thread.interrupt(); > quest.logE(EM_TIMEOUT); > runner.sponse.sendHTTPInternalError( > "request handling timed out", quest); > } else if (!thread.isInterrupted()) // runner not interrupted... > runner.afterRun(); > > runner.finish(); > runner = null; > timedCount--; > } > } > > protected void handle(InnerQuest quest, Sponse sponse) { > Runner runner = new Runner(quest, sponse); > if (questTimeout > 0) > //new Timed(runner).start(); > runTimed(runner); > else { > timedCount++; > runner.run(); > runner.afterRun(); > runner.finish(); > timedCount--; > } > } > > On 7 July 2012 10:37, Niall Gallagher <gal...@ya...> wrote: > >> Asynchronous can mean a lot of things, if you are happy for it to work >> like a servlet engine then you have done enough. The "asynchronous" part of >> Simple means that no object is tied to the servicing thread, this means >> callbacks can be done. If you do not use callbacks then you do not need to >> use it. >> >> --- On *Sat, 7/7/12, -=}\*/{=- <rui...@gm...>* wrote: >> >> >> From: -=}\*/{=- <rui...@gm...> >> Subject: Re: [Simpleweb-Support] aren't "Dispacher-n" threads already >> asynchronous? >> To: "Simple support and user issues" < >> sim...@li...> >> Received: Saturday, 7 July, 2012, 2:17 AM >> >> >> i'm not sure that i understood... >> >> that start method i mention in the first email does not do that?... >> >> i have the server working, answer the requests, sits as a daemon >> listening to the desired ports and makes new threads "Dispatcher-n" for >> each request... >> isn't that being asynchronous? >> >> what confuses me is, that the tutorial has a chapter dedicated to that... >> as if the first example that i followed was not asynchronous... it seams to >> be, it logs several threads running in parallel... >> >> i just want to implement this the right way... and avoid having threads 3 >> threads spawn when i can have only 2... >> >> never mind the error codes, exception, etc... >> short and simple: does this code bellow creates a daemon that spawns >> "Dispatch-0" threads asynchronously? >> >> connection = new SocketConnection(this); >> for (int port: ports) >> connection.connect(new InetSocketAddress(port)); >> >> if yes, can i take the Timed class out of the picture and do the timing >> control in handle method ran by the "Dispatch-n" Thread? >> if not, why not? what happens then? how can i do it? >> >> [thank you]r. >> >> On 7 July 2012 07:30, Kai Schutte <sch...@gm...<http://mc/compose?to=sch...@gm...> >> > wrote: >> >> In a nearly every setup of Simple, you want to start Simple, then run a >> Daemon thread to wait on / query requests... >> >> how you handle error codes & warning is completely up to you. >> >> -Kai >> >> On Sat, Jul 7, 2012 at 6:47 AM, -=}\*/{=- <rui...@gm...<http://mc/compose?to=rui...@gm...> >> > wrote: >> >> hi again, >> >> i just finished this code and is working fine... but is this the "best" >> approach? >> >> bellow is the inner code of my container class... >> i'm creating 2 threads, one (Timed) that times the runner (Runner), but >> if the "Dispatcher-n" thread is already asynchronous maybe makes more sense >> to use it directly and move Timed.run() code to the handle method... >> >> []r. >> >> private class Runner implements Runnable { >> >> final InnerQuest quest; >> final Sponse sponse; >> boolean handled = false; >> >> Runner(InnerQuest iq, Sponse s) { >> this.quest = iq; >> this.sponse = s; >> } >> >> @Override >> public void run() { >> try { >> // cascade through contexts >> for (Context c: contexts) >> if (c.accepts(quest)) >> if (c.handle(quest, sponse)) { >> handled = true; >> return; >> } >> else >> quest.resetCascade(); >> } catch (Exception e) { >> quest.logT(e, EM_UNHANDLE); >> } >> } >> >> void afterRun() { >> // if not handled... >> if (!handled) // ... send 404 http error >> sponse.sendHTTPError(Sponse.SC_404, Sponse.SCD_404, quest); >> } >> >> void finish() { >> sponse.finish(quest); >> // log time >> quest.logI("! %1$sms: %2$s%3$s", >> System.currentTimeMillis() - quest.creationTime, >> quest.getHeader(Quest.H_Host), quest.getUrlPath()); >> // merge quest logger if exists >> if (quest.hasOwnLogger()) >> logI(quest.logger.toString()); >> } >> } >> >> private class Timed implements Runnable { >> >> private Runner runner; >> private String namePostfix; >> >> public Timed(Runner r) { >> this.runner = r; >> } >> >> void start() { >> namePostfix = String.valueOf(timedCount++); >> new Thread(this, "TimedRunner-".concat(namePostfix)).start(); >> } >> >> @Override >> public void run() { >> Thread thread = new Thread(runner, "Runner-".concat(namePostfix)); >> Quest quest = runner.quest; >> thread.start(); >> try { >> thread.join(questTimeout); >> } catch (InterruptedException ex) { >> quest.logT(ex, EM_INTERRUPTED); >> } finally { >> if (thread.isAlive()) { >> thread.interrupt(); >> quest.logE(EM_TIMEOUT); >> runner.sponse.sendHTTPInternalError( >> "request handling timed out", quest); >> } else if (!thread.isInterrupted()) // runner not interrupted... >> runner.afterRun(); >> >> runner.finish(); >> runner = null; >> timedCount--; >> } >> } >> } >> >> protected void handle(InnerQuest quest, Sponse sponse) { >> Runner runner = new Runner(quest, sponse); >> if (questTimeout > 0) >> new Timed(runner).start(); >> else { >> timedCount++; >> runner.run(); >> runner.afterRun(); >> runner.finish(); >> timedCount--; >> } >> } >> >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> Simpleweb-Support mailing list >> Sim...@li...<http://mc/compose?to=Sim...@li...> >> https://lists.sourceforge.net/lists/listinfo/simpleweb-support >> >> >> >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> Simpleweb-Support mailing list >> Sim...@li...<http://mc/compose?to=Sim...@li...> >> https://lists.sourceforge.net/lists/listinfo/simpleweb-support >> >> >> >> -----Inline Attachment Follows----- >> >> >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> >> -----Inline Attachment Follows----- >> >> >> _______________________________________________ >> Simpleweb-Support mailing list >> Sim...@li...<http://mc/compose?to=Sim...@li...> >> https://lists.sourceforge.net/lists/listinfo/simpleweb-support >> >> >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> Simpleweb-Support mailing list >> Sim...@li... >> https://lists.sourceforge.net/lists/listinfo/simpleweb-support >> >> > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > |
From: -=}\\*/{=- <rui...@gm...> - 2012-07-08 04:46:15
|
i made a gui to control the server and everything is logged to a JTextArea... but i'm not catching these that are silently getting printed to System.err: (Location of error unknown)java.io.IOException: Response has been transferred (Location of error unknown)org.simpleframework.http.core.ProducerException: Stream has been closed in the case of the first one would be nice to get an exception... it means that i'm closing the stream twice and there is no stack trace to debug or a way to handle it... happy summer [ty]r. |
From: Niall G. <gal...@ya...> - 2012-07-07 10:04:30
|
it should be possible so specify the thread count when you create the implementation, take a look at the Processor. --- On Sat, 7/7/12, -=}\*/{=- <rui...@gm...> wrote: From: -=}\*/{=- <rui...@gm...> Subject: [Simpleweb-Support] how can i limit the number of concurrent dispatcher threads? To: "Simple support and user issues" <sim...@li...> Received: Saturday, 7 July, 2012, 2:54 AM [ty]r. -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ -----Inline Attachment Follows----- _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: -=}\\*/{=- <rui...@gm...> - 2012-07-07 09:54:38
|
[ty]r. |
From: -=}\\*/{=- <rui...@gm...> - 2012-07-07 09:46:09
|
ok... now i'm curious of what you call "callbacks" and "servicing"... (no need to explain, not today) :P took the Timed class away... rewrote it like the code bellow. [thank you]r. private int timedCount = 0; private void runTimed(Runner runner) { Thread thread = new Thread(runner, "Runner-".concat(String.valueOf(timedCount++))); Quest quest = runner.quest; thread.start(); try { thread.join(questTimeout); } catch (InterruptedException ex) { quest.logT(ex, EM_INTERRUPTED); } finally { if (thread.isAlive()) { thread.interrupt(); quest.logE(EM_TIMEOUT); runner.sponse.sendHTTPInternalError( "request handling timed out", quest); } else if (!thread.isInterrupted()) // runner not interrupted... runner.afterRun(); runner.finish(); runner = null; timedCount--; } } protected void handle(InnerQuest quest, Sponse sponse) { Runner runner = new Runner(quest, sponse); if (questTimeout > 0) //new Timed(runner).start(); runTimed(runner); else { timedCount++; runner.run(); runner.afterRun(); runner.finish(); timedCount--; } } On 7 July 2012 10:37, Niall Gallagher <gal...@ya...> wrote: > Asynchronous can mean a lot of things, if you are happy for it to work > like a servlet engine then you have done enough. The "asynchronous" part of > Simple means that no object is tied to the servicing thread, this means > callbacks can be done. If you do not use callbacks then you do not need to > use it. > > --- On *Sat, 7/7/12, -=}\*/{=- <rui...@gm...>* wrote: > > > From: -=}\*/{=- <rui...@gm...> > Subject: Re: [Simpleweb-Support] aren't "Dispacher-n" threads already > asynchronous? > To: "Simple support and user issues" < > sim...@li...> > Received: Saturday, 7 July, 2012, 2:17 AM > > > i'm not sure that i understood... > > that start method i mention in the first email does not do that?... > > i have the server working, answer the requests, sits as a daemon listening > to the desired ports and makes new threads "Dispatcher-n" for each > request... > isn't that being asynchronous? > > what confuses me is, that the tutorial has a chapter dedicated to that... > as if the first example that i followed was not asynchronous... it seams to > be, it logs several threads running in parallel... > > i just want to implement this the right way... and avoid having threads 3 > threads spawn when i can have only 2... > > never mind the error codes, exception, etc... > short and simple: does this code bellow creates a daemon that spawns > "Dispatch-0" threads asynchronously? > > connection = new SocketConnection(this); > for (int port: ports) > connection.connect(new InetSocketAddress(port)); > > if yes, can i take the Timed class out of the picture and do the timing > control in handle method ran by the "Dispatch-n" Thread? > if not, why not? what happens then? how can i do it? > > [thank you]r. > > On 7 July 2012 07:30, Kai Schutte <sch...@gm...<http://mc/compose?to=sch...@gm...> > > wrote: > > In a nearly every setup of Simple, you want to start Simple, then run a > Daemon thread to wait on / query requests... > > how you handle error codes & warning is completely up to you. > > -Kai > > On Sat, Jul 7, 2012 at 6:47 AM, -=}\*/{=- <rui...@gm...<http://mc/compose?to=rui...@gm...> > > wrote: > > hi again, > > i just finished this code and is working fine... but is this the "best" > approach? > > bellow is the inner code of my container class... > i'm creating 2 threads, one (Timed) that times the runner (Runner), but if > the "Dispatcher-n" thread is already asynchronous maybe makes more sense to > use it directly and move Timed.run() code to the handle method... > > []r. > > private class Runner implements Runnable { > > final InnerQuest quest; > final Sponse sponse; > boolean handled = false; > > Runner(InnerQuest iq, Sponse s) { > this.quest = iq; > this.sponse = s; > } > > @Override > public void run() { > try { > // cascade through contexts > for (Context c: contexts) > if (c.accepts(quest)) > if (c.handle(quest, sponse)) { > handled = true; > return; > } > else > quest.resetCascade(); > } catch (Exception e) { > quest.logT(e, EM_UNHANDLE); > } > } > > void afterRun() { > // if not handled... > if (!handled) // ... send 404 http error > sponse.sendHTTPError(Sponse.SC_404, Sponse.SCD_404, quest); > } > > void finish() { > sponse.finish(quest); > // log time > quest.logI("! %1$sms: %2$s%3$s", > System.currentTimeMillis() - quest.creationTime, > quest.getHeader(Quest.H_Host), quest.getUrlPath()); > // merge quest logger if exists > if (quest.hasOwnLogger()) > logI(quest.logger.toString()); > } > } > > private class Timed implements Runnable { > > private Runner runner; > private String namePostfix; > > public Timed(Runner r) { > this.runner = r; > } > > void start() { > namePostfix = String.valueOf(timedCount++); > new Thread(this, "TimedRunner-".concat(namePostfix)).start(); > } > > @Override > public void run() { > Thread thread = new Thread(runner, "Runner-".concat(namePostfix)); > Quest quest = runner.quest; > thread.start(); > try { > thread.join(questTimeout); > } catch (InterruptedException ex) { > quest.logT(ex, EM_INTERRUPTED); > } finally { > if (thread.isAlive()) { > thread.interrupt(); > quest.logE(EM_TIMEOUT); > runner.sponse.sendHTTPInternalError( > "request handling timed out", quest); > } else if (!thread.isInterrupted()) // runner not interrupted... > runner.afterRun(); > > runner.finish(); > runner = null; > timedCount--; > } > } > } > > protected void handle(InnerQuest quest, Sponse sponse) { > Runner runner = new Runner(quest, sponse); > if (questTimeout > 0) > new Timed(runner).start(); > else { > timedCount++; > runner.run(); > runner.afterRun(); > runner.finish(); > timedCount--; > } > } > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li...<http://mc/compose?to=Sim...@li...> > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li...<http://mc/compose?to=Sim...@li...> > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > -----Inline Attachment Follows----- > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > > -----Inline Attachment Follows----- > > > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li...<http://mc/compose?to=Sim...@li...> > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > |
From: Niall G. <gal...@ya...> - 2012-07-07 09:37:07
|
Asynchronous can mean a lot of things, if you are happy for it to work like a servlet engine then you have done enough. The "asynchronous" part of Simple means that no object is tied to the servicing thread, this means callbacks can be done. If you do not use callbacks then you do not need to use it. --- On Sat, 7/7/12, -=}\*/{=- <rui...@gm...> wrote: From: -=}\*/{=- <rui...@gm...> Subject: Re: [Simpleweb-Support] aren't "Dispacher-n" threads already asynchronous? To: "Simple support and user issues" <sim...@li...> Received: Saturday, 7 July, 2012, 2:17 AM i'm not sure that i understood... that start method i mention in the first email does not do that?... i have the server working, answer the requests, sits as a daemon listening to the desired ports and makes new threads "Dispatcher-n" for each request... isn't that being asynchronous? what confuses me is, that the tutorial has a chapter dedicated to that... as if the first example that i followed was not asynchronous... it seams to be, it logs several threads running in parallel... i just want to implement this the right way... and avoid having threads 3 threads spawn when i can have only 2... never mind the error codes, exception, etc...short and simple: does this code bellow creates a daemon that spawns "Dispatch-0" threads asynchronously? connection = new SocketConnection(this); for (int port: ports) connection.connect(new InetSocketAddress(port)); if yes, can i take the Timed class out of the picture and do the timing control in handle method ran by the "Dispatch-n" Thread? if not, why not? what happens then? how can i do it? [thank you]r. On 7 July 2012 07:30, Kai Schutte <sch...@gm...> wrote: In a nearly every setup of Simple, you want to start Simple, then run a Daemon thread to wait on / query requests... how you handle error codes & warning is completely up to you. -Kai On Sat, Jul 7, 2012 at 6:47 AM, -=}\*/{=- <rui...@gm...> wrote: hi again, i just finished this code and is working fine... but is this the "best" approach? bellow is the inner code of my container class...i'm creating 2 threads, one (Timed) that times the runner (Runner), but if the "Dispatcher-n" thread is already asynchronous maybe makes more sense to use it directly and move Timed.run() code to the handle method... []r. private class Runner implements Runnable { final InnerQuest quest; final Sponse sponse; boolean handled = false; Runner(InnerQuest iq, Sponse s) { this.quest = iq; this.sponse = s; } @Override public void run() { try { // cascade through contexts for (Context c: contexts) if (c.accepts(quest)) if (c.handle(quest, sponse)) { handled = true; return; } else quest.resetCascade(); } catch (Exception e) { quest.logT(e, EM_UNHANDLE); } } void afterRun() { // if not handled... if (!handled) // ... send 404 http error sponse.sendHTTPError(Sponse.SC_404, Sponse.SCD_404, quest); } void finish() { sponse.finish(quest); // log time quest.logI("! %1$sms: %2$s%3$s", System.currentTimeMillis() - quest.creationTime, quest.getHeader(Quest.H_Host), quest.getUrlPath()); // merge quest logger if exists if (quest.hasOwnLogger()) logI(quest.logger.toString()); } } private class Timed implements Runnable { private Runner runner; private String namePostfix; public Timed(Runner r) { this.runner = r; } void start() { namePostfix = String.valueOf(timedCount++); new Thread(this, "TimedRunner-".concat(namePostfix)).start(); } @Override public void run() { Thread thread = new Thread(runner, "Runner-".concat(namePostfix)); Quest quest = runner.quest; thread.start(); try { thread.join(questTimeout); } catch (InterruptedException ex) { quest.logT(ex, EM_INTERRUPTED); } finally { if (thread.isAlive()) { thread.interrupt(); quest.logE(EM_TIMEOUT); runner.sponse.sendHTTPInternalError( "request handling timed out", quest); } else if (!thread.isInterrupted()) // runner not interrupted... runner.afterRun(); runner.finish(); runner = null; timedCount--; } } } protected void handle(InnerQuest quest, Sponse sponse) { Runner runner = new Runner(quest, sponse); if (questTimeout > 0) new Timed(runner).start(); else { timedCount++; runner.run(); runner.afterRun(); runner.finish(); timedCount--; } } ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ -----Inline Attachment Follows----- _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: -=}\\*/{=- <rui...@gm...> - 2012-07-07 09:17:57
|
i'm not sure that i understood... that start method i mention in the first email does not do that?... i have the server working, answer the requests, sits as a daemon listening to the desired ports and makes new threads "Dispatcher-n" for each request... isn't that being asynchronous? what confuses me is, that the tutorial has a chapter dedicated to that... as if the first example that i followed was not asynchronous... it seams to be, it logs several threads running in parallel... i just want to implement this the right way... and avoid having threads 3 threads spawn when i can have only 2... never mind the error codes, exception, etc... short and simple: does this code bellow creates a daemon that spawns "Dispatch-0" threads asynchronously? connection = new SocketConnection(this); for (int port: ports) connection.connect(new InetSocketAddress(port)); if yes, can i take the Timed class out of the picture and do the timing control in handle method ran by the "Dispatch-n" Thread? if not, why not? what happens then? how can i do it? [thank you]r. On 7 July 2012 07:30, Kai Schutte <sch...@gm...> wrote: > In a nearly every setup of Simple, you want to start Simple, then run a > Daemon thread to wait on / query requests... > > how you handle error codes & warning is completely up to you. > > -Kai > > On Sat, Jul 7, 2012 at 6:47 AM, -=}\*/{=- <rui...@gm...> wrote: > >> hi again, >> >> i just finished this code and is working fine... but is this the "best" >> approach? >> >> bellow is the inner code of my container class... >> i'm creating 2 threads, one (Timed) that times the runner (Runner), but >> if the "Dispatcher-n" thread is already asynchronous maybe makes more sense >> to use it directly and move Timed.run() code to the handle method... >> >> []r. >> >> private class Runner implements Runnable { >> >> final InnerQuest quest; >> final Sponse sponse; >> boolean handled = false; >> >> Runner(InnerQuest iq, Sponse s) { >> this.quest = iq; >> this.sponse = s; >> } >> >> @Override >> public void run() { >> try { >> // cascade through contexts >> for (Context c: contexts) >> if (c.accepts(quest)) >> if (c.handle(quest, sponse)) { >> handled = true; >> return; >> } >> else >> quest.resetCascade(); >> } catch (Exception e) { >> quest.logT(e, EM_UNHANDLE); >> } >> } >> >> void afterRun() { >> // if not handled... >> if (!handled) // ... send 404 http error >> sponse.sendHTTPError(Sponse.SC_404, Sponse.SCD_404, quest); >> } >> >> void finish() { >> sponse.finish(quest); >> // log time >> quest.logI("! %1$sms: %2$s%3$s", >> System.currentTimeMillis() - quest.creationTime, >> quest.getHeader(Quest.H_Host), quest.getUrlPath()); >> // merge quest logger if exists >> if (quest.hasOwnLogger()) >> logI(quest.logger.toString()); >> } >> } >> >> private class Timed implements Runnable { >> >> private Runner runner; >> private String namePostfix; >> >> public Timed(Runner r) { >> this.runner = r; >> } >> >> void start() { >> namePostfix = String.valueOf(timedCount++); >> new Thread(this, "TimedRunner-".concat(namePostfix)).start(); >> } >> >> @Override >> public void run() { >> Thread thread = new Thread(runner, "Runner-".concat(namePostfix)); >> Quest quest = runner.quest; >> thread.start(); >> try { >> thread.join(questTimeout); >> } catch (InterruptedException ex) { >> quest.logT(ex, EM_INTERRUPTED); >> } finally { >> if (thread.isAlive()) { >> thread.interrupt(); >> quest.logE(EM_TIMEOUT); >> runner.sponse.sendHTTPInternalError( >> "request handling timed out", quest); >> } else if (!thread.isInterrupted()) // runner not interrupted... >> runner.afterRun(); >> >> runner.finish(); >> runner = null; >> timedCount--; >> } >> } >> } >> >> protected void handle(InnerQuest quest, Sponse sponse) { >> Runner runner = new Runner(quest, sponse); >> if (questTimeout > 0) >> new Timed(runner).start(); >> else { >> timedCount++; >> runner.run(); >> runner.afterRun(); >> runner.finish(); >> timedCount--; >> } >> } >> >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> Simpleweb-Support mailing list >> Sim...@li... >> https://lists.sourceforge.net/lists/listinfo/simpleweb-support >> >> > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > |
From: Kai S. <sch...@gm...> - 2012-07-07 06:31:05
|
In a nearly every setup of Simple, you want to start Simple, then run a Daemon thread to wait on / query requests... how you handle error codes & warning is completely up to you. -Kai On Sat, Jul 7, 2012 at 6:47 AM, -=}\*/{=- <rui...@gm...> wrote: > hi again, > > i just finished this code and is working fine... but is this the "best" > approach? > > bellow is the inner code of my container class... > i'm creating 2 threads, one (Timed) that times the runner (Runner), but if > the "Dispatcher-n" thread is already asynchronous maybe makes more sense to > use it directly and move Timed.run() code to the handle method... > > []r. > > private class Runner implements Runnable { > > final InnerQuest quest; > final Sponse sponse; > boolean handled = false; > > Runner(InnerQuest iq, Sponse s) { > this.quest = iq; > this.sponse = s; > } > > @Override > public void run() { > try { > // cascade through contexts > for (Context c: contexts) > if (c.accepts(quest)) > if (c.handle(quest, sponse)) { > handled = true; > return; > } > else > quest.resetCascade(); > } catch (Exception e) { > quest.logT(e, EM_UNHANDLE); > } > } > > void afterRun() { > // if not handled... > if (!handled) // ... send 404 http error > sponse.sendHTTPError(Sponse.SC_404, Sponse.SCD_404, quest); > } > > void finish() { > sponse.finish(quest); > // log time > quest.logI("! %1$sms: %2$s%3$s", > System.currentTimeMillis() - quest.creationTime, > quest.getHeader(Quest.H_Host), quest.getUrlPath()); > // merge quest logger if exists > if (quest.hasOwnLogger()) > logI(quest.logger.toString()); > } > } > > private class Timed implements Runnable { > > private Runner runner; > private String namePostfix; > > public Timed(Runner r) { > this.runner = r; > } > > void start() { > namePostfix = String.valueOf(timedCount++); > new Thread(this, "TimedRunner-".concat(namePostfix)).start(); > } > > @Override > public void run() { > Thread thread = new Thread(runner, "Runner-".concat(namePostfix)); > Quest quest = runner.quest; > thread.start(); > try { > thread.join(questTimeout); > } catch (InterruptedException ex) { > quest.logT(ex, EM_INTERRUPTED); > } finally { > if (thread.isAlive()) { > thread.interrupt(); > quest.logE(EM_TIMEOUT); > runner.sponse.sendHTTPInternalError( > "request handling timed out", quest); > } else if (!thread.isInterrupted()) // runner not interrupted... > runner.afterRun(); > > runner.finish(); > runner = null; > timedCount--; > } > } > } > > protected void handle(InnerQuest quest, Sponse sponse) { > Runner runner = new Runner(quest, sponse); > if (questTimeout > 0) > new Timed(runner).start(); > else { > timedCount++; > runner.run(); > runner.afterRun(); > runner.finish(); > timedCount--; > } > } > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > |
From: -=}\\*/{=- <rui...@gm...> - 2012-07-07 04:47:47
|
hi again, i just finished this code and is working fine... but is this the "best" approach? bellow is the inner code of my container class... i'm creating 2 threads, one (Timed) that times the runner (Runner), but if the "Dispatcher-n" thread is already asynchronous maybe makes more sense to use it directly and move Timed.run() code to the handle method... []r. private class Runner implements Runnable { final InnerQuest quest; final Sponse sponse; boolean handled = false; Runner(InnerQuest iq, Sponse s) { this.quest = iq; this.sponse = s; } @Override public void run() { try { // cascade through contexts for (Context c: contexts) if (c.accepts(quest)) if (c.handle(quest, sponse)) { handled = true; return; } else quest.resetCascade(); } catch (Exception e) { quest.logT(e, EM_UNHANDLE); } } void afterRun() { // if not handled... if (!handled) // ... send 404 http error sponse.sendHTTPError(Sponse.SC_404, Sponse.SCD_404, quest); } void finish() { sponse.finish(quest); // log time quest.logI("! %1$sms: %2$s%3$s", System.currentTimeMillis() - quest.creationTime, quest.getHeader(Quest.H_Host), quest.getUrlPath()); // merge quest logger if exists if (quest.hasOwnLogger()) logI(quest.logger.toString()); } } private class Timed implements Runnable { private Runner runner; private String namePostfix; public Timed(Runner r) { this.runner = r; } void start() { namePostfix = String.valueOf(timedCount++); new Thread(this, "TimedRunner-".concat(namePostfix)).start(); } @Override public void run() { Thread thread = new Thread(runner, "Runner-".concat(namePostfix)); Quest quest = runner.quest; thread.start(); try { thread.join(questTimeout); } catch (InterruptedException ex) { quest.logT(ex, EM_INTERRUPTED); } finally { if (thread.isAlive()) { thread.interrupt(); quest.logE(EM_TIMEOUT); runner.sponse.sendHTTPInternalError( "request handling timed out", quest); } else if (!thread.isInterrupted()) // runner not interrupted... runner.afterRun(); runner.finish(); runner = null; timedCount--; } } } protected void handle(InnerQuest quest, Sponse sponse) { Runner runner = new Runner(quest, sponse); if (questTimeout > 0) new Timed(runner).start(); else { timedCount++; runner.run(); runner.afterRun(); runner.finish(); timedCount--; } } |
From: -=}\\*/{=- <rui...@gm...> - 2012-07-06 21:59:50
|
hi, i read your tutorial, apart of being outdated, i do not understand how the threads work... is not a server configured as in first example of the tutorial already asynchronous? here is an output of my logs... and it seams asynchronous... i did have to synchronize the logger: I: Dispatcher-68 @ 12.07.06.21.59.31 [1341608371407] ! @ abc.kis.handler.kml.KMLHandler I: Dispatcher-68 @ 12.07.06.21.59.31 [1341608371438] ! 286ms: localhost:8086/ I: Dispatcher-70 @ 12.07.06.21.59.31 [1341608371446] * localhost:8086/static/script/color.js I: Dispatcher-69 @ 12.07.06.21.59.31 [1341608371459] * localhost:8086/css/base.css I: Dispatcher-70 @ 12.07.06.21.59.31 [1341608371507] > localhost >>> kis.alphabit.org I: Dispatcher-69 @ 12.07.06.21.59.31 [1341608371511] > localhost >>> kis.alphabit.org I: Dispatcher-70 @ 12.07.06.21.59.31 [1341608371518] > kis.alphabit.org >>> common I: Dispatcher-69 @ 12.07.06.21.59.31 [1341608371523] i want to control the timeout for each request handling... so i would like to better understand what is the best approach. thank you, best wishes, rui ps: bellow is the method that i use to start the Container (ie. this) public void start() { logI("Starting server at %1$s.", portsToString()); try { connection = new SocketConnection(this); for (int port: ports) try { connection.connect(new InetSocketAddress(port)); } catch (IOException ioe) { logE("Unable to connect to port %1$d: %2$s", port, ioe.getMessage()); } } catch (IOException ioe) { logE("Unable to create a %1$s: %2$s", SocketConnection.class.getName(), ioe.getMessage()); } if (ps.length() > 0) logI("Server started at:%1$s", ps); } |
From: Niall G. <gal...@ya...> - 2012-05-21 21:27:30
|
A better option for you is the @Commit and @Persist annotations, they are called after a read and write respectively, you can modify fields there also. If value returns null, then nothing has been set in the output node. --- On Mon, 21/5/12, Antanas Kaziliūnas <ant...@gm...> wrote: From: Antanas Kaziliūnas <ant...@gm...> Subject: [Simpleweb-Support] Using Visitor: Node.getValue always returns null To: sim...@li... Received: Monday, 21 May, 2012, 5:39 AM Hello everyone, I am writing a Visitor, which intercepts the serialization process - I need to scramble sensitive fields. In the method: public void write(Type type, NodeMap<OutputNode> node) node.getValue is always null. Is this normal behavior? Modifying the value without actually knowing the value makes it pretty useless. Writing a Converter was considered as an option, but it has greater impact to the code. Best, Antanas ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Simpleweb-Support mailing list Sim...@li... https://lists.sourceforge.net/lists/listinfo/simpleweb-support |
From: Antanas K. <ant...@gm...> - 2012-05-21 12:39:15
|
Hello everyone, I am writing a Visitor, which intercepts the serialization process - I need to scramble sensitive fields. In the method: public void write(Type type, NodeMap<OutputNode> node) node.getValue is always null. Is this normal behavior? Modifying the value without actually knowing the value makes it pretty useless. Writing a Converter was considered as an option, but it has greater impact to the code. Best, Antanas |
From: -=}\\*/{=- <rui...@gm...> - 2012-04-30 09:32:53
|
http://www.simpleframework.org/doc/javadoc/org/simpleframework/http/session/Observer.html "Once the session is created the observer start method is invoked ..." the name of the method is create. |
From: Andrew B. <and...@de...> - 2012-04-14 10:33:32
|
I think the issue can be fixed with the following amendments to DispositionParser.java, which ensures that the value is only terminated by a matching character. I haven't run the full test harness with this fix in place but I did make amendments to DispositionParserTest to verify it worked for a number of use cases. I'm not sure if you're actively developing Simple, but this may be worth including - unless there's a better solution; this may be a bit naive. Regards, AndyB /** * This is used to read a parameters value from the buf. This will read all * <code>char</code>'s upto but excluding the first terminal <code>char</code> * encountered from the off within the buf, or if the value is a literal * it will read a literal from the buffer (literal is any data between * quotes except if the quote is prefixed with a backward slash character). * * @param value */ private void value(ParseBuffer value) { if (quote(buf[off])) { char endquote = buf[off]; for (off++; off < count; ) { if (endquote == buf[off]) { if (buf[++off - 2] != '\\') { break; } } value.append(buf[off++]); } } else { while (off < count) { if (buf[off] == ';') { break; } value.append(buf[off]); off++; } } } Andy Barlow - IT Consultant - MBCS CENG EURING CITP e: and...@de... t: +44 (0)7830 302 268 The information in this email or facsimile is confidential and is intended solely for the addressee(s) and access to this email or facsimile by anyone else is unauthorised. If you are not the intended recipient then any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. Information expressed in this email or facsimile is not given or endorsed by my firm or employer unless otherwise indicated by an authorised representative independent of this message. |
From: Andrew B. <and...@de...> - 2012-04-14 10:33:32
|
Have been happily using Simple for some time as an embedded HTTP server, and it has performed fantastically well. I came up against a strange issue today when trying to upload a file. Normally files don't have ' or " in them, but they are valid characters. So I have a file called Centre of 'Excellence' basic session "plan" - week 6 to 10.pdf and when I upload it all I "see" in the filename when debugging is Centre of Looking a Firebug, what is being sent up is: Content-Disposition: form-data; name="file"; filename="Centre of 'Excellence' basic session \"plan\" - week 6 to 10.pdf" and looking in the source code to DispositionParser.java it would appear it considers the ' before Excellence to be the end of the string: /** * This method is used to determine if the specified character is a quote * character. The quote character is typically used as a boundary for the * values within the header. This accepts a single or double quote. * * @param ch the character to determine if it is a quotation * * @return true if the character provided is a quotation character */ private boolean quote(char ch) { return ch == '\'' || ch == '"'; } } Is this a bug - shouldn't it be looking for a matching " that's not escaped by a back-slash? Or do some browsers send up different strings, making it impossible to have a generic algorithm? Andy Barlow - IT Consultant - MBCS CENG EURING CITP e: and...@de... t: +44 (0)7830 302 268 The information in this email or facsimile is confidential and is intended solely for the addressee(s) and access to this email or facsimile by anyone else is unauthorised. If you are not the intended recipient then any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. Information expressed in this email or facsimile is not given or endorsed by my firm or employer unless otherwise indicated by an authorised representative independent of this message. |
From: özhan d. <ozh...@gm...> - 2012-03-26 11:06:04
|
Hi, I would look like to change keep-alive timeout for simple. How could i do without touching simple source code. Thanks in advance |
From: Deborah M. <mar...@gm...> - 2012-03-06 18:11:21
|
Hello, I've known you website for ages, strictly speaking from year 2009. I found interesting your publication Simple 4.1.21 which I googled on http://www.simpleframework.org/ ! I'd love to use it in a project I'm involved with called "WHW Science", so I'm seeking your permission. "WH Science" is a freemium-model non-English language orientated startup with collection of scientific articles, personal notes etc. in several languages that is collaboratively edited by volunteers from around the world since 1999. Young and old, students and professors - even your neighbor could be a volunteer member. If you agree, we will credit you for your work in the resulting translation's references by stating that it was based on your work and is used with your permission, and by mentioning the name of my project "WH Science" back to: http://www.simpleframework.org/ Thank you for your time and patience. I look forward to your response next week. --- Best wishes, Deborah Markovski Skopje, Macedonia 06.03.2012 Translation for Education FAQ - http://goo.gl/q9Oq9 |
From: <dav...@bt...> - 2012-02-29 11:35:59
|
Hi, This message is to report a bug that we encountered with Simple Framework 4.1.21 running on Windows 7. The bug was diagnosed using Fiddler2. Reproduction Steps: 1) Create a simple HelloWorld application as found here<http://www.simpleframework.org/doc/tutorial/tutorial.php>. 2) Create a request with a header sized 1536 in Fiddler2 (we modified an existing request to be exactly 1536). 3) Watch if fail. Thoughts/Observations: The same request with a header sized 1537 & 1535 (added/remove characters from http-referrer) works perfectly. This bug was noticed in a production scenario as we had a large query string, only occurred in firefox because of the unique combination of headers. Crazy bug, no idea what the cause may be. We've worked around the issue by padding the header with meaningless data to ensure we don't hit 1536. Cheers, David |
From: -=}\\*/{=- <rui...@gm...> - 2011-12-23 12:16:26
|
was already in the list... obviously :) http://sourceforge.net/mailarchive/forum.php?thread_name=838C9014F7E13841B1F711C5DC2B42F3327B5728%40LONMC01032.rbsres07.net&forum_name=simpleweb-support ty... the things i didn't know... :) On 23 December 2011 03:00, -=}\*/{=- <rui...@gm...> wrote: > hi, > > the Address returned by the Request returns null for getDomain() and -1 > for getPort() > toString() returns only the path and query... > > what can i be doing wrong? > > [] rui > |