html-tmpl-java-users Mailing List for HTML.Template java package (Page 2)
Status: Beta
Brought to you by:
bluesmoon
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(6) |
Jul
(3) |
Aug
(2) |
Sep
(6) |
Oct
(1) |
Nov
|
Dec
(8) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(4) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2004 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(5) |
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Philip S T. <phi...@gm...> - 2002-09-04 10:39:30
|
On Wed, 4 Sep 2002, Thomas Wabner wrote: > If you interested for the integration from html-template into > java-servlets well, I use it in my servlets too, but don't have anything that uses RMI. yeah, some examples might be good. They could make it to the website. Philip -- "Any excuse will serve a tyrant." -- Aesop |
From: Thomas W. <tw...@im...> - 2002-09-04 10:31:09
|
Hello, Philip S Tellis wrote: > > On Wed, 4 Sep 2002, Thomas Wabner wrote: > > > // a normal template variable > > template.setParam("sessionID",sessionID); > > // a template loop > > template.setParam("newsloop",Newsmanager.getNews()); > > .... > > > > in html: > > ..... > > <tmpl_loop newsloop> > > news: <tmpl_var news><br> > > sessionID: <tmpl_var sessionID> > > </tmpl_loop> > > ..... > > > > the problem is, that the var "news" is correct set > > inside the loop, but the outside of the loop declared > > variable "sessionID" is not set. > > > > How can i access tmpl_vars inside the > > loop, which are not declared in the loop-hashtable? > > This is basically what global_vars in the perl version of HTML::Template > does. As of now, it's not possible in the java version, and my initial > intent was not to support it, but it seems like there are people who > would want it in, so the next version would most likely have global_vars > support. great, and many thanks ;-) > For now, you'll have to use a workaround, and add sessionID to each of > your loop elements. Something like this: > > Vector v = Newsmanager.getNews(); > for(Enumeration e = v.elements(); e.hasMoreElements();) { > Hashtable h = e.nextElement(); > h.put("sessionID", sessionID); > } Yea, i know and try to use it. The problem was with my application. I have included html-tmpl-java into java servlets and have any rmi-components, that generates my hashtable for the templates. So i must run about all entries and add the sessionID. But this is not the problem if i can get the next version of html-template with the cool new feature ;-) If you interested for the integration from html-template into java-servlets i can give you a short example. > > I'll add support for it in the next version, and you're welcome to see > if you can too. Thanks very lot Waffel > Philip > > -- > We'll pivot at warp 2 and bring all tubes to bear, Mr. Sulu! > > ------------------------------------------------------- > This sf.net email is sponsored by: OSDN - Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > _______________________________________________ > Html-tmpl-java-users mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/html-tmpl-java-users > URL: http://html-tmpl-java.sourceforge.net/ |
From: Philip S T. <phi...@gm...> - 2002-09-04 09:52:43
|
On Wed, 4 Sep 2002, Thomas Wabner wrote: > // a normal template variable > template.setParam("sessionID",sessionID); > // a template loop > template.setParam("newsloop",Newsmanager.getNews()); > .... > > in html: > ..... > <tmpl_loop newsloop> > news: <tmpl_var news><br> > sessionID: <tmpl_var sessionID> > </tmpl_loop> > ..... > > the problem is, that the var "news" is correct set > inside the loop, but the outside of the loop declared > variable "sessionID" is not set. > > How can i access tmpl_vars inside the > loop, which are not declared in the loop-hashtable? This is basically what global_vars in the perl version of HTML::Template does. As of now, it's not possible in the java version, and my initial intent was not to support it, but it seems like there are people who would want it in, so the next version would most likely have global_vars support. For now, you'll have to use a workaround, and add sessionID to each of your loop elements. Something like this: Vector v = Newsmanager.getNews(); for(Enumeration e = v.elements(); e.hasMoreElements();) { Hashtable h = e.nextElement(); h.put("sessionID", sessionID); } I'll add support for it in the next version, and you're welcome to see if you can too. Philip -- We'll pivot at warp 2 and bring all tubes to bear, Mr. Sulu! |
From: Thomas W. <tw...@im...> - 2002-09-04 09:32:13
|
Hello, i try following java code fragment: ..... // a normal template variable template.setParam("sessionID",sessionID); // a template loop template.setParam("newsloop",Newsmanager.getNews()); .... in html: ..... <tmpl_loop newsloop> news: <tmpl_var news><br> sessionID: <tmpl_var sessionID> </tmpl_loop> ..... the problem is, that the var "news" is correct set inside the loop, but the outside of the loop declared variable "sessionID" is not set. How can i access tmpl_vars inside the loop, which are not declared in the loop-hashtable? What you think about it? Waffel (alias Thomas Wabner) |
From: Philip S T. <phi...@gm...> - 2002-08-21 10:53:12
|
On Wed, 21 Aug 2002, Philip S Tellis wrote: > Version 0.1.0 of HTML.Template.java has just been released. It's still And for those of you who don't have the URL, it's http://html-tmpl-java.sourceforge.net/ Philip |
From: Philip S T. <phi...@gm...> - 2002-08-21 06:18:46
|
Version 0.1.0 of HTML.Template.java has just been released. It's still a development release, but is getting stable. A few bug fixes, and enhancements. Also added the Filter interface. Following is the ChangeLog ver 0.1.0 - supports Hashtable style constructor parameter - Now also accepts Booleans and Integers in constructor parameters, not just Strings - path parameter accepts a single String as well as an array of Strings - setParam also accepts int, boolean, Integer and Boolean - added Filter interface - fixed bug that prevented file handle from working (thanks to Marcos Ramirez) - fixed case bug with include filenames |
From: Philip S T. <phi...@gm...> - 2002-07-01 12:21:48
|
On Mon, 1 Jul 2002, Ralf Ullrich wrote: > This is what I have in my Servlet (Apache JServ, win2000): > String file ="c:/temp/templates/showEntries.tmpl"; > > String [] template_init = { > "filename", file, > "max_includes", "5", > "path", "c:/temp/templates/", > "search_path_on_include", "true" > }; > Template template = new Template(template_init); I will have changed the constructor in the next version to support both single valued paths as well as array paths, but for now, just use an array. Philip |
From: Philip S T. <phi...@gm...> - 2002-07-01 06:13:15
|
Well, version 0.0.9 is out, which fixes the case bug, and also adds some features. Changelog: 1 Jul 2002 ver 0.0.9 - supports reading from file handle - no longer adds newline character to items passed in arrayref - added escape=quote parameter for tmpl_vars - still waiting for sam to put it into HTML::Template. This may change. - fixed bug that caused NullPointerAssignment if closing tags were not in lowercase I need help finding bugs in the docs, and also suggestions to improve the howto on the site. Any suggestions? Philip |
From: Philip S T. <phi...@gm...> - 2002-07-01 04:35:55
|
On Sun, 30 Jun 2002, James Wu wrote: > Can I embed one loop into another? and how to do it in java side? Were you the one who asked this question on the users forum? Anyway, I'll answer it here too. Yes, you can. > <tmpl_loop loop1> > .... > <tmpl_loop loop2> > ... > </tmpl_loop> > </tmpl_loop> You'd have to have something like this: Hashtable( loop1 => Vector1 ( Hash1(loop2 => Vector2) Hash2(loop2 => Vector3) Hash3(loop2 => Vector4) ) ) Of course, Hashtable, Hash[1-3] would also have other elements. The first hashtable is optional, since it is created inside the template anyway. So, java would be like this: Template t = new Template(...); Vector v = new Vector(); for(outer_loop) { Hashtable h = new Hashtable(); h.put("field1", value1); ... Vector v2 = new Vector(); for(inner_loop) { Hashtable h2 = new Hashtable(); //populate h2 v2.addElement(h2); } h.put("loop2", v2); } t.setParam("loop1", v); And set any other params as you want them. Philip |
From: James W. <jam...@ho...> - 2002-06-30 22:55:40
|
Hi, Can I embed one loop into another? and how to do it in java side? <tmpl_loop loop1> .... <tmpl_loop loop2> ... </tmpl_loop> </tmpl_loop> Thanks. James |
From: Philip S T. <phi...@gm...> - 2002-06-28 19:01:58
|
> Please look at the following code and let me know > if one have an idea to make this work: > > <tmpl_include <tmpl_var hostname>/file.tmpl> This isn't possible as it will require a two pass parser - that isn't going to happen. This is a question that's been asked several times on the HTML::Template - perl mailing list, and the general consensus is that it will never be a part of the template module itself, but it can be done through filters. Filters aren't implemented yet in H.T.j, but will be soon, so hold on a bit. Thanks, Philip |
From: Philip S T. <phi...@gm...> - 2002-06-28 18:57:56
|
> I recently downloaded HTML-Template-Java and think its great to > have it for Java as well. When I startet to play around a little I > found that my templates dont work if I use the template tags in > upper case; lower case just works fine. As I guess from the docs > HTML-Template uses case insensitivity as default, so uppercase tags > should work. Did I forget something? Nope, it was a bug in the case handling for closing tags. It's fixed in CVS. > what if users dont allow cookies? I then would have to use > url-rewriting and put something like > > <a href="<TMPL_VAR encoded_url>"> > > in my templates, which forces me to store url in a servlet I guess. > Is there any other better solution for this? not that I know of. encoded urls have to be generated by the servlet engine, so the only way to do it is through your java program. the template has no logic in it. Philip -- ...when fits of creativity run strong, more than one programmer or writer has been known to abandon the desktop for the more spacious floor. - Fred Brooks, Jr. |
From: Philip S T. <phi...@gm...> - 2002-06-28 18:25:58
|
Sometime Today, Charles Martin assembled some asciibets to say: > I had the exact same problem yesterday with html-tmpl-java. It > took me a while to figure out what exactly was wrong because, > instead of not returnning any output, my servlet just crashed when I > used </TMPL_LOOP> in caps ! I'm in the process of porting a system > just to see how things are 'doable' with a java servlet instead of a > perl-scripted site so the 'compatibility' site of html-tmpl is quite > interesting in my point of view... well, this is fixed in CVS if anyone else is interested, and will be in 0.0.9 when it comes out sometime next week. I've also included the escape=quote param for tmpl_var, but whether it stays in or not depends on whether sam's going to put it into HTML::Template or not. Philip -- When the wind is great, bow before it; when the wind is heavy, yield to it. |
From: Thomas W. <tw...@im...> - 2002-06-26 11:13:08
|
Hello, I using html-tmpl intensitiv in many Project. Please look at the following code and let me know if one have an idea to make this work: <tmpl_include <tmpl_var hostname>/file.tmpl> So I will include on file and the path of the template file stands in an template-variable. Thanks, Waffel |
From: ralf u. <rul...@we...> - 2002-06-25 09:41:08
|
Hi, I recently downloaded HTML-Template-Java and think its great to have it = for Java as well. When I startet to play around a little I found that my templates dont = work if I use the template tags in upper case; lower case just works = fine.=20 As I guess from the docs HTML-Template uses case insensitivity as = default, so uppercase tags should work. Did I forget something? My second question concerns sessiontracking. I plan to develop a = controller servlet that takes care of sessiondata. As long as I use = cookies to store sessions I can keep my templates as they are, but what = if users dont allow cookies? I then would have to use url-rewriting and = put something like <a href=3D"<TMPL_VAR encoded_url>">=20 in my templates, which forces me to store url in a servlet I guess. Is = there any other better solution for this? Yours, Ralf |
From: Philip S T. <phi...@in...> - 2002-03-27 18:48:23
|
Well, I was planning on releasing version 0.0.4 sometime this week, but I had a Monday off and through in loads of features and even a new Parser module. The next version will now most likely be 0.0.8, with very little left to bring it up to 0.1.0. As far as discussions go, Sam says it's okay to discus Template issues on the HTML::Template mailing list, so we'll probably stick to that. We'll keep this list for HTML.Template specific stuff, java related, bugs, etc. Philip -- If you have a procedure with 10 parameters, you probably missed some. |