RE: OutOfMemoryException Processing Velocity Template

2005-05-10 Thread Mike Curwen
From way back in your first email:

unless I set the tomcat JVM to use a heap size of at least 256M

I'm of two minds:

1) Is there something wrong with that size?  What I mean is, the default
heap size is fairly small, considering that most servers worth their name
have *at least* 512MB to spare.  And I'm not trying to make fun of anyone's
server here... I'm just asking: Is this now a bug, or more of a application
memory sizing/requirements issue?  p.s.  I *wish* I could run the apps I do
at work on as little as 256.

2) 150+MB just to do html pushing *does* seem extreme.  But on the other
hand, how many HTML pages have 66k+ rows?  I think most clients, never mind
servers, would start to choke on that.  So for sure, there ought to be a way
to do better.  But I go back to #1 - the TilesTool seems to 'do 90% of
everyone's jobs', and your job is an edgecase; perhaps not for you, but
certainly for me and any apps I've ever written.




 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, May 10, 2005 6:21 PM
 To: Nathan Bubna
 Cc: Velocity Users List
 Subject: Re: OutOfMemoryException Processing Velocity Template
 
 
 *Gasp*   Ok so I did what you suggested and when I request 
 the particular template WITHOUT using tiles, it works.   But 
 what now?  We've located that the memory problem is indeed in 
 TilesTools (probably cause it uses a BtyeArrayOutputStream), 
 but my application is heavily reliant on the use of the TilesTool ... 
 
 Suggestions?
 
 -L
 
 P.S.  I actually did get the FileOutputStream method to work 
 with Tiles, but on the page with the huge table, it broke.
 
 On Tue, May 10, 2005 at 02:35:14PM -0700, Nathan Bubna wrote:
  oops.  didn't mean to take this off the list...
  
  i'm quite skeptical that you could get the FileOutputStream 
 method to 
  work with Tiles.  you might be able extend the 
 VelocityViewServlet to 
  do something like that though.  i'm not sure what the best tactic 
  there would be.
  
  as for just requesting the particular template and not using Tiles, 
  that should be simple.  the tile being requested is just a template 
  like any other.  the TilesRequestProcessor is just making 
 an internal 
  servlet request (forward or include).  all you need to do 
 is request 
  the same template of the VVS directly.  in other words, get 
 your app 
  running, enter the URL for the template in question (or one 
 that does 
  the same thing), rather than the parent template that is 
 requesting it 
  as a tile ($tile.foo), and see what happens.
  
  On 5/10/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
   How would I do that?
   
   I changed the ImportSupport class to use a 
 FileOutputStream, which writes out to a temp file.   Then the 
 getString() method reads that temp file.  What happens when I 
 do this, however, is when I get to the page with the 66000 
 row table, it sits there for about 1 minute until it runs out 
 of memory.   I'm thoroughly confused!
   
   -L
   
   On Tue, May 10, 2005 at 11:31:17AM -0700, Nathan Bubna wrote:
hmm.  yeah, i don't know what to do then.  without some good 
profiling to see what is hogging the memory, it's hard to say.  
have you tried just requesting the template in question 
 directly 
with the VVS rather than trying to hold it in memory as a tile?
   
that might at least narrow down the area with the problem.
   
On 5/10/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Ok I tried that, but unfortunately, it didn't do the 
 trick =(.   I verified that getResponseWriter was returning 
 an OutputStreamWriter, but it didn't help.   Maybe I'll have 
 to change TilesTool to return an FileOutputStream that writes 
 to a temp file but would that work?   Oh well, anything 
 is worth trying now!

 -L

 On Tue, May 10, 2005 at 10:44:05AM -0700, Nathan Bubna wrote:
  well, maybe you can just override the VVS's 
  getResponseWriter() method somehow to try calling/using 
  getOutputStream() on requests first.  but i'm not sure that 
  will do the trick.  it might, if it's just 
 StringWriter that 
  is the problem and the whole of the tile's content can be 
  reasonably held in memory with a 
 ByteArrayOutputStream (which 
  is what the ImportResponseWrapper uses to hold the 
 tile content if
  getOutputStream() is called instead of getWriter()).
 
  might be worth a shot at least.
 
  On 5/10/05, [EMAIL PROTECTED] 
 [EMAIL PROTECTED] wrote:
   Hm, thats interesting.  Thanks for the info.   
 What would you suggest I do?   Can I easily override a method 
 in VelocityViewServlet that fixes this problem?
  
   -L
  
   On Tue, May 10, 2005 at 10:32:40AM -0700, Nathan Bubna 
   wrote:
if you are using the TilesTool, note that it extends 
ImportSupport which uses a custom 
HttpServletResponseWrapper (an internal class called 

RE: Odd Behavior

2005-04-06 Thread Mike Curwen
have you tried a call to writer.flush() , before System.out.println?


 -Original Message-
 From: Elton Hughes [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, April 06, 2005 1:30 PM
 To: velocity-user@jakarta.apache.org
 Subject: Odd Behavior
 
 
 

snip /
 
   // create the output
   Writer writer = new StringWriter();
   template.merge(context2, writer);
 
writer.flush()  // ?

   // write out
   System.out.println(writer.toString());
   
   } // end of main method
   
 } // End of class
 --
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Odd Behavior

2005-04-06 Thread Mike Curwen
I've just copy and pasted your original code (with one modification to get
the resource loader path where I wanted it), and it works for me.
 
The one mod:
Velocity.setProperty(Velocity.FILE_RESOURCE_LOADER_PATH, c:\\tmpl\\);
immediately before the call to Velocity.init();

I get both firstName and lastName output, nothing clipped.

JDK1.4.2_04
Velocity 1.3.1

 -Original Message-
 From: Elton Hughes [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, April 06, 2005 1:45 PM
 To: Velocity Users List
 Subject: Re: Odd Behavior
 
 
 Hi Mike,
 
 I just tried it, but it had no effect on the output.
 
 Thanks for you effort.
 
 Elton
 
 On Apr 6, 2005, at 11:41 AM, Mike Curwen wrote:
 
  have you tried a call to writer.flush() , before System.out.println?
  writer.flush()  // ?
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Streaming from the middle of a template?

2005-04-05 Thread Mike Curwen
have you looked at using #parse() ?



 -Original Message-
 From: e v a n l e o n a r d [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, April 05, 2005 12:58 PM
 To: 'Velocity Users List'; 'Shinobu Kawai'
 Subject: RE: Streaming from the middle of a template?
 
 
 
  If all the components uses Velocity to render the content, 
 you must be
  using Template#merge or Velocity(Engine)#mergeTemplate or 
  Velocity(Engine)#evaluate in each of your components, correct?  
  If so, you can just put the Writer in the Context before rendering.
  context.put(writer, writer)
  And in the template,
  $component.render($writer)
 
 
 Right right, exactly, but how to I get the writer?
 
 How do I get the writer from the parent velocity template 
 such that I can
 pass it to the child templates and have there output slip 
 right into the
 output of the parent?
 
 
 -Evan
 
 
 
 
 
 -Original Message-
 From: Shinobu Kawai [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, April 05, 2005 1:10 PM
 To: Velocity Users List
 Subject: Re: Streaming from the middle of a template?
 
 Hi Evan,
 
  Here's what I'm doing: I've written a reusable html-control 
 model for 
  creating html components within the struts framework using 
 velocity. 
  These components use velocity themselves to render their content. 
  These controls may also themselves contain other 
 sub-controls, and so 
  on.  It seems ineffecient for me for each of these sub-controls, to 
  have to create a single large string and return it to its parent 
  control to render it. I would rather pass a writer down through the 
  execution hierarchy having each subcontrol add its output to the 
  parents writer, thus using a single writer to achieve the total 
  output, instead of a segmented writer.toString - writer.toString -
 writer.toString sort of process.
  
  Does that make more sense?
 
 If all the components uses Velocity to render the content, 
 you must be using
 Template#merge or Velocity(Engine)#mergeTemplate or
 Velocity(Engine)#evaluate in each of your components, 
 correct?  If so, you
 can just put the Writer in the Context before rendering.
 context.put(writer, writer)
 And in the template,
 $component.render($writer)
 
 Best regards,
 -- Shinobu
 
 --
 Shinobu Kawai [EMAIL PROTECTED]
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: question on velocity-tools-1.1 examples :: simple.war

2005-03-04 Thread Mike Curwen
I'm not familiar with your enviro, but I think your listing of shared/lib
jar files is a bit large.

Specifically, servlet.jar doesn't belong, and I'm surprised it's not causing
problems. And commons-logging.jar is asking for trouble (though I admit,
that's with TC5.0.x, and 5.5 is a different beast).  And unless something
has changed in Velocity, it's not a good idea to be sharing velocity jars
either.

As for memory, the JVM defaults are quite small, so it's not *really* a
Tomcat problem, so much as it's a JVM Defaults problem. 



 -Original Message-
 From: Barbara Baughman [mailto:[EMAIL PROTECTED] 
 Sent: Friday, March 04, 2005 3:11 PM
 To: Velocity Users List
 Subject: Re: question on velocity-tools-1.1 examples :: simple.war
 
 
 This is a Tomcat problem.  I find if there are too many web 
 applications under tomcat, at some point I get an out of 
 memory error. My guess is that this could be the 
 one-more-application that broke the camel's back.
 
 Barbara Baughman
 X2157
 
 On Fri, 4 Mar 2005, Ryan M. Waters wrote:
 
  I've read through the list (and online/offline documentation) in an 
  effort to rule out a lazy question, so I hope that this 
 particular one 
  hasn't been asked before.
 
  What I'm trying to do is get the velocity-tools simple.war example 
  application to work.  I'm running a fresh install of Tomcat 5.5 on 
  Windows (bleh) XP, velocity 1.4 and velocity-tools-1.1
 
  Tomcat runs fine.  Also, I can successfully drop in the layout.war 
  example application and it runs fine, too(!).  When I drop in 
  simple.war, tomcat wigs with the following:
 
  from tomcat's stdout_20050304.log
  --
  Mar 4, 2005 2:39:06 PM org.apache.catalina.startup.HostConfig 
  deployWAR
  INFO: Deploying web application archive simple.war
  Mar 4, 2005 2:39:08 PM 
 org.apache.catalina.startup.HostConfig deployWAR
  SEVERE: Error deploying web application archive simple.war
  java.lang.OutOfMemoryError
  --
 
  For more information on my environment, I have the following .jar 
  files, copied from velocity and velocity-tools, in 
 %tomcat%/shared/lib 
  :
 
  commons-beanutils.jar
  commons-collections.jar
  commons-digester.jar
  commons-logging.jar
  commons-validator.jar
  servlet.jar
  sslext.jar
  velocity-dep-1.4.jar
  velocity-tools-view-1.1.jar
 
  My JDK is Sun's Java 2 SDK, SE v1.4.2_06
 
  = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
 
  I very much look forward to using Velocity.  As an aside, I 
 found it 
  confusing that velocity-1.4 ships with servlet examples but 
 a newbie 
  has no hope of running them out of the box.  For 
 starters, there's 
  no web.xml to tell Tomcat how to deal with *.vm files.  Perhaps 
  there's more that's missing ... I'm still quite ignorant of 
 velocity 
  internals/requirements.  After reading the mailing list, I saw that 
  velocity-tools contains everything needed for running example 
  applications.  Along with the good documentation on how to use 
  Velocity, examples are really what's helpful to a newb teaching 
  themselves a new thing.  If the servlet examples in 
 velocity-1.4 don't 
  run as-is, why include them?
 
  Thank you for Velocity, and thank you for your time.
 
  - Ryan
 
  
 -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: 
 [EMAIL PROTECTED]
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Include a velocity template in a velocity template

2004-12-09 Thread Mike Curwen
http://jakarta.apache.org/velocity/user-guide.html#Parse


 -Original Message-
 From: Patrick Verboom [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, December 09, 2004 11:30 AM
 To: Velocity Users List
 Subject: Include a velocity template in a velocity template
 
 
 Hi,
 
 I read about velocity including a static file in the template 
 by using  
 #include( one.txt ). Is it also possible to include another 
 velocity 
 template and run the included velocity code.
 
 thanks in advance,
 Patrick Verboom
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Defining iterator for #foreach

2004-10-18 Thread Mike Curwen
So.. this  is basically a problem with you loosing generic information
when sticking information into an object that won't return anything but
'Object' ?

I've been somewhat excited about generics, but then I realized how much time
I spend with methods that look like:

Object HttpSession.getAttribute(String var)
Object ServletContext.getAttribute(String var)

And (I wasn't sure, but you seem to have confirmed), you can't *cast* to a
generic? Your lines about 'this is illegal', I'm thinking.  Pity, that.



 -Original Message-
 From: Barbara Baughman [mailto:[EMAIL PROTECTED] 
 Sent: Monday, October 18, 2004 7:46 PM
 To: Velocity Users List; Shinobu Kawai
 Subject: Re: Defining iterator for #foreach
 
 
 An example of my problem with session attributes is as follows, using
 tomcat 5.0:
 
 HashMapString,String hm=new HashMapString,String();
 hm.put(lastname,Baughman);
 hm.put(firstname,Barbara);
 session.setAttribute(name,hm);
 
 This is NOT legal (generic information is not available at runtime):
 HashMapString,String name=(HashMapString,String)
   session.getAttribute(name);
 String lastname=name.get(lastname);
 String firstname=name.get(firstname);
 
 This IS legal:
 HashMap name=(HashMap) session.getAttribute(name);
 String lastname=(String) name.get(lastname);
 String firstname=(String) name.get(firstname);
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: High Traffic Scenario for Velocity

2004-10-07 Thread Mike Curwen
Much more anecdotal than all that. Purely  user experiential.

I was not only the developer, but the primary user of the little app in
question.  So I had become very used to a certain response rate. That rate
would be best described as instantaneous.  I would click a button, or hit
'refresh', and the page would be there with no perceivable delay.

Now when I did my conversion to JSP, I had the old Velocity app still up and
running, and the JSP version up in a different host. So I could do a
side-by-side.
 
The JSP app I'd click a button or hit refresh, and I was able to count in my
head 1 2 done.  Before I'd see a page.  It was visibly and
obviously slower.



 
 I understand that what you say it anecdotally, and 
 completely unofficially, but still, how did you measured 
 that? Between which points of the response production? How 
 big time are we talking about (say, 0.01 s versus 0.02-0.03 s)?
 
 -- 
 Best regards,
  Daniel Dekany
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: High Traffic Scenario for Velocity

2004-10-06 Thread Mike Curwen
not sure what  Velocity just isn't compiled code.  means.

Do you mean serverside java app isn't compiled code, unlike cgi sites that
use compiled c/c++ ?  
 
velocity itself is as compiled as everything else running in the jvm (class
files are the result of a compilation).

So that leaves the templates.  And you already know the AST is cached.
Templates are parsed (not compiled), and only parsed once.  And anecdotal
evidence suggests that Velocity templates whip JSP in the speed department
(even pre-compiled JSP's).  

Or did you mean Velocity isn't just compiled code. ?  Cause in that case,
I refer you back to the anecdotal evidence that cached AST whips compiled
code (if that compiled code is your typical JSP).




 -Original Message-
 From: Jochen Toppe [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, October 06, 2004 4:19 PM
 To: Velocity Users List
 Subject: Re: High Traffic Scenario for Velocity
 
 
 Resin used to be faster than Tomcat 3.x, but with TC 5.0? I 
 somehow doubt it is that much faster anymore, but I haven't 
 seen any numbers lately.
 
 As to the high traffic site. Soon, I'm working on it, 600 
 million PI/month enough? OK, it won't solely be velocity 
 based, just to allow the customer to exchange little snippets 
 inside the portal framework using their own templates. I am 
 however fortunate enough to use a CMS system with excellent 
 caching and not to have to generate fully personalized pages.
 
 Load tests are pending in our project, I do expect a 
 degradation in performance, that is obvious. Velocity just 
 isn't compiled code. I don't expect it to be a problem 
 though, there is that cache :)
 
 As far as caching is concerned, one can always look into 
 using a caching framework like oscache (opensymphony.org) on 
 top of everything. Velocity itself just caches the parsed AST 
 trees (which is good, I would hate to have to reparse the 
 templates all the time). That and good design are probably 
 all you need.
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: High Traffic Scenario for Velocity

2004-10-06 Thread Mike Curwen
In my experience, your assumption is wrong.  I think I've spilled this to
the list before... I once had a small app that I wrote using exclusive
servlets/velocity.  Then I realized I'd created a small app that only *I*
could maintain because no one else knew/loved velocity like I did. I also
needed to start adding graphs to my app, and I went the easy
cewolf/jfreechart route (which requires jsp/taglibs).

Anyways... even on the pages without taglibs (to satisfy those that say
it's the taglibs), I found that when I re-wrote my pages as JSP, the pages
were (anecdotally, and completely unofficially with no stats to back it
up).. at least 2-3x slower.
 
Maybe it was a container issue. maybe the vm could be tweaked. But
regardless, the same app with Velocity as the view layer beat the pants off
the same app with JSP as the view layer (all other things remained equal,
like same server/vm/tomcat version).
 
YYMV.

 -Original Message-
 From: Jochen Toppe [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, October 06, 2004 5:14 PM
 To: Velocity Users List
 Subject: RE: High Traffic Scenario for Velocity
 
 
 Ok, let me clarify: Velocity TEMPLATES aren't compiled code, 
 neither are they bytecode that gets JIT-compiled or anything 
 ;) Meaning take a JSP which gets translated and lateron 
 compiled and compare to a veloc template. I assume the JSP is 
 faster (not taking any container magic into
 account)
 
 Always so picky ;) It's after midnight!
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Slightly off topic

2004-09-30 Thread Mike Curwen
My question is: Why is it like that in the database?  Have you encoded it
like that?

I've just installed fckedit (I've been meaning to try this out) and when I
use 
request.getParameter(FCKeditor1);
 
The text returned is not encoded.  


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, September 30, 2004 2:55 AM
 To: Velocity Users List
 Subject: Slightly off topic
 
 
 I am using Velocity and am trying to use a tool called 
 FCKedit as well.   With FCKedit I am collecting text field 
 data that I store in the database.  The data looks like this 
 in the database:
 
 lt;stronggt;replacement for the system. The 
 systemlt;/stronggt;lt;/emgt;lt;/ligt;lt;ligt;lt;emgt;
 
 
 When I try to take this data and display it in web pages 
 using request velocity tool variables, it prints it out 
 either as shown above or if I use SPAN as like above, but 
 using the HTML equivalents as below:
 
 strongreplacement for the system.  The system/strong.
 
 
 What i need it to not have HTML tags of any sort int he end 
 result, but the use of the HTML tags.  I want strong to be 
 applied to the text and not shown as a tag.
 
 Is there a way to have this happen?  Either in velocity or 
 otherwise?   I can't seem to get it working with javascript 
 or the header encoding tag as I was hoping.
 
 Thanks for any help.
 
 John Ike
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: strange bahevior with #

2004-03-18 Thread Mike Curwen
Apparently. I can confirm it exists with the 1.3.1 java release of
Velocity. (In case the original poster was using .NET)

 -Original Message-
 From: Cort Schaefer [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, March 17, 2004 9:49 PM
 To: 'Velocity Users List'
 Subject: RE: strange bahevior with #
 
 
 Does this mean I did a good job porting -- I even ported the bugs?
 
 Cort
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Polymorphism (was Re: 'instanceof')

2004-03-09 Thread Mike Curwen
That's no excuse to resort to 'instanceof'. there are other way to
tell if something is a box or circle.
 
$foo.isCircle()
$foo.isSquare()
(well... maybe not...)

#set ($myshape = $foo.getMyShape())
#if (circle==$myshape)
 img src=circle.gif
#elseif (square==$myshape)
 img src=squar.gif
#end
 
 
even better?
img src=$foo.getMyShape().gif /


I'm not sure instanceof would be easier.
 


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, March 09, 2004 1:54 PM
 To: [EMAIL PROTECTED]
 Subject: RE: Polymorphism (was Re: 'instanceof')
 
 
  -Original Message-
  From: J. B. Rainsberger [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, March 09, 2004 2:45 PM
  To: Velocity Users List
  Subject: Polymorphism (was Re: 'instanceof')
  
  Why not just invoke draw() on the Shape and let /it/ figure
  things out? That's the whole point of polymorphism. If you're
  just going to ask the object what type it is, then decide what
  to do with it as a result, then why have polymorphism at all?
 
 I'm talking about from the template point of view. If you are 
 using velocity to display some object (ie. text/html) and the 
 object you are displaying has a 'Shape', why is it so bad for 
 your template to display a box/circle if you can tell that 
 the Shape is a box/circle? 
 
 The Shape may know how to draw itself form an AWT point of 
 view, but that doesn't apply for text/html.
 
 Michael
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: getting a merged Template as a Document?

2003-07-08 Thread Mike Curwen
Isn't this more appropriate for an iText user-list?
 
This might help:
http://www.onjava.com/pub/a/onjava/2003/06/18/dynamic_files.html



 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, July 08, 2003 4:03 PM
 To: [EMAIL PROTECTED]
 Subject: getting a merged Template as a Document?
 
 
 Hi All,
 
 I am trying to generate a PDF from a merged Template.
 The PDFWriter needs a Document. So how can I get merged 
 template as a Document.?
 
 Do I need to write a custom servlet to extend VelocityServlet's
 doRequest() method?
 
 Can somebody please help?
 
 Thanks
 Abhi
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Getting Velocity to shut up. ;)

2003-06-30 Thread Mike Curwen
I agree with Will.  Some of the INFO messages are inappropriate.
 
ie:

INFO  - Trying to use logger class
org.apache.velocity.runtime.log.SimpleLog4JLogSystem (109ms)
INFO  - Using logger class
org.apache.velocity.runtime.log.SimpleLog4JLogSystem (109ms)

INFO  - FileResourceLoader : initialization starting.
snip
INFO  - FileResourceLoader : initialization complete.

INFO  - Default ResourceManager initializing. (class
org.apache.velocity.runtime.resource.ResourceManagerImpl) (109ms)
INFO  - Default ResourceManager initialization complete...

INFO  - Velocimacro : initialization starting. (234ms)
INFO  - Velocimacro : initialization complete.


Umm those are DEBUG couplets. That's like entering method xyz
coupled with exiting method xyz.  If it *must* be INFO, use just the
last one please.  There are more than just these ones.
 

INFO  - Resource Loader Instantiated:


Umm... ok, so the constructor worked. DEBUG!


INFO  - Loaded System Directive:
 - and -
Velocimacro : someVelociMacroProperty = true

You're echoing back a setting in a file (or defaults).  This is DEBUG.
Only when I encounter quirky or odd behaviour would I up the log4j
settings to DEBUG, and at that time I want to see this info. Otherwise,
I assume its all good. When my servlet container starts up, I don't
expect all my settings in web.xml to be echoed back to me at an INFO
level. I don't need to see my own settings echoed back. Yes, the
solution is obvious.  Use WARN and above for everyday use.  My point is:
It is unnecessarily verbose by default.
 
I'd be obliged as well, if Will would post his code. But of course, he's
under no obligation to do so. 

End of response proper. 




What appears below is the result of reading this thread last, after all
the other flame-like ones that have been going on.   Just ignore
everything from now on if you don't want to hear about it!  I know I'll
be ignoring any replies to it. And just so I'm clear... that means any
sentence that ends with a '?' below is being rhetorical. I do not invite
a reply. Immature as that might be, I'm just getting something off my
chest.




Well I'm sorry to have wasted the list's time with such a picky request.
Especially how it's open source, of course I should have just cracked
open the source and fixed it myself. 
 

Note to Jonathan:  Did you set out to make an annoying response, or was
that merely a side effect?  In other posts you've made clear your
preference for people being exact when speaking of your replies.  I'll
try to do that:

While reading all this, remember that it is a gestalt thing, and not any
one thing in particular. It was all together a reply that really
pissed me off and made me think you were a git, deliberate in this
instance or not.

Meanwhile, this really is such a non-issue. 

Your use of the word 'such' translates this otherwise truthful statement
into:
It's  **SUCH** a non-issue eye-roll. If I have to hand-hold one more
open source newbie, I'll scream.   

Your real message that it's open source, just bring the smackdown in
the form of a leading double slash while not lost, was I dunno..
outweighed by the surrounding noise. It honestly just makes me want to
ignore anything you have to say, whether on the mark, or not.

 Or, IOW, if one is going to be picky at this level 

'picky'.  Hmm.  Makes me feel real good for having dared to ask the
question. I guess my concerns must really be very minor. Shame on me.

 (since the extra logging messages are benign after all) 

'benign'.  Except I've already told you they were annoying, not
malignant.  

 [If you download open-source...] then one should be willing to make
some slight effort to address the problem. 

If I'm gonna play with the big open-source boys, I should wear long
pants, is that it? Who said I wasn't willing?  Conversly, who says I
have time to do this? Maybe I'm under deadline, and this is (after all)
a minor annoyance. Maybe I asked the question because I thought perhaps
someone else at some time had shared the same thought about the
verbosity, and found a setting to turn it off.  And the quotes around
the word problem. Hmm, very subtle. I can almost see the eyeroll and
your two hands come up and make the little quote signs with your two
fingers.  Minimize others problems, especially when *you* feel they are
truly minor.

 but this logging business...

Trailing off, implying a knowing nudge and wink between the people that
get it and those that don't.  It's no longer worth your time; you
can't be bothered to finish sentences anymore, this problem is just so
minor and ridiculous. Bah! I wash my hands of it!


 
Anyways... I'm generally a level-headed person, and it takes a lot to
irritate me. I