html-tmpl-java-users Mailing List for HTML.Template java package
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: <co...@qu...> - 2007-05-11 18:37:10
|
Hi, is this project still being maintained? I've started using it for a small project of mine, and I see some potential for improvements on your template engine. Bye, Peter -- Peter Conrad Alicestr. 102 63263 Neu-Isenburg Germany |
From: <je...@ne...> - 2006-06-02 13:53:50
|
> Sometime Today, cobbled together some glyphs to say: > You can just tell HTML.Template where to look for templates by passing > the "path" key to your Template constructor: > > String [] template_init =3D { > "filename", "my_template.tmpl", > "path", "webapps/todo", > "search_path_on_include", "true" > }; > > Template t =3D new Template(template_init); > > Hope this helps. It helped...Thank you so much :-) BR Jette |
From: Philip T. <phi...@gm...> - 2006-06-02 13:43:07
|
Sometime Today, cobbled together some glyphs to say: > I am almost there! ... I just have one thing I need to figure out. My > application is in: > > /usr/share/tomcat5/webapps/todo > > And my templates is in the same directory. For example, I have a template > named projects.tmpl. But my application can't find the template, so I > printed out the current directory: > > out.print(System.getenv("PWD")); > > The above command returns: /usr/share/tomcat5 > > So I need to add "webapps/todo" in front of every template filename... of > cause I don't want to do that. Instead I would like to make the > application believe that it's root directory is > /usr/share/tomcat5/webapps/todo. You can just tell HTML.Template where to look for templates by passing the "path" key to your Template constructor: String [] template_init = { "filename", "my_template.tmpl", "path", "webapps/todo", "search_path_on_include", "true" }; Template t = new Template(template_init); Hope this helps. Philip -- As long as we're going to reinvent the wheel again, we might as well try making it round this time. - Mike Dennison |
From: <je...@ne...> - 2006-06-02 13:21:53
|
Hi again :-) I am almost there! ... I just have one thing I need to figure out. My application is in: /usr/share/tomcat5/webapps/todo And my templates is in the same directory. For example, I have a template named projects.tmpl. But my application can't find the template, so I printed out the current directory: out.print(System.getenv("PWD")); The above command returns: /usr/share/tomcat5 So I need to add "webapps/todo" in front of every template filename... of cause I don't want to do that. Instead I would like to make the application believe that it's root directory is /usr/share/tomcat5/webapps/todo. Can you tell me how to do that? Thanks :-) BR Jette |
From: <je...@ne...> - 2006-05-31 11:44:17
|
> Sometime Today, cobbled together some glyphs to say: > > There isn't one, and I can't build java classes on my current box (can'= t > get Java running on FreeBSD). If someone else on the list has a jar > file, maybe they could send it across. It's okay... I have managed to build a *.jar by adding the java files to = a new project in eclipse, and then use the export function. I can't wait to use it! :-) Thanks :-) Best regards Jette > > Philip > > > > ------------------------------------------------------- > All the advantages of Linux Managed Hosting--Without the Cost and Risk! > Fully trained technicians. The highest number of Red Hat certifications= in > the hosting industry. Fanatical Support. Click to learn more > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D107521&bid=3D248729&dat= =3D121642 > _______________________________________________ > 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 T. <phi...@gm...> - 2006-05-31 11:37:57
|
Sometime Today, cobbled together some glyphs to say: > I tried setting the classpath, but same result. > > Maybe you could send me the *.jar? There isn't one, and I can't build java classes on my current box (can't get Java running on FreeBSD). If someone else on the list has a jar file, maybe they could send it across. Philip |
From: <je...@ne...> - 2006-05-31 11:00:25
|
Thank you for the quick reply :-) > Sometime Today, cobbled together some glyphs to say: > >> I have downloaded HTML-Template-java-0.1.2.tar.gz and unpacked it. The= n >> I >> run: >> >> make install > > Does it make a difference if you run "make" first and "make install" > after that? No, I get the same errors when running just 'make' > > Myabe you need to add the current directory to your classpath. I tried setting the classpath, but same result. Maybe you could send me the *.jar? Thanks :-) Best regards Jette |
From: Philip T. <phi...@gm...> - 2006-05-31 10:42:03
|
Sometime Today, cobbled together some glyphs to say: > I have downloaded HTML-Template-java-0.1.2.tar.gz and unpacked it. Then I > run: > > make install Does it make a difference if you run "make" first and "make install" after that? > But it fails with the errors below... how can I correct this? > > I really appreciate your help... > > *********************************************************** > javac HTML/Tmpl/Element/Conditional.java > ---------- > 1. ERROR in HTML/Tmpl/Element/Conditional.java > (at line 37) > public class Conditional extends Element > ^^^^^^^ > Element cannot be resolved to a type Myabe you need to add the current directory to your classpath. I haven't seen this happen in the past, and I don't have access to a java box right now, so can't say for sure. Philip -- "Who cares if it doesn't do anything? It was made with our new Triple-Iso-Bifurcated-Krypton-Gate-MOS process ..." |
From: <je...@ne...> - 2006-05-31 10:22:18
|
Hi :-) I have downloaded HTML-Template-java-0.1.2.tar.gz and unpacked it. Then I run: make install But it fails with the errors below... how can I correct this? I really appreciate your help... *********************************************************** javac HTML/Tmpl/Element/Conditional.java ---------- 1. ERROR in HTML/Tmpl/Element/Conditional.java (at line 37) public class Conditional extends Element ^^^^^^^ Element cannot be resolved to a type ---------- 2. ERROR in HTML/Tmpl/Element/Conditional.java (at line 46) this.type=3D"if"; ^^^^ type cannot be resolved or is not a field ---------- 3. ERROR in HTML/Tmpl/Element/Conditional.java (at line 48) this.type=3D"unless"; ^^^^ type cannot be resolved or is not a field ---------- 4. ERROR in HTML/Tmpl/Element/Conditional.java (at line 53) this.name =3D name; ^^^^ name cannot be resolved or is not a field ---------- 5. ERROR in HTML/Tmpl/Element/Conditional.java (at line 77) public void add(Element node) ^^^^^^^ Element cannot be resolved to a type ---------- 6. ERROR in HTML/Tmpl/Element/Conditional.java (at line 93) if(!params.containsKey(this.name)) ^^^^ name cannot be resolved or is not a field ---------- 7. ERROR in HTML/Tmpl/Element/Conditional.java (at line 96) setControlValue(params.get(this.name)); ^^^^ name cannot be resolved or is not a field ---------- 8. ERROR in HTML/Tmpl/Element/Conditional.java (at line 101) if(type.equals("if") && control_val || ^^^^ type cannot be resolved ---------- 9. ERROR in HTML/Tmpl/Element/Conditional.java (at line 102) type.equals("unless") && !control_val) ^^^^ type cannot be resolved ---------- 10. ERROR in HTML/Tmpl/Element/Conditional.java (at line 114) output.append(((Element)e).parse(params)); ^^^^^^^ Element cannot be resolved to a type ---------- 11. ERROR in HTML/Tmpl/Element/Conditional.java (at line 133) if(((Element)o).Name().equals(param)) ^^^^^^^ Element cannot be resolved to a type ---------- 12. ERROR in HTML/Tmpl/Element/Conditional.java (at line 134) return ((Element)o).Type(); ^^^^^^^ Element cannot be resolved to a type ---------- 12 problems (12 errors)make: *** [HTML/Tmpl/Element/Conditional.class] Error 255 *********************************************************** Best regards Jette |
From: Raul L. <rl...@ab...> - 2004-04-19 07:38:09
|
Hello. I=B4m a developer=B4s Java.=20 I found a problem with WebSphere application server. The WebSphere Studio Application Developer is 5.0. I use JSDK 1.4.2, Oracle 8. In Parser class, line 124: stringbuffer.append(stringbuffer1); The error line of Server console is the next: '[19/04/04 9:21:51:812 CEST] 6b0be68d WebGroup=20 E SRVE0026E: [Error de servlet]-[java.lang.StringBuffer:=20 method=20 append(Ljava/lang/StringBuffer;)Ljava/lan g/StringBuffer; not found]:=20 java.lang.NoSuchMethodError: java.lang.StringBuffer:=20 method append(Ljava/lang/StringBuffer;) Ljava/lang/StringBuffer; not found' Solution is the next: Original code Parser.java : if(s1.indexOf("tmpl_") < 0) { stringbuffer.append(stringbuffer1); continue; } New code Parser.java : if(s1.indexOf("tmpl_") < 0) { String aux=3D stringbuffer1.toString(); String aux2=3D stringbuffer.toString(); aux2+=3Daux; stringbuffer=3Dnew StringBuffer(aux2); continue; } Please, somebody can upload this correction in the next=20 release? Sorry for my English :( |
From: Philip S T. <phi...@gm...> - 2003-01-27 18:32:53
|
Sometime Today, Thomas Wabner assembled some asciibets to say: > I will use the <tmpl_include> tag to include many html fragments in my > whole html-site. The feature request is the following: > > i will try this code in html: > > <tmpl_include <tmpl_var body1> > > > but this does not work at the moment (i know why, it is not yet > implemented ;-). well, it can't be implemented because tmpl_include is processed much before the variables are handled. basically, when the template is being read, all tmpl_includes are read in and inserted at the relevant positions. It's only after all this has happened that tmpl_vars are processed. furthermore, adding this feature will break compatibility with the HTML::Template perl module. It can be done with a Filter, when that's done. I'm still working on it. > I use html-java-templates in a servlet environment. So to install the > servlet on many plattform i have a config file for the servlet > environment. In this config file i will tell the servlet global > include html-templates (these templates will also have tmpl_vars). So > when i move the servlet i must never update all my global templates to > change the path to these html-templates. I must only change the config > and the rest goes dynamicly. you can do this with the path and search_path_on_include parameters to the constructor. Since this is done programmatically, you can have the path read from a configuration file. This is the way I do it. All include templates will be in a static location. Just include that path in the path variable, and specify only the template filename in the tmpl_include, and not the full path. eg: global_templates/ include_1.tmpl include_2.tmpl local_files/ main1.tmpl main2.tmpl main1.tmpl: <tmpl_include file="include_1.tmpl"> main1.java: set path to /path/to/local_files, /path/to/global_templates set search_path_on_include to true initialise template Philip |
From: Thomas W. <tw...@im...> - 2003-01-27 18:11:13
|
Hi, thanks for your help with the new constructor ... works fine! Another question: I will use the <tmpl_include> tag to include many html fragments in my whole html-site. The feature request is the following: i will try this code in html: <tmpl_include <tmpl_var body1> > but this does not work at the moment (i know why, it is not yet implemented ;-). so can you expand the html-java-tmpl library to make this work? I will shortly explain you, why i need this: I use html-java-templates in a servlet environment. So to install the servlet on many plattform i have a config file for the servlet environment. In this config file i will tell the servlet global include html-templates (these templates will also have tmpl_vars). So when i move the servlet i must never update all my global templates to change the path to these html-templates. I must only change the config and the rest goes dynamicly. What you think about? Thanks and Regards Waffel |
From: Philip S T. <phi...@gm...> - 2003-01-27 14:35:45
|
On 27 Jan 2003, Thomas Wabner wrote: > Template templ = new Template("myTemplate.html"); > > the the java compiler says to me: > > "the constructor Template(String) is deprached" > > what kind of constructor should i now use, to create a new > template-class from a given template file? you should use either the Hashtable style constructor or the Array style constructor. Both are documented in the HTML.Template API docs. Philip -- Decaffeinated coffee? Just Say No. |
From: Thomas W. <tw...@im...> - 2003-01-27 13:21:11
|
Hi, i have downloaded the html-tmpl-java sources 0.1.2 from sourceforge, compiled the code with jdk1.4 an tried it. When i use following code (on the html-tmpl-java homepage the example does the same): Template templ =3D new Template("myTemplate.html"); the the java compiler says to me: "the constructor Template(String) is deprached" what kind of constructor should i now use, to create a new template-class from a given template file? Thanks a lot Waffel (alias Thomas Wabner) |
From: Costantino, D. <Dan...@gs...> - 2002-12-13 15:57:25
|
I understand the work problem. I'll try to look into adding the functionality over the next week or two. If I come up with anything, I'll pass it along to you. All the best, Dan -----Original Message----- From: Philip S Tellis [mailto:phi...@gm...] Sent: Thursday, December 12, 2002 10:25 PM To: htm...@li... Subject: RE: [htmltmpl-java] testing for parameter existence On Thu, 12 Dec 2002, Costantino, Dan wrote: > That's a good question ... I suppose I'm looking for the same > functionality as the perl HTML::Template params() method. That > returns all the top level tmpl_if, tmpl_include, tmpl_loop, > tmpl_unless, and tmpl_var parameters. I've never tested for a > parameter inside a loop, just the loop itself. doable, but will take a bit of time as I'm tied up with work. If you think you could hack it in and send me a patch, that would be cool. Ciao, Philip -- Avoid strange women and temporary variables. ------------------------------------------------------- This sf.net email is sponsored by: With Great Power, Comes Great Responsibility Learn to use your power at OSDN's High Performance Computing Channel http://hpc.devchannel.org/ _______________________________________________ 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-12-13 03:29:25
|
On Thu, 12 Dec 2002, Costantino, Dan wrote: > That's a good question ... I suppose I'm looking for the same > functionality as the perl HTML::Template params() method. That > returns all the top level tmpl_if, tmpl_include, tmpl_loop, > tmpl_unless, and tmpl_var parameters. I've never tested for a > parameter inside a loop, just the loop itself. doable, but will take a bit of time as I'm tied up with work. If you think you could hack it in and send me a patch, that would be cool. Ciao, Philip -- Avoid strange women and temporary variables. |
From: Costantino, D. <Dan...@gs...> - 2002-12-12 14:25:50
|
That's a good question ... I suppose I'm looking for the same functionality as the perl HTML::Template params() method. That returns all the top level tmpl_if, tmpl_include, tmpl_loop, tmpl_unless, and tmpl_var parameters. I've never tested for a parameter inside a loop, just the loop itself. Dan -----Original Message----- From: Philip S Tellis [mailto:phi...@gm...] Sent: Wednesday, December 11, 2002 10:10 PM To: htm...@li... Subject: RE: [htmltmpl-java] testing for parameter existence On Wed, 11 Dec 2002, Costantino, Dan wrote: > I downloaded and tested the new Template.java and tested the > containsKey() method. Unfortunately, this method only works after a > call to setParam(). For example, suppose I have the following in my Ok, I guess I misunderstood what you needed. I'll need to check the .tmpl file for existence of the parameter. Question is, how do we identify params within loops, or do we just look at top level params only. Philip -- Scully: (to counsellor) I trust him (Mulder) as much as anyone. I trust him with my life. "The X-Files: Irresistible" ------------------------------------------------------- This sf.net email is sponsored by: With Great Power, Comes Great Responsibility Learn to use your power at OSDN's High Performance Computing Channel http://hpc.devchannel.org/ _______________________________________________ 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-12-12 03:13:50
|
On Wed, 11 Dec 2002, Costantino, Dan wrote: > I downloaded and tested the new Template.java and tested the > containsKey() method. Unfortunately, this method only works after a > call to setParam(). For example, suppose I have the following in my Ok, I guess I misunderstood what you needed. I'll need to check the .tmpl file for existence of the parameter. Question is, how do we identify params within loops, or do we just look at top level params only. Philip -- Scully: (to counsellor) I trust him (Mulder) as much as anyone. I trust him with my life. "The X-Files: Irresistible" |
From: Costantino, D. <Dan...@gs...> - 2002-12-11 18:50:02
|
Philip, I downloaded and tested the new Template.java and tested the containsKey() method. Unfortunately, this method only works after a call to setParam(). For example, suppose I have the following in my template file: <tmpl_var name = foo> if (t.containsKey("foo")) { // succeed } else { // fail } that will always fail unless I do the following: t.setParam ("foo", "bar"); if (t.containsKey("foo")) { // succeed } else { // fail } Then it will succeed. For my purposes, I need to know if a parameter exists before I set its value. Is this a piece of functionality which could be added? Please let me know. Thanks -Dan -----Original Message----- From: Philip S Tellis [mailto:phi...@gm...] Sent: Tuesday, December 10, 2002 11:51 PM To: htm...@li... Subject: Re: [htmltmpl-java] testing for parameter existence On Tue, 10 Dec 2002, Costantino, Dan wrote: > I want to test for the existence of a parameter in a template. How > can I do this without generating a java.util.NoSuchElementException? > > At present, I simply wrap each getParam(<test_name>) call around a try ... Currently this seems to be the only way, but I think it is reasonable enough to add another method that will do what you want. Expect it in the next version, or get CVS in a few hours. Philip -- "If people could put rainbows in zoos, they'd do it." -- Hobbes ------------------------------------------------------- This sf.net email is sponsored by: With Great Power, Comes Great Responsibility Learn to use your power at OSDN's High Performance Computing Channel http://hpc.devchannel.org/ _______________________________________________ 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: Costantino, D. <Dan...@gs...> - 2002-12-11 15:51:18
|
Philip, Thanks for getting back to me. I did a little more testing and realized my try {} .. catch {} wrapper really doesn't solve the problem. It turns out that getParam() will throw a NoSuchElementException exception on a valid parameter if the parameter's value has not yet been set. I'll stop short of calling that a bug, but I think it's a serious problem. Is that the intended behaviour? Dan -----Original Message----- From: Philip S Tellis [mailto:phi...@gm...] Sent: Tuesday, December 10, 2002 11:51 PM To: htm...@li... Subject: Re: [htmltmpl-java] testing for parameter existence On Tue, 10 Dec 2002, Costantino, Dan wrote: > I want to test for the existence of a parameter in a template. How > can I do this without generating a java.util.NoSuchElementException? > > At present, I simply wrap each getParam(<test_name>) call around a try ... Currently this seems to be the only way, but I think it is reasonable enough to add another method that will do what you want. Expect it in the next version, or get CVS in a few hours. Philip -- "If people could put rainbows in zoos, they'd do it." -- Hobbes ------------------------------------------------------- This sf.net email is sponsored by: With Great Power, Comes Great Responsibility Learn to use your power at OSDN's High Performance Computing Channel http://hpc.devchannel.org/ _______________________________________________ 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-12-11 04:54:50
|
On Tue, 10 Dec 2002, Costantino, Dan wrote: > I want to test for the existence of a parameter in a template. How > can I do this without generating a java.util.NoSuchElementException? > > At present, I simply wrap each getParam(<test_name>) call around a try ... Currently this seems to be the only way, but I think it is reasonable enough to add another method that will do what you want. Expect it in the next version, or get CVS in a few hours. Philip -- "If people could put rainbows in zoos, they'd do it." -- Hobbes |
From: Costantino, D. <Dan...@gs...> - 2002-12-11 00:28:14
|
Hi, I want to test for the existence of a parameter in a template. How can I do this without generating a java.util.NoSuchElementException? At present, I simply wrap each getParam(<test_name>) call around a try ... catch block. This seems inefficient. Is this the only way to do it? I only trying to determine if the template variable exists in the specific html template I'm presently reading. I don't actually need its value. Thanks -Dan |
From: Philip S T. <phi...@gm...> - 2002-10-09 19:40:56
|
Version 0.1.2 is out. Minor bugfix. TMPL_VARs inside TMPL_LOOPs were case sensitive always. This has been fixed. Philip -- Don't use conditional branches as a substitute for a logical expression. - The Elements of Programming Style (Kernighan & Plaugher) |
From: Philip S T. <phi...@gm...> - 2002-09-13 13:13:29
|
For those who don't know, HTML.Template.java is a java implementation of HTML::Template. It is almost completely compatible with HTML::Template.pm The only thing not supported are the caching directives and filters (which are on the way). By popular demand, this release has the global_vars option. die_on_bad_params has also been included. The tutorial on the website has also been updated to reflect some of the newer constructs. Homepage: http://html-tmpl-java.sourceforge.net/ Changes in current release: ver 0.1.1 - Fixed bug in tmpl_var which failed if parameter was not a String - TMPL_VAR and TMPL_LOOP now give a reasonable error message if parameter is of the wrong type - Var.typeOfElement now actually returns the type and not the name - support for die_on_bad_params - support for global_vars - New __COUNTER__ TMPL_LOOP context variable - Can now set default values for TMPL_VARs through the template: <TMPL_VAR name="myvar" default="default_value"> Philip -- fenderberg, n.: The large glacial deposits that form on the insides of car fenders during snowstorms. -- "Sniglets", Rich Hall & Friends |
From: Philip S T. <phi...@gm...> - 2002-09-04 17:34:16
|
Sometime Today, Philip S Tellis assembled some asciibets to say: > would want it in, so the next version would most likely have > global_vars support. This is in cvs now, so if you're impatient, you can get that and try. It may have bugs, so if you do test it, feel free to try and break it. -- I THINK MAN INVENTED THE CAR by instinct. -- Jack Handley, The New Mexican, 1988. |