simpleweb-support Mailing List for Simple (Page 25)
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: Niall G. <gal...@ya...> - 2005-12-12 14:40:06
|
Hi Brian, Although this is probably a good fit for what you are doing, how well will this scale? If your application grows to incorporate many actions, this scheme will add too much complexity as services are going to be coupled, also loading order seems to determine which service is used. You should at the very least consider scoring the canSearch. I think that the URI based scheme is what it is, its a resource identifier, and should be used as such. If a URI scheme does not meet your needs you can always add to the controller using a RedirectService. public class MyController extends RedirectService { public Resource redirect(Request req, Response resp) { // do somthing ... if(someCondition(request)) { return lookup("someService"); } return lookup("someOtherService"); } } This allows you to augment the URI mapping scheme to include some logic before deciding which service is to handle the request. Niall --- Brian Davis <wic...@gm...> wrote: > replaces the need for protocol handlers and a > uri-based resolver imo > > more code provided upon request... > > public class Server > { > public Server(Host host) throws Exception > { > _host = host; > > _loader = new SerialLoaderEngine(); > > Iterator it = host.roots(); > > while (it.hasNext()) > { > _loader.addContext(new > ServerContext((File) it.next(), this)); > } > > > _loader.register("com.wickedfastsolutions.server.app.HeaderService"); > > _loader.register("com.wickedfastsolutions.server.app.SandboxService"); > > _loader.register("com.wickedfastsolutions.server.app.ProtocolService"); > > if > (getHost().getAddress().equals("127.0.0.1")) > { > > _loader.register("com.wickedfastsolutions.server.app.CoberturaService"); > } > > > _loader.register("com.wickedfastsolutions.server.app.DirectoryListingService"); > > _loader.register("com.wickedfastsolutions.server.app.FreeMarkerService"); > > _loader.register("com.wickedfastsolutions.server.app.FileService"); > > Connection connection = > ConnectionFactory.getConnection(_loader); > > connection.connect(new > ServerSocket(_host.getPort(), 50, > InetAddress.getByName(_host.getAddress()))); > > System.err.println("Current Time is " + new > Date()); > System.err.println("Server is running at " + > _host.getAddress() + " port " + _host.getPort()); > } > > public static void main(String[] args) throws > Exception > { > PrintStream out = new PrintStream(new > FileOutputStream("err.txt")); > > System.setOut(out); > System.setErr(out); > > Host host = new Host(); > > host.addRoot(new File("test")); > > host.setAddress("127.0.0.1"); > host.setPort(2000); > > _server = new Server(host); > } > > public Host getHost() > { > return _host; > } > > public SerialLoaderEngine getLoaderEngine() > { > return _loader; > } > > private Host _host; > private SerialLoaderEngine _loader; > private static Server _server; > } > > > > public class HeaderService extends SerialService > { > public HeaderService(Context context) > { > super(context); > } > > public boolean canHandle(Request req, Response > res) > { > res.set("Server", > "www.wickedfastsolutions.com"); > > res.setDate("Date", > System.currentTimeMillis()); > > res.setMajor(1); > res.setMinor(1); > > res.set("Content-Type", > MimeTypes.parse(req.getURI())); > > return false; > } > > public void process(Request req, Response res) > throws Exception > { > handle(req, res); > } > } > > > public class SandboxService extends SerialService > { > public SandboxService(Context context) > { > super(context); > } > > public boolean canHandle(Request req, Response > res) > { > try > { > // ensure that this url is properly > encoded as iso-8859-1 and > // not some overlong UTF-8 sequence.. by > doing the > transcoding myself > > int[] decoded = > CharsetRegistery.getCharset("iso-8859-1").decode(req.getURI().getBytes("UTF-8")); > > Unicode uri = new Unicode(decoded, 0, > decoded.length); > > // Requests with ../ or ..\\ in the url > are not allowed. > The security implications for potentially > // being allowed outside the web > template sandbox far > out-weigh the benefits of these types of url's. > // I recommend using url's relative to > the web template > directory only. At first I returned this > // warning but then upon further > consideration thought > that the person or program sending the request > // might misinterpret my response for a > success and try to > continue hacking as opposed to moving along > > if (uri.indexOf("..") != -1 || > uri.indexOf("./") != -1 || > uri.indexOf(".\\") != -1 || uri.endsWith(".")) > { > return true; > } > } > > catch (Exception ex) > { > return true; > } > > return false; > } > > public void process(Request req, Response res) > throws Exception > { > handle(req, res, 404); > } > } > > > public class ProtocolService extends SerialService > { > public ProtocolService(Context context) > { > super(context); > } > > public boolean canHandle(Request req, Response > res) > { > if (!req.getMethod().equals("GET") && > !req.getMethod().equals("HEAD")) > { > === message truncated === Niall Gallagher __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Brian D. <wic...@gm...> - 2005-12-11 17:47:47
|
replaces the need for protocol handlers and a uri-based resolver imo more code provided upon request... public class Server { public Server(Host host) throws Exception { _host =3D host; _loader =3D new SerialLoaderEngine(); Iterator it =3D host.roots(); while (it.hasNext()) { _loader.addContext(new ServerContext((File) it.next(), this)); } _loader.register("com.wickedfastsolutions.server.app.HeaderService"= ); _loader.register("com.wickedfastsolutions.server.app.SandboxService= "); _loader.register("com.wickedfastsolutions.server.app.ProtocolServic= e"); if (getHost().getAddress().equals("127.0.0.1")) { _loader.register("com.wickedfastsolutions.server.app.CoberturaS= ervice"); } _loader.register("com.wickedfastsolutions.server.app.DirectoryListi= ngService"); _loader.register("com.wickedfastsolutions.server.app.FreeMarkerServ= ice"); _loader.register("com.wickedfastsolutions.server.app.FileService"); Connection connection =3D ConnectionFactory.getConnection(_loader); connection.connect(new ServerSocket(_host.getPort(), 50, InetAddress.getByName(_host.getAddress()))); System.err.println("Current Time is " + new Date()); System.err.println("Server is running at " + _host.getAddress() + " port " + _host.getPort()); } public static void main(String[] args) throws Exception { PrintStream out =3D new PrintStream(new FileOutputStream("err.txt")= ); System.setOut(out); System.setErr(out); Host host =3D new Host(); host.addRoot(new File("test")); host.setAddress("127.0.0.1"); host.setPort(2000); _server =3D new Server(host); } public Host getHost() { return _host; } public SerialLoaderEngine getLoaderEngine() { return _loader; } private Host _host; private SerialLoaderEngine _loader; private static Server _server; } public class HeaderService extends SerialService { public HeaderService(Context context) { super(context); } public boolean canHandle(Request req, Response res) { res.set("Server", "www.wickedfastsolutions.com"); res.setDate("Date", System.currentTimeMillis()); res.setMajor(1); res.setMinor(1); res.set("Content-Type", MimeTypes.parse(req.getURI())); return false; } public void process(Request req, Response res) throws Exception { handle(req, res); } } public class SandboxService extends SerialService { public SandboxService(Context context) { super(context); } public boolean canHandle(Request req, Response res) { try { // ensure that this url is properly encoded as iso-8859-1 and // not some overlong UTF-8 sequence.. by doing the transcoding myself int[] decoded =3D CharsetRegistery.getCharset("iso-8859-1").decode(req.getURI().getBytes("UTF= -8")); Unicode uri =3D new Unicode(decoded, 0, decoded.length); // Requests with ../ or ..\\ in the url are not allowed. The security implications for potentially // being allowed outside the web template sandbox far out-weigh the benefits of these types of url's. // I recommend using url's relative to the web template directory only. At first I returned this // warning but then upon further consideration thought that the person or program sending the request // might misinterpret my response for a success and try to continue hacking as opposed to moving along if (uri.indexOf("..") !=3D -1 || uri.indexOf("./") !=3D -1 || uri.indexOf(".\\") !=3D -1 || uri.endsWith(".")) { return true; } } catch (Exception ex) { return true; } return false; } public void process(Request req, Response res) throws Exception { handle(req, res, 404); } } public class ProtocolService extends SerialService { public ProtocolService(Context context) { super(context); } public boolean canHandle(Request req, Response res) { if (!req.getMethod().equals("GET") && !req.getMethod().equals("HEAD= ")) { return true; } if (req.getMajor() !=3D 1) { return true; } if (req.getMinor() !=3D 0 && req.getMinor() !=3D 1) { return true; } // validate uri return false; } public void process(Request req, Response res) throws Exception { handle(req, res, 501); } } public class CoberturaService extends SerialService { public CoberturaService(Context context) { super(context); } public boolean canHandle(Request req, Response res) { return req.getURI().equals("/index.flush"); } public void process(Request req, Response res) throws Exception { // flush cobertura data String className =3D "net.sourceforge.cobertura.coveragedata.Projec= tData"; String methodName =3D "saveGlobalProjectData"; Class saveClass =3D Class.forName(className); java.lang.reflect.Method saveMethod =3D saveClass.getDeclaredMethod(methodName, new Class[0]); saveMethod.invoke(null,new Object[0]); handle(req, res, 200); } } public class FileService extends SerialService { public FileService(Context context) { super(context); _engine =3D new FileEngine(context); } public boolean canHandle(Request req, Response res) { return true; } public void process(Request req, Response res) throws Exception { _engine.resolve(req.getURI()).handle(req, res); } private FileEngine _engine; } |
From: Brian D. <wic...@gm...> - 2005-12-09 20:01:18
|
Hmm... ignore this.. Thanks! Brian On 12/9/05, Brian Davis <wic...@gm...> wrote: > Hmm.. > > Wierd problem with the dequeue() method in which it never completes.... > > see attached... > > > |
From: Brian D. <wic...@gm...> - 2005-12-09 19:55:48
|
included /Users/wickedfast/Desktop/scheduler.jar |
From: Niall G. <gal...@ya...> - 2005-12-08 21:37:16
|
Hi Brian, This looks like it will work. However, how are you implementing your model? It is often good to have an empty shell service that can interact with your applications data, and then push this data into the template. If you are implementing a FreemarkerService, how is this achieved? For example: public Document execute(Request a, Response b, Document c) { MyData d = MyModel.someOperation(); c.put("data", d); return c; } Niall --- Brian Davis <wic...@gm...> wrote: > Hi Niall > > Actually.. I am looking to implement the following.. > Basically.. the > idea is that instead of using the resolver to > resolve to the correct > service.. the engine would instead ask each > registered service to > handle the request, in succession.. > > for each service > { > int status = service.handle(req, res); > > if (status == HANDLED) > { > break; > } > } > > Any thoughts? > > public class Server throws Exception > { > public Server(Host host) > { > _host = host; > > _loader = new SerialLoader(); > > Iterator it = host.roots(); > > while (it.hasNext()) > { > _loader.addContext(new FileContext(root)); > } > > > _loader.register("com.wickedfastsolutions.server.app.KillService"); > > _loader.register("com.wickedfastsolutions.server.app.ProtocolHandlerService"); > > _loader.register("com.wickedfastsolutions.server.app.DiretoryListingService"); > > _loader.register("com.wickedfastsolutions.server.app.FreeMarkerService"); > > _loader.register("com.wickedfastsolutions.server.app.FileService"); > > ProtocolHandler handler = > ProtocolHandlerFactory.getInstance(_loader); > > Connection connection = > ConnectionFactory.getConnection(handler); > > connection.connect(new > ServerSocket(_host.getPort(), 50, > InetAddress.getByName(_host.getAddress()))); > > System.err.println("Current Time is " + new > Date()); > System.err.println("Server is running at " + > _host.getAddress() + " port " + _host.getPort()); > } > > public static void main(String[] args) throws > Exception > { > Host host = new Host(); > > host.addRoot(new File("test/carol")); > host.addRoot(new File("test/templates1")); > host.addRoot(new File("test/templates2")); > > host.addRoot(new File("test")); > host.setAddress("127.0.0.1"); > host.setPort(2000); > > _server = new Server(host); > } > > public static Server getServer() > { > return _server; > } > > public Host getHost() > { > return _host; > } > > public SerialLoader getLoader() > { > return _loader; > } > > private Host _host; > private SerialLoader _loader; > private static Server _server; > } > > > On 12/2/05, Niall Gallagher > <gal...@ya...> wrote: > > Hi Brian, > > > > With regard to directory references that do not > end > > with "/", this is handled in the FileEngine > > implementation. You can delegate to this when you > have > > to download static content such as images. > > > > Regarding content based resolving, it would > certainly > > be an attractive feature. However, how does a > template > > engine know which files are templates? A template > with > > no template markup is still a template. In any > event > > the templating system may have to parse the > template > > to figure out if it is a template, which could be > > slow. I cannot comment too much on Freemarker, is > it > > able to peek into files and determine whether it > is a > > template or not? > > > > Finally, why not resolve in reverse. For instance > let > > everything be a template, and match images and > other > > non-text content to a specific service. For > instance > > > > resolve match="*" name="template" > > type="example.TemplateService" > > resolve match="/*.zip" name="file" > > type="example.FileService" > > resolve match="/images/*" name="file" > > type="example.FileService" > > > > Something that may interest you is the tiles > > implementation in simple.template. It does not use > a > > file extension, instead it caches mismatches. So > it > > assumes everything is a template, if after a peek > it > > turns out not to be this information is cached, so > a > > second peek is not performed. This somewhat > reduces > > the overhead of peeking into the file. > > > > Niall > > > > --- Brian Davis <wic...@gm...> wrote: > > > > > Hmm.. > > > > > > The URL resolver is useful under certain > contexts... > > > However.. I can > > > envision at least 2 scenerios in which I would > have > > > better luck with a > > > content based resolver. Let me illustrate.. > > > > > > Let's say for example that I want to have a url > > > resolve to my > > > directorylistingservice... how would i write a > regex > > > to support that.. > > > while link */ is easy.. what about urls that > don't > > > end in /.. > > > > > > a more appropriate check might be .... if (new > > > File(requestPath).isDirectory() && canRead()) > > > > > > Scenerio two.. > > > > > > Basically I want to use a template engine such > as > > > FreeMarker on files. > > > However, I want to use the simple framework to > > > return everything > > > else.. (those things that are not FreeMarker > > > templates)... Now you > > > might say that link("*.ftl", FreeMarkerService) > is > > > the way to do it.. > > > > > > However, it would be better if I could forget > the > > > file extension and > > > use FreeMarker syntax in .txt, .html, .csv, > .xml.. > > > in this way the web > === message truncated === Niall Gallagher __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Brian D. <wic...@gm...> - 2005-12-08 21:00:08
|
SGkgTmlhbGwKCkFjdHVhbGx5Li4gSSBhbSBsb29raW5nIHRvIGltcGxlbWVudCB0aGUgZm9sbG93 aW5nLi4gQmFzaWNhbGx5Li4gdGhlCmlkZWEgaXMgdGhhdCBpbnN0ZWFkIG9mIHVzaW5nIHRoZSBy ZXNvbHZlciB0byByZXNvbHZlIHRvIHRoZSBjb3JyZWN0CnNlcnZpY2UuLiB0aGUgZW5naW5lIHdv dWxkIGluc3RlYWQgYXNrIGVhY2ggcmVnaXN0ZXJlZCBzZXJ2aWNlIHRvCmhhbmRsZSB0aGUgcmVx dWVzdCwgaW4gc3VjY2Vzc2lvbi4uCgpmb3IgZWFjaCBzZXJ2aWNlCnsKICAgICBpbnQgc3RhdHVz ID0gc2VydmljZS5oYW5kbGUocmVxLCByZXMpOwoKICAgICBpZiAoc3RhdHVzID09IEhBTkRMRUQp CiAgICAgewogICAgICAgICBicmVhazsKICAgICB9Cn0KCkFueSB0aG91Z2h0cz8KCnB1YmxpYyBj bGFzcyBTZXJ2ZXIgdGhyb3dzIEV4Y2VwdGlvbgp7CglwdWJsaWMgU2VydmVyKEhvc3QgaG9zdCkK CXsKCQlfaG9zdCA9IGhvc3Q7CgkKCQlfbG9hZGVyID0gbmV3IFNlcmlhbExvYWRlcigpOwoJCgkJ SXRlcmF0b3IgaXQgPSBob3N0LnJvb3RzKCk7CgkJCgkJd2hpbGUgKGl0Lmhhc05leHQoKSkKCQl7 Cg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aCBsb2cgZmls ZXMKPiBmb3IgcHJvYmxlbXM/ICBTdG9wISAgRG93bmxvYWQgdGhlIG5ldyBBSkFYIHNlYXJjaCBl bmdpbmUgdGhhdCBtYWtlcwo+IHNlYXJjaGluZyB5b3VyIGxvZyBmaWxlcyBhcyBlYXN5IGFzIHN1 cmZpbmcgdGhlICB3ZWIuICBET1dOTE9BRCBTUExVTkshCj4gaHR0cDovL2Fkcy5vc2RuLmNvbS8/ YWRfaWQ9NzYzNyZhbGxvY19pZD0xNjg2NSZvcD1jbGljawo+IF9fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fCj4gU2ltcGxld2ViLVN1cHBvcnQgbWFpbGluZyBs aXN0Cj4gU2ltcGxld2ViLVN1cHBvcnRAbGlzdHMuc291cmNlZm9yZ2UubmV0Cj4gaHR0cHM6Ly9s aXN0cy5zb3VyY2Vmb3JnZS5uZXQvbGlzdHMvbGlzdGluZm8vc2ltcGxld2ViLXN1cHBvcnQKPgo= |
From: Niall G. <gal...@ya...> - 2005-12-08 01:27:37
|
Hi, All input, be it a URI, URI parameters, or POSTed parameters are (by specification) meant to be ISO-8859-1. UTF is supported in the % HEX HEX escaping done by the client. You should have to do no character encoding anywhere in Simple. All characters are converted correctly, or should be. So, as Martin said, inString.getBytes("ISO-8859-1") will result in a conversion from Java UCS-2 (which is 16-bit) to ISO-8859-1 which is (8-bit). Resulting in a mangled string. Niall --- Martin Norrsken <mar...@gm...> wrote: > on 12/7/05, Carfield Yim <car...@gm...> wrote: > > > > > > I dont quite understand this? Java Strings are > charset-neutral as far > > > as i know (and always stored internally as > UTF-16), so there is no > > > need to "convert" a string to anything as the > string does not retain > > > charset information. The only conversion is dont > at Input/Output > > > stream level or when encoding to other formats > (such as URLEncoder). > > > > > In some servlet container (tomcat and jetty as I > know) If you submit > > multibytes character in HTML form, it will > incorrectly assume that it > > is "ISO-8859-1", and return the incorrect encoded > string at > > request.getparameter() method. In order to get > back the correct > > string, I need to do the above. > > I see how it works now. Anyway might it have > something to do with the > fact that SimpleWeb actually tries to decode query > parameters > submitted in UTF-8 as i see the ParameterParser and > URIParse classes > does? I would think this causes a problem if the > input is already in > UTF and when you do inString.getBytes("ISO-8859-1") > you get the ISO > representations of characters (for example you get > the string > "Björnbär" which is already correct), which will > mess up when trying > to encode these into UTF-8 again (which will result > in "Bj?rnb?"). > > /Martin > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do > you grep through log files > for problems? Stop! Download the new AJAX search > engine that makes > searching your log files as easy as surfing the > web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_idv37&alloc_id865&op=click > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > Niall Gallagher __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Martin N. <mar...@gm...> - 2005-12-07 14:32:24
|
on 12/7/05, Carfield Yim <car...@gm...> wrote: > > > > I dont quite understand this? Java Strings are charset-neutral as far > > as i know (and always stored internally as UTF-16), so there is no > > need to "convert" a string to anything as the string does not retain > > charset information. The only conversion is dont at Input/Output > > stream level or when encoding to other formats (such as URLEncoder). > > > In some servlet container (tomcat and jetty as I know) If you submit > multibytes character in HTML form, it will incorrectly assume that it > is "ISO-8859-1", and return the incorrect encoded string at > request.getparameter() method. In order to get back the correct > string, I need to do the above. I see how it works now. Anyway might it have something to do with the fact that SimpleWeb actually tries to decode query parameters submitted in UTF-8 as i see the ParameterParser and URIParse classes does? I would think this causes a problem if the input is already in UTF and when you do inString.getBytes("ISO-8859-1") you get the ISO representations of characters (for example you get the string "Bj=F6rnb=E4r" which is already correct), which will mess up when trying to encode these into UTF-8 again (which will result in "Bj?rnb?"). /Martin |
From: Carfield Y. <car...@ca...> - 2005-12-07 10:14:06
|
> I dont quite understand this? Java Strings are charset-neutral as far > as i know (and always stored internally as UTF-16), so there is no > need to "convert" a string to anything as the string does not retain > charset information. The only conversion is dont at Input/Output > stream level or when encoding to other formats (such as URLEncoder). > In some servlet container (tomcat and jetty as I know) If you submit multibytes character in HTML form, it will incorrectly assume that it is "ISO-8859-1", and return the incorrect encoded string at request.getparameter() method. In order to get back the correct string, I need to do the above. Of course, May be it just because I've setup servlet container incorrectly, but seem to me that this is a very common practice. |
From: Carfield Y. <car...@gm...> - 2005-12-07 10:13:48
|
> > I dont quite understand this? Java Strings are charset-neutral as far > as i know (and always stored internally as UTF-16), so there is no > need to "convert" a string to anything as the string does not retain > charset information. The only conversion is dont at Input/Output > stream level or when encoding to other formats (such as URLEncoder). > In some servlet container (tomcat and jetty as I know) If you submit multibytes character in HTML form, it will incorrectly assume that it is "ISO-8859-1", and return the incorrect encoded string at request.getparameter() method. In order to get back the correct string, I need to do the above. Of course, May be it just because I've setup servlet container incorrectly, but seem to me that this is a very common practice. |
From: Martin N. <mar...@gm...> - 2005-12-07 09:31:42
|
On 12/6/05, Carfield Yim <car...@ca...> wrote: > I see, then I encounter some strangle problem. I was using this > approach to convert multibyte charset to UTF-8 to storage: > > String newString =3D new String( inString.getBytes("ISO-8859-1") , "UTF-8= "); > > But this don't work at simpleweb... I dont quite understand this? Java Strings are charset-neutral as far as i know (and always stored internally as UTF-16), so there is no need to "convert" a string to anything as the string does not retain charset information. The only conversion is dont at Input/Output stream level or when encoding to other formats (such as URLEncoder). /Martin |
From: <Mai...@kr...> - 2005-12-06 17:18:44
|
Sorry. Your message could not be delivered to: Richard Wöber (Mailbox has been deleted. Try re-entering the address.) |
From: Niall G. <gal...@ya...> - 2005-12-06 17:17:49
|
Hi Carfield, This has nothing to do with Simple, if this causes problems then inString is not ISO-8859-1. If you get this data from the InputStream check the Request.getMimeType charset. If not then it is related to something else. Also, you should not try to promote ISO-8859-1 to UTF-8. You should try: inString.getBytes("UTF-8"); Niall --- Carfield Yim <car...@ca...> wrote: > I see, then I encounter some strangle problem. I was > using this > approach to convert multibyte charset to UTF-8 to > storage: > > String newString = new String( > inString.getBytes("ISO-8859-1") , "UTF-8"); > > But this don't work at simpleweb... > > On 12/6/05, Niall Gallagher > <gal...@ya...> wrote: > > Hi, > > > > Yes, all URI use the ISO-8859-1 charset (see RFC > 2396) > > as does the HTTP request (see RFC 2616). > > > > Niall > > > > --- Carfield Yim <car...@ca...> wrote: > > > > > Is it same as servlet API that using ISO-8859-1? > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.net email is sponsored by: Splunk Inc. > Do > > > you grep through log files > > > for problems? Stop! Download the new AJAX > search > > > engine that makes > > > searching your log files as easy as surfing the > > > web. DOWNLOAD SPLUNK! > > > > http://ads.osdn.com/?ad_idv37&alloc_id865&op=click > > > _______________________________________________ > > > Simpleweb-Support mailing list > > > Sim...@li... > > > > > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > > > > > > Niall Gallagher > > > > > > > > __________________________________________ > > Yahoo! DSL Something to write home about. > > Just $16.99/mo. or less. > > dsl.yahoo.com > > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. Do > you grep through log files > > for problems? Stop! Download the new AJAX search > engine that makes > > searching your log files as easy as surfing the > web. DOWNLOAD SPLUNK! > > > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > > _______________________________________________ > > Simpleweb-Support mailing list > > Sim...@li... > > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > N¬HYÞµéX¬²'²Þu¼¦[§Ü¨º > Þ¦Øk¢è!W¬~é®åzk¶C£ å¡§m éÞÀ@^ÇÈ^§zØZ¶f¤zËj·!x2¢êå¢âë±æ¬É«,º·âa{å,àHòÔ4¨m¶ÿiÛ(±ÙÜ¢oÚv'ïûjYhr'ׯ:ærX(¦¦W°y´®¦+¶f¢)à+-J)©ìm+©¦í+-²Ê.Ç¢¸ëa¶Úlÿùb²Û,¢êÜyú+éÞ·ùb²Û?+-wèþȦ¦W°y».¦+ Niall Gallagher __________________________________________ Yahoo! DSL Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com |
From: <Mai...@kr...> - 2005-12-06 04:26:18
|
Sorry. Your message could not be delivered to: Richard Wöber (1048) |
From: Carfield Y. <car...@ca...> - 2005-12-06 04:25:35
|
SSBzZWUsIHRoZW4gSSBlbmNvdW50ZXIgc29tZSBzdHJhbmdsZSBwcm9ibGVtLiBJIHdhcyB1c2lu ZyB0aGlzCmFwcHJvYWNoIHRvIGNvbnZlcnQgbXVsdGlieXRlIGNoYXJzZXQgdG8gVVRGLTggdG8g c3RvcmFnZToKClN0cmluZyBuZXdTdHJpbmcgPSBuZXcgU3RyaW5nKCBpblN0cmluZy5nZXRCeXRl cygiSVNPLTg4NTktMSIpICwgIlVURi04Iik7CgpCdXQgdGhpcyBkb24ndCB3b3JrIGF0IHNpbXBs ZXdlYi4uLgoKT24gMTIvNi8wNSwgTmlhbGwgR2FsbGFnaGVyIDxnYWxsYWdoZXJfbmlhbGxAeWFo b28uY29tPiB3cm90ZToKPiBIaSwKPgo+IFllcywgYWxsIFVSSSB1c2UgdGhlIElTTy04ODU5LTEg Y2hhcnNldCAoc2VlIFJGQyAyMzk2KQo+IGFzIGRvZXMgdGhlIEhUVFAgcmVxdWVzdCAoc2VlIFJG QyAyNjE2KS4KPgo+IE5pYWxsCj4KPiAtLS0gQ2FyZmllbGQgWWltIDxjYXJmaWVsZEBjYXJmaWVs ZC5jb20uaGs+IHdyb3RlOgo+Cj4gPiBJcyBpdCBzYW1lIGFzIHNlcnZsZXQgQVBJIHRoYXQgdXNp bmcgSVNPLTg4NTktMT8KPiA+Cj4gPgo+ID4KPiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCj4gPiBUaGlzIFNGLm5ldCBlbWFpbCBpcyBzcG9u c29yZWQgYnk6IFNwbHVuayBJbmMuIERvCj4gPiB5b3UgZ3JlcCB0aHJvdWdoIGxvZyBmaWxlcwo+ ID4gZm9yIHByb2JsZW1zPyAgU3RvcCEgIERvd25sb2FkIHR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bmcgdGhlICB3ZWIuICBET1dOTE9B RCBTUExVTkshCj4gaHR0cDovL2Fkcy5vc2RuLmNvbS8/YWRfaWQ9NzYzNyZhbGxvY19pZD0xNjg2 NSZvcD1jbGljawo+IF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fCj4gU2ltcGxld2ViLVN1cHBvcnQgbWFpbGluZyBsaXN0Cj4gU2ltcGxld2ViLVN1cHBvcnRA bGlzdHMuc291cmNlZm9yZ2UubmV0Cj4gaHR0cHM6Ly9saXN0cy5zb3VyY2Vmb3JnZS5uZXQvbGlz dHMvbGlzdGluZm8vc2ltcGxld2ViLXN1cHBvcnQKPgo= |
From: <Mai...@kr...> - 2005-12-06 01:27:16
|
Sorry. Your message could not be delivered to: Richard Wöber (1048) |
From: Niall G. <gal...@ya...> - 2005-12-06 01:25:20
|
Hi, Yes, all URI use the ISO-8859-1 charset (see RFC 2396) as does the HTTP request (see RFC 2616). Niall --- Carfield Yim <car...@ca...> wrote: > Is it same as servlet API that using ISO-8859-1? > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do > you grep through log files > for problems? Stop! Download the new AJAX search > engine that makes > searching your log files as easy as surfing the > web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_idv37&alloc_id865&op=click > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > Niall Gallagher __________________________________________ Yahoo! DSL Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com |
From: Carfield Y. <car...@ca...> - 2005-12-05 10:26:33
|
Is it same as servlet API that using ISO-8859-1? |
From: Niall G. <gal...@ya...> - 2005-12-02 17:17:08
|
Hi Brian, With regard to directory references that do not end with "/", this is handled in the FileEngine implementation. You can delegate to this when you have to download static content such as images. Regarding content based resolving, it would certainly be an attractive feature. However, how does a template engine know which files are templates? A template with no template markup is still a template. In any event the templating system may have to parse the template to figure out if it is a template, which could be slow. I cannot comment too much on Freemarker, is it able to peek into files and determine whether it is a template or not? Finally, why not resolve in reverse. For instance let everything be a template, and match images and other non-text content to a specific service. For instance resolve match=* name=template type=example.TemplateService resolve match=/*.zip name=file type=example.FileService resolve match=/images/* name=file type=example.FileService Something that may interest you is the tiles implementation in simple.template. It does not use a file extension, instead it caches mismatches. So it assumes everything is a template, if after a peek it turns out not to be this information is cached, so a second peek is not performed. This somewhat reduces the overhead of peeking into the file. Niall --- Brian Davis <wic...@gm...> wrote: > Hmm.. > > The URL resolver is useful under certain contexts... > However.. I can > envision at least 2 scenerios in which I would have > better luck with a > content based resolver. Let me illustrate.. > > Let's say for example that I want to have a url > resolve to my > directorylistingservice... how would i write a regex > to support that.. > while link */ is easy.. what about urls that don't > end in /.. > > a more appropriate check might be .... if (new > File(requestPath).isDirectory() && canRead()) > > Scenerio two.. > > Basically I want to use a template engine such as > FreeMarker on files. > However, I want to use the simple framework to > return everything > else.. (those things that are not FreeMarker > templates)... Now you > might say that link("*.ftl", FreeMarkerService) is > the way to do it.. > > However, it would be better if I could forget the > file extension and > use FreeMarker syntax in .txt, .html, .csv, .xml.. > in this way the web > server could handle the mime typing and the > freemarker engine could > handle the substitution. There is also a case here > for contextual > urls... the idea that urls are important and you > shouldn't confuse the > user by using urls that they dont understand.. > > What I would like to see is a way to pass requests > to the templating > engine.. such that if > TemplateEngine.isTemplate(path) returns true > that the request is passed on to the > TemplateService.. > > Any thoughts would be much appreciated. > > Brian > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do > you grep through log files > for problems? Stop! Download the new AJAX search > engine that makes > searching your log files as easy as surfing the > web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_idv37&alloc_id865&op=click > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > Niall Gallagher __________________________________________ Yahoo! DSL Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com |
From: Niall G. <gal...@ya...> - 2005-12-02 17:00:54
|
Hi Request.getValue is the same as HttpServletRequest.getHeader. It will provide the HTTP headers. If you wish to know more about which headers will be provided I suggest you take a look at RFC 2616. Niall --- Carfield Yim <car...@ca...> wrote: > I see, where can I find the document about > Request.getValue() ? Like, > what value can I get and what is the name? > > On 12/2/05, Carfield Yim <car...@gm...> wrote: > > I see, where can I find the document about > Request.getValue() ? Like, > > what value can I get and what is the name? > > > > On 12/1/05, Niall Gallagher > <gal...@ya...> wrote: > > > Hi Carfield, > > > > > > Try Request.getValue("host") this should provide > the > > > host provided for all HTTP/1.1 clients. If you > are > > > running on a port other than 80 you may want to > trim > > > the port, for example "host.com:8080" needs to > become > > > "host". > > > > > > Niall > > > > > > --- Carfield Yim <car...@ca...> > wrote: > > > > > > > I try to use > > > > > simple.http.Request.getInetAddress().getHostName() > > > > but it > > > > is very slow, is there better alternative? > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > This SF.net email is sponsored by: Splunk Inc. > Do > > > > you grep through log files > > > > for problems? Stop! Download the new AJAX > search > > > > engine that makes > > > > searching your log files as easy as surfing > the > > > > web. DOWNLOAD SPLUNK! > > > > > http://ads.osdn.com/?ad_idv37&alloc_id865&op=click > > > > > _______________________________________________ > > > > Simpleweb-Support mailing list > > > > Sim...@li... > > > > > > > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > > > > > > > > > > Niall Gallagher > > > > > > > __________________________________________________ > > > Do You Yahoo!? > > > Tired of spam? Yahoo! Mail has the best spam > protection around > > > http://mail.yahoo.com > > > > > > > > > > ------------------------------------------------------- > > > This SF.net email is sponsored by: Splunk Inc. > Do you grep through log files > > > for problems? Stop! Download the new AJAX > search engine that makes > > > searching your log files as easy as surfing the > web. DOWNLOAD SPLUNK! > > > > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > > > _______________________________________________ > > > Simpleweb-Support mailing list > > > Sim...@li... > > > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do > you grep through log files > for problems? Stop! Download the new AJAX search > engine that makes > searching your log files as easy as surfing the > web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_idv37&alloc_id865&op=click > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > Niall Gallagher __________________________________________ Yahoo! DSL Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com |
From: Carfield Y. <car...@ca...> - 2005-12-01 19:05:02
|
I see, where can I find the document about Request.getValue() ? Like, what value can I get and what is the name? On 12/2/05, Carfield Yim <car...@gm...> wrote: > I see, where can I find the document about Request.getValue() ? Like, > what value can I get and what is the name? > > On 12/1/05, Niall Gallagher <gal...@ya...> wrote: > > Hi Carfield, > > > > Try Request.getValue("host") this should provide the > > host provided for all HTTP/1.1 clients. If you are > > running on a port other than 80 you may want to trim > > the port, for example "host.com:8080" needs to become > > "host". > > > > Niall > > > > --- Carfield Yim <car...@ca...> wrote: > > > > > I try to use > > > simple.http.Request.getInetAddress().getHostName() > > > but it > > > is very slow, is there better alternative? > > > > > > > > > > > ------------------------------------------------------- > > > This SF.net email is sponsored by: Splunk Inc. Do > > > you grep through log files > > > for problems? Stop! Download the new AJAX search > > > engine that makes > > > searching your log files as easy as surfing the > > > web. DOWNLOAD SPLUNK! > > > http://ads.osdn.com/?ad_idv37&alloc_id=16865&op=3Dclick > > > _______________________________________________ > > > Simpleweb-Support mailing list > > > Sim...@li... > > > > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > > > > > > Niall Gallagher > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam protection around > > http://mail.yahoo.com > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. Do you grep through log = files > > for problems? Stop! Download the new AJAX search engine that makes > > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > > http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick > > _______________________________________________ > > Simpleweb-Support mailing list > > Sim...@li... > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > |
From: Carfield Y. <car...@gm...> - 2005-12-01 19:04:34
|
I see, where can I find the document about Request.getValue() ? Like, what value can I get and what is the name? On 12/1/05, Niall Gallagher <gal...@ya...> wrote: > Hi Carfield, > > Try Request.getValue("host") this should provide the > host provided for all HTTP/1.1 clients. If you are > running on a port other than 80 you may want to trim > the port, for example "host.com:8080" needs to become > "host". > > Niall > > --- Carfield Yim <car...@ca...> wrote: > > > I try to use > > simple.http.Request.getInetAddress().getHostName() > > but it > > is very slow, is there better alternative? > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. Do > > you grep through log files > > for problems? Stop! Download the new AJAX search > > engine that makes > > searching your log files as easy as surfing the > > web. DOWNLOAD SPLUNK! > > http://ads.osdn.com/?ad_idv37&alloc_id=16865&op=3Dclick > > _______________________________________________ > > Simpleweb-Support mailing list > > Sim...@li... > > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > > Niall Gallagher > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > |
From: Brian D. <wic...@gm...> - 2005-12-01 15:46:19
|
Hmm.. The URL resolver is useful under certain contexts... However.. I can envision at least 2 scenerios in which I would have better luck with a content based resolver. Let me illustrate.. Let's say for example that I want to have a url resolve to my directorylistingservice... how would i write a regex to support that.. while link */ is easy.. what about urls that don't end in /.. a more appropriate check might be .... if (new File(requestPath).isDirectory() && canRead()) Scenerio two.. Basically I want to use a template engine such as FreeMarker on files. However, I want to use the simple framework to return everything else.. (those things that are not FreeMarker templates)... Now you might say that link("*.ftl", FreeMarkerService) is the way to do it.. However, it would be better if I could forget the file extension and use FreeMarker syntax in .txt, .html, .csv, .xml.. in this way the web server could handle the mime typing and the freemarker engine could handle the substitution. There is also a case here for contextual urls... the idea that urls are important and you shouldn't confuse the user by using urls that they dont understand.. What I would like to see is a way to pass requests to the templating engine.. such that if TemplateEngine.isTemplate(path) returns true that the request is passed on to the TemplateService.. Any thoughts would be much appreciated. Brian |
From: Brian D. <wic...@gm...> - 2005-12-01 15:33:36
|
Was looking through the dist and couldn't find a test suite used to test the server. Is there such a beast? Else will have to write one.. thinking curl or httpclient.. thanks! Brian |
From: Niall G. <gal...@ya...> - 2005-12-01 10:58:09
|
Hi Carfield, Try Request.getValue("host") this should provide the host provided for all HTTP/1.1 clients. If you are running on a port other than 80 you may want to trim the port, for example "host.com:8080" needs to become "host". Niall --- Carfield Yim <car...@ca...> wrote: > I try to use > simple.http.Request.getInetAddress().getHostName() > but it > is very slow, is there better alternative? > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do > you grep through log files > for problems? Stop! Download the new AJAX search > engine that makes > searching your log files as easy as surfing the > web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_idv37&alloc_id865&op=click > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > Niall Gallagher __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |