component based templates with Velocity (+ tools?)

2006-02-06 Thread Christopher Townson
Hi,

For a few months now, we at Nature have been throwing around the idea of 
developing a whole bunch of Velocity Tools to enable us to develop a truly 
component-based templating solution for our sites.

I noticed Nathan's comment 
(http://www.theserverside.com/news/thread.tss?thread_id=20404#89523) about 
this from 2003 and was wondering whether anyone out there has any experiences 
of developing this kind of solution that they would like to share?

Our basic idea was this:
Outline:
We have multiple sites with many different views, but most reuse broadly 
similar 'components' to construct these views. Through use of Velocity Tools, 
we could make these components independent and reusable by making available 
methods that, using a passed argument, knew how to retrieve the data they 
required in any particular instance.

1. Sub-class VelocityViewServlet to initialize required contexts (e.g. global, 
group, site etc) and populate with configuration data from files (file 
retrieval based on convention / data being the basic stuff like names of 
sites, values used throughout all sites or all of group etc)

2. Create a suite of Velocity Tools, each with an accompanying velocity 
template ... or multiple templates - which template was used could be 
determined by the presence or absence of vm files based upon convention?

for example: a MenuTool might have a template that looked like this:

#set ( $Menu.name = 'main menu' ) #* a string which identifies which type of 
menu we're dealing with *#
#set ( $Menu.site = $Config.siteName ) #* so it knows where to get the correct 
menu items *#
ul
#foreach ( $MenuItem in $Menu.items )
lia href=$MenuItem.getURL()$MenuItem.getText()/a/li
#end
/ul

Through its interface with the Velocity Tool, this one 'main menu' template 
file could then be used globally and multiple times in the same view.

Another way to do the same thing without the use of Velocity Tools is to 
create extensive configuration files using standard *.vm files and #set 
directives. However, in my experience, that solution is quite laborious to 
maintain and prone to error when editing is done by inexperienced users.

Your comments and suggestions / experience would be most gratefully received.

Best wishes,

Chris

-- 
Christopher Townson
New Technology Developer
Nature Publishing Group

t. +44 (0)20 7843 4644
e. [EMAIL PROTECTED]


   
DISCLAIMER: This e-mail is confidential and should not be used by anyone who is
not the original intended recipient. If you have received this e-mail in error
please inform the sender and delete it from your mailbox or any other storage
mechanism. Neither Macmillan Publishers Limited nor any of its agents accept
liability for any statements made which are clearly the sender's own and not
expressly made on behalf of Macmillan Publishers Limited or one of its agents.
Please note that neither Macmillan Publishers Limited nor any of its agents
accept any responsibility for viruses that may be contained in this e-mail or
its attachments and it is your responsibility to scan the e-mail and 
attachments (if any). No contracts may be concluded on behalf of Macmillan 
Publishers Limited or its agents by means of e-mail communication. Macmillan 
Publishers Limited Registered in England and Wales with registered number 
785998 
Registered Office Brunel Road, Houndmills, Basingstoke RG21 6XS   



Using Date formatiing with velocity-tools-1.2

2006-02-06 Thread Anagha
Hi,
I'm newbie to velocity and trying out examples.I have been trying to get the
generic velocity tools to work with my java application.
I included velocity-tools-generic-1.2.jar in my classpath and modified 
example.vm (from app_example1) only to insert $date.

I found that after merge it's printed as $date only instead of actual
today's date.

I don't to intend use servlets at all. I only want to use Velocity Generic
Tools in the templates.

Any help is appreciated.
--
Thanks  Regards,
Anagha


Re: Using Date formatiing with velocity-tools-1.2

2006-02-06 Thread Anagha
Sorry my fault,
I should have put the key as
context.put(date, new DateTool());
in a Java application and then access it in the template.
Now it works fine.

On 2/6/06, Anagha [EMAIL PROTECTED] wrote:

 Hi,
 I'm newbie to velocity and trying out examples.I have been trying to get
 the generic velocity tools to work with my java application.
 I included velocity-tools-generic-1.2.jar in my classpath and modified 
 example.vm (from app_example1) only to insert $date.

 I found that after merge it's printed as $date only instead of actual
 today's date.

 I don't to intend use servlets at all. I only want to use Velocity Generic
 Tools in the templates.

 Any help is appreciated.
 --
 Thanks  Regards,
 Anagha




--
Thanks  Regards,
Anagha


Re: Using Date formatiing with velocity-tools-1.2

2006-02-06 Thread Shashikanth Duchetty
is this same Anagha from Netsurf Communications private ltd Pune..

Shashi


On 2/6/06, Anagha [EMAIL PROTECTED] wrote:

 Sorry my fault,
 I should have put the key as
 context.put(date, new DateTool());
 in a Java application and then access it in the template.
 Now it works fine.

 On 2/6/06, Anagha [EMAIL PROTECTED] wrote:
 
  Hi,
  I'm newbie to velocity and trying out examples.I have been trying to get
  the generic velocity tools to work with my java application.
  I included velocity-tools-generic-1.2.jar in my classpath and modified 
  example.vm (from app_example1) only to insert $date.
 
  I found that after merge it's printed as $date only instead of actual
  today's date.
 
  I don't to intend use servlets at all. I only want to use Velocity
 Generic
  Tools in the templates.
 
  Any help is appreciated.
  --
  Thanks  Regards,
  Anagha




 --
 Thanks  Regards,
 Anagha




Re: component based templates with Velocity (+ tools?)

2006-02-06 Thread Ahmed Mohombe
For a few months now, we at Nature have been throwing around the idea of 
developing a whole bunch of Velocity Tools to enable us to develop a truly 
component-based templating solution for our sites.

This might be exactly what you look for:
http://click.sourceforge.net/

Not as Velocity Tools, but as a very very simple framework based on Velocity,
but based on components.

Ahmed.


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



Re: VelocityFAQ and Velocity-tools-1.2 NullPointerException

2006-02-06 Thread Nathan Bubna
hmm.  no, this isn't the NPE mentioned in the FAQ.   i think you've
run afoul of a bug that was fixed, unfixed, and refixed.

Fixed: 
http://svn.apache.org/viewcvs.cgi/jakarta/velocity/trunk/src/java/org/apache/velocity/io/VelocityWriter.java?rev=75937r1=75805r2=75937

Unfixed: 
http://svn.apache.org/viewcvs.cgi/jakarta/velocity/trunk/src/java/org/apache/velocity/io/VelocityWriter.java?rev=75959r1=75949r2=75959

Refixed: 
http://svn.apache.org/viewcvs.cgi/jakarta/velocity/trunk/src/java/org/apache/velocity/io/VelocityWriter.java?rev=75960r1=75959r2=75960

unfortunately, it appears that Velocity 1.4 was released after the
unfixed revision and before the refixed revision, since the problem
occurs on line 319 in both the 1.4 tag and the unfixed revision on the
trunk.  :(

so, all i can recommend is that you check out the last SVN code for
Velocity 1.5 and use that.  hopefully we'll get it released soon, but
in the meantime, it is quite stable and definitely superior to the 1.4
version.  if you are unable to build it yourself, let me know and i
will upload a nightly build that you can use.

On 2/5/06, David Sperling [EMAIL PROTECTED] wrote:
 My velocity-struts-1.2 message tool is throwing NPEs,
 even though it looks to me that my action servlet
 is being loaded before the velocity servlet.

 The velocity faq says that the MessageTool will throw
 a NullPointerException if the ActionServlet isn't
 initialized before trying to use struts-tools.
 I set my ActionServlet to load 1st and my
 Velocity Servlet to load 3rd.  But I still get
 NullPointerException when I don't have a resource
 in my resource bundle.

 So $text.resource.in.bundle
 displays fine but
$text.resource.not.in.bundle
 gives a null pointer stack trace.



 Below I've listed my web.xml and a sample stack trace.
  I'd like to know what I need to do to get
 the text $text.resource.not.in.bundle in my pages
 instead of a stack trace.



 Cheers,


 ?xml version=1.0 encoding=UTF-8?
 !DOCTYPE web-app PUBLIC -//Sun Microsystems,
 Inc.//DTD Web Application 2.3//EN
 http://java.sun.com/dtd/web-app_2_3.dtd;
 web-app
   display-nameReservations Web App/display-name
   filter
 filter-nameSet Character Encoding/filter-name

 filter-classmydomain.reservations.filters.SetCharacterEncodingFilter/filter-class
 init-param
   param-nameencoding/param-name
   param-valueUTF-8/param-value
 /init-param
   /filter
   filter-mapping
 filter-nameSet Character Encoding/filter-name
 url-pattern/*/url-pattern
   /filter-mapping

   servlet
 servlet-nameaction/servlet-name

 servlet-classorg.apache.struts.action.ActionServlet/servlet-class
 init-param
   param-nameconfig/param-name
   param-value/WEB-INF/main/strutsConfig.xml,
 /WEB-INF/hotel/hotelConfig.xml,
 /WEB-INF/rate/rateConfig.xml,
 /WEB-INF/room/roomMasterConfig.xml,
 /WEB-INF/glance/atAGlanceConfig.xml,
 /WEB-INF/user/userConfig.xml,
 
 /WEB-INF/reservation/reservationDetailConfig.xml,
 /WEB-INF/calendar/calendarConfig.xml,
 /WEB-INF/plan/planConfig.xml,
 /WEB-INF/feature/featureConfig.xml,
 /WEB-INF/member/memberConfig.xml,
 /WEB-INF/external/externalConfig.xml,
 /WEB-INF/report/reportConfig.xml
 /param-value
 /init-param
 init-param
   param-namedebug/param-name
   param-value2/param-value
 /init-param
 init-param
   param-namedetail/param-name
   param-value2/param-value
 /init-param
 load-on-startup1/load-on-startup
   /servlet



   servlet
 servlet-nameexportServlet/servlet-name

 servlet-classmydomain.reservations.export.servlet.ExportServlet/servlet-class
 load-on-startup2/load-on-startup
   /servlet

   servlet
 servlet-namevelocity/servlet-name

 servlet-classorg.apache.velocity.tools.view.servlet.VelocityViewServlet/servlet-class
 init-param

 param-nameorg.apache.velocity.toolbox/param-name
   param-value/WEB-INF/toolbox.xml/param-value
 /init-param
 init-param

 param-nameorg.apache.velocity.properties/param-name

 param-value/WEB-INF/velocity.properties/param-value
 /init-param
 load-on-startup3/load-on-startup
   /servlet



   servlet-mapping
 servlet-nameexportServlet/servlet-name
 url-pattern/export/url-pattern
   /servlet-mapping
   servlet-mapping
 servlet-nameaction/servlet-name
 url-pattern*.do/url-pattern
   /servlet-mapping
   servlet-mapping
 servlet-namevelocity/servlet-name
 url-pattern*.vm/url-pattern
   /servlet-mapping
   welcome-file-list
 welcome-fileindex.vm/welcome-file
   /welcome-file-list
   resource-ref
 descriptionDB Connection/description

Re: component based templates with Velocity (+ tools?)

2006-02-06 Thread Nathan Bubna
On 2/6/06, Christopher Townson [EMAIL PROTECTED] wrote:
 Hi,

 For a few months now, we at Nature have been throwing around the idea of
 developing a whole bunch of Velocity Tools to enable us to develop a truly
 component-based templating solution for our sites.

 I noticed Nathan's comment
 (http://www.theserverside.com/news/thread.tss?thread_id=20404#89523) about
 this from 2003 and was wondering whether anyone out there has any experiences
 of developing this kind of solution that they would like to share?

gosh, time flies...  since that time,  we really haven't pursued the
Velocimacro library idea very thoroughly.  we do have a start to it in
our Wiki, but the contributions are thin and organization/formatting
is uneven.

as far as doing compentized work, i agree that Click has probably gone
furthest in supporting compenent-oriented web development with
Velocity.  before you do anything else, you should probably look into
what they're doing first.

 Our basic idea was this:
 Outline:
 We have multiple sites with many different views, but most reuse broadly
 similar 'components' to construct these views. Through use of Velocity Tools,
 we could make these components independent and reusable by making available
 methods that, using a passed argument, knew how to retrieve the data they
 required in any particular instance.

 1. Sub-class VelocityViewServlet to initialize required contexts (e.g. global,
 group, site etc) and populate with configuration data from files (file
 retrieval based on convention / data being the basic stuff like names of
 sites, values used throughout all sites or all of group etc)

sounds good.

 2. Create a suite of Velocity Tools, each with an accompanying velocity
 template ... or multiple templates - which template was used could be
 determined by the presence or absence of vm files based upon convention?

conventions are good.  would this be something like the MultiViewsTool?

 for example: a MenuTool might have a template that looked like this:

 #set ( $Menu.name = 'main menu' ) #* a string which identifies which type of
 menu we're dealing with *#
 #set ( $Menu.site = $Config.siteName ) #* so it knows where to get the correct
 menu items *#
 ul
 #foreach ( $MenuItem in $Menu.items )
 lia href=$MenuItem.getURL()$MenuItem.getText()/a/li
 #end
 /ul

 Through its interface with the Velocity Tool, this one 'main menu' template
 file could then be used globally and multiple times in the same view.

not sure i follow...

 Another way to do the same thing without the use of Velocity Tools is to
 create extensive configuration files using standard *.vm files and #set
 directives. However, in my experience, that solution is quite laborious to
 maintain and prone to error when editing is done by inexperienced users.

yeah, i would avoid doing configuration in your templates as much as
is reasonable.  Velocity isn't really designed for that.  of course,
neither was xml, and look how we've all been suckered into using that
to configure everything... :)

 Your comments and suggestions / experience would be most gratefully received.

 Best wishes,

 Chris

 --
 Christopher Townson
 New Technology Developer
 Nature Publishing Group

 t. +44 (0)20 7843 4644
 e. [EMAIL PROTECTED]

 
 DISCLAIMER: This e-mail is confidential and should not be used by anyone who 
 is
 not the original intended recipient. If you have received this e-mail in error
 please inform the sender and delete it from your mailbox or any other storage
 mechanism. Neither Macmillan Publishers Limited nor any of its agents accept
 liability for any statements made which are clearly the sender's own and not
 expressly made on behalf of Macmillan Publishers Limited or one of its agents.
 Please note that neither Macmillan Publishers Limited nor any of its agents
 accept any responsibility for viruses that may be contained in this e-mail or
 its attachments and it is your responsibility to scan the e-mail and
 attachments (if any). No contracts may be concluded on behalf of Macmillan
 Publishers Limited or its agents by means of e-mail communication. Macmillan
 Publishers Limited Registered in England and Wales with registered number 
 785998
 Registered Office Brunel Road, Houndmills, Basingstoke RG21 6XS
 


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



RE: OutOfMemoryException Processing Velocity Template

2006-02-06 Thread e v a n

I believe that I'm using the singletone pattern.  I using the
VelocityViewServlet to startup velocity, and I believe its written to use
the runtime singleton by calling Velocity.init().
Is that correct?

-Evan



 

-Original Message-
From: Malcolm Edgar [mailto:[EMAIL PROTECTED] 
Sent: Saturday, February 04, 2006 4:35 PM
To: Velocity Users List
Subject: Re: OutOfMemoryException Processing Velocity Template

Are you using Velocity singleton pattern or VelocityEngine?

regards Malcolm Edgar

On 2/4/06, e v a n [EMAIL PROTECTED] wrote:

 Hello,

 I just picked up on this thread[1] from 5-10-2005 today because I'm 
 running into a similar issue trying to render a large HTML page via 
 velocity that's included via Tiles.  In this post [2] in the thread, 
 there is talk of making a specialized TilesTool for cases where large 
 html files need to be written out with Velocity. To anyone's 
 knowledge, has anyone come up with such a patch?

 Thank You,
 Evan Leonard


 [1] -
 http://www.nabble.com/RE%3A-OutOfMemoryException-Processing-Velocity-T
 emplat
 e-t5193.html
 [2] -
 http://www.nabble.com/Re:-OutOfMemoryException-Processing-Velocity-Tem
 plate-
 p23480.html




 -
 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: OutOfMemoryException Processing Velocity Template

2006-02-06 Thread Nathan Bubna
that depends on which version of VelocityTools you are using.  in 1.2,
we rewrote things to use a VelocityEngine instead of the singleton,
which was causing problems for us.

On 2/6/06, e v a n [EMAIL PROTECTED] wrote:

 I believe that I'm using the singletone pattern.  I using the
 VelocityViewServlet to startup velocity, and I believe its written to use
 the runtime singleton by calling Velocity.init().
 Is that correct?

 -Evan





 -Original Message-
 From: Malcolm Edgar [mailto:[EMAIL PROTECTED]
 Sent: Saturday, February 04, 2006 4:35 PM
 To: Velocity Users List
 Subject: Re: OutOfMemoryException Processing Velocity Template

 Are you using Velocity singleton pattern or VelocityEngine?

 regards Malcolm Edgar

 On 2/4/06, e v a n [EMAIL PROTECTED] wrote:
 
  Hello,
 
  I just picked up on this thread[1] from 5-10-2005 today because I'm
  running into a similar issue trying to render a large HTML page via
  velocity that's included via Tiles.  In this post [2] in the thread,
  there is talk of making a specialized TilesTool for cases where large
  html files need to be written out with Velocity. To anyone's
  knowledge, has anyone come up with such a patch?
 
  Thank You,
  Evan Leonard
 
 
  [1] -
  http://www.nabble.com/RE%3A-OutOfMemoryException-Processing-Velocity-T
  emplat
  e-t5193.html
  [2] -
  http://www.nabble.com/Re:-OutOfMemoryException-Processing-Velocity-Tem
  plate-
  p23480.html
 
 
 
 
  -
  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]



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



Re: can anybody help me on this please

2006-02-06 Thread Sreeni Gali
Yeah definitly you can do this.

On 2/5/06, Shashikanth Duchetty [EMAIL PROTECTED] wrote:

 Hi all,
 can I keep such property in properties file

 some.one.like=somexyz
 thanks
 Shashi




RE: OutOfMemoryException Processing Velocity Template

2006-02-06 Thread e v a n

Yes it looks like we still are using v1.1 in out project.  How does this
affect the rendering of large HTML files and getting OOMEs when doing so?

Evan
 

-Original Message-
From: Nathan Bubna [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 06, 2006 1:11 PM
To: Velocity Users List
Subject: Re: OutOfMemoryException Processing Velocity Template

that depends on which version of VelocityTools you are using.  in 1.2, we
rewrote things to use a VelocityEngine instead of the singleton, which was
causing problems for us.

On 2/6/06, e v a n [EMAIL PROTECTED] wrote:

 I believe that I'm using the singletone pattern.  I using the 
 VelocityViewServlet to startup velocity, and I believe its written to 
 use the runtime singleton by calling Velocity.init().
 Is that correct?

 -Evan





 -Original Message-
 From: Malcolm Edgar [mailto:[EMAIL PROTECTED]
 Sent: Saturday, February 04, 2006 4:35 PM
 To: Velocity Users List
 Subject: Re: OutOfMemoryException Processing Velocity Template

 Are you using Velocity singleton pattern or VelocityEngine?

 regards Malcolm Edgar

 On 2/4/06, e v a n [EMAIL PROTECTED] wrote:
 
  Hello,
 
  I just picked up on this thread[1] from 5-10-2005 today because I'm 
  running into a similar issue trying to render a large HTML page via 
  velocity that's included via Tiles.  In this post [2] in the thread, 
  there is talk of making a specialized TilesTool for cases where 
  large html files need to be written out with Velocity. To anyone's 
  knowledge, has anyone come up with such a patch?
 
  Thank You,
  Evan Leonard
 
 
  [1] -
  http://www.nabble.com/RE%3A-OutOfMemoryException-Processing-Velocity
  -T
  emplat
  e-t5193.html
  [2] -
  http://www.nabble.com/Re:-OutOfMemoryException-Processing-Velocity-T
  em
  plate-
  p23480.html
 
 
 
 
  
  - 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]



-
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: can anybody help me on this please

2006-02-06 Thread Shashikanth Duchetty
but it doesn't work. If I remove . in between them it works fine
thanks
Shashi


On 2/7/06, Sreeni Gali [EMAIL PROTECTED] wrote:

 Yeah definitly you can do this.

 On 2/5/06, Shashikanth Duchetty [EMAIL PROTECTED] wrote:
 
  Hi all,
  can I keep such property in properties file
 
  some.one.like=somexyz
  thanks
  Shashi
 
 




Re: OutOfMemoryException Processing Velocity Template

2006-02-06 Thread Nathan Bubna
i'm not sure.  Edgar?

as for your question about a specialized TilesTool...  i'm not aware
of this having been done.  if it has, it wasn't shared with the list.

have you taken the other advice in the thread and profiled your
application?  if you aren't up for writing a specialized TilesTool,
then there may be other ways you can cut down on your memory use.

On 2/6/06, e v a n [EMAIL PROTECTED] wrote:

 Yes it looks like we still are using v1.1 in out project.  How does this
 affect the rendering of large HTML files and getting OOMEs when doing so?

 Evan


 -Original Message-
 From: Nathan Bubna [mailto:[EMAIL PROTECTED]
 Sent: Monday, February 06, 2006 1:11 PM
 To: Velocity Users List
 Subject: Re: OutOfMemoryException Processing Velocity Template

 that depends on which version of VelocityTools you are using.  in 1.2, we
 rewrote things to use a VelocityEngine instead of the singleton, which was
 causing problems for us.

 On 2/6/06, e v a n [EMAIL PROTECTED] wrote:
 
  I believe that I'm using the singletone pattern.  I using the
  VelocityViewServlet to startup velocity, and I believe its written to
  use the runtime singleton by calling Velocity.init().
  Is that correct?
 
  -Evan
 
 
 
 
 
  -Original Message-
  From: Malcolm Edgar [mailto:[EMAIL PROTECTED]
  Sent: Saturday, February 04, 2006 4:35 PM
  To: Velocity Users List
  Subject: Re: OutOfMemoryException Processing Velocity Template
 
  Are you using Velocity singleton pattern or VelocityEngine?
 
  regards Malcolm Edgar
 
  On 2/4/06, e v a n [EMAIL PROTECTED] wrote:
  
   Hello,
  
   I just picked up on this thread[1] from 5-10-2005 today because I'm
   running into a similar issue trying to render a large HTML page via
   velocity that's included via Tiles.  In this post [2] in the thread,
   there is talk of making a specialized TilesTool for cases where
   large html files need to be written out with Velocity. To anyone's
   knowledge, has anyone come up with such a patch?
  
   Thank You,
   Evan Leonard
  
  
   [1] -
   http://www.nabble.com/RE%3A-OutOfMemoryException-Processing-Velocity
   -T
   emplat
   e-t5193.html
   [2] -
   http://www.nabble.com/Re:-OutOfMemoryException-Processing-Velocity-T
   em
   plate-
   p23480.html
  
  
  
  
   
   - 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]
 
 

 -
 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: OutOfMemoryException Processing Velocity Template

2006-02-06 Thread Malcolm Edgar
If your are reloading your application a lot, i.e. doing development
work, the singleton pattern causes a memory leak. This could be
expressed in OOME when rendering templates.

regards Malcolm Edgar

On 2/7/06, Nathan Bubna [EMAIL PROTECTED] wrote:
 i'm not sure.  Edgar?

 as for your question about a specialized TilesTool...  i'm not aware
 of this having been done.  if it has, it wasn't shared with the list.

 have you taken the other advice in the thread and profiled your
 application?  if you aren't up for writing a specialized TilesTool,
 then there may be other ways you can cut down on your memory use.

 On 2/6/06, e v a n [EMAIL PROTECTED] wrote:
 
  Yes it looks like we still are using v1.1 in out project.  How does this
  affect the rendering of large HTML files and getting OOMEs when doing so?
 
  Evan
 
 
  -Original Message-
  From: Nathan Bubna [mailto:[EMAIL PROTECTED]
  Sent: Monday, February 06, 2006 1:11 PM
  To: Velocity Users List
  Subject: Re: OutOfMemoryException Processing Velocity Template
 
  that depends on which version of VelocityTools you are using.  in 1.2, we
  rewrote things to use a VelocityEngine instead of the singleton, which was
  causing problems for us.
 
  On 2/6/06, e v a n [EMAIL PROTECTED] wrote:
  
   I believe that I'm using the singletone pattern.  I using the
   VelocityViewServlet to startup velocity, and I believe its written to
   use the runtime singleton by calling Velocity.init().
   Is that correct?
  
   -Evan
  
  
  
  
  
   -Original Message-
   From: Malcolm Edgar [mailto:[EMAIL PROTECTED]
   Sent: Saturday, February 04, 2006 4:35 PM
   To: Velocity Users List
   Subject: Re: OutOfMemoryException Processing Velocity Template
  
   Are you using Velocity singleton pattern or VelocityEngine?
  
   regards Malcolm Edgar
  
   On 2/4/06, e v a n [EMAIL PROTECTED] wrote:
   
Hello,
   
I just picked up on this thread[1] from 5-10-2005 today because I'm
running into a similar issue trying to render a large HTML page via
velocity that's included via Tiles.  In this post [2] in the thread,
there is talk of making a specialized TilesTool for cases where
large html files need to be written out with Velocity. To anyone's
knowledge, has anyone come up with such a patch?
   
Thank You,
Evan Leonard
   
   
[1] -
http://www.nabble.com/RE%3A-OutOfMemoryException-Processing-Velocity
-T
emplat
e-t5193.html
[2] -
http://www.nabble.com/Re:-OutOfMemoryException-Processing-Velocity-T
em
plate-
p23480.html
   
   
   
   

- 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]
  
  
 
  -
  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]



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



Re: can anybody help me on this please

2006-02-06 Thread Magnus Kvalheim

Are you using VelocityStruts(Velocity-tools)?
Because I experienced the same problems there.

Accessing
label.one=foobar
as
$text.label.one
didn't work, so I had to use
$text.get('label.one')

However, properties without dots work fine in velocitystruts
label_one=foobar
$text.label_one

Can anyone confirm this issue?

best
Magnus

Shashikanth Duchetty wrote:


but it doesn't work. If I remove . in between them it works fine
thanks
Shashi


On 2/7/06, Sreeni Gali [EMAIL PROTECTED] wrote:
 


Yeah definitly you can do this.

On 2/5/06, Shashikanth Duchetty [EMAIL PROTECTED] wrote:
   


Hi all,
can I keep such property in properties file

some.one.like=somexyz
thanks
Shashi