You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Markos Charatzas <xa...@forthnet.gr> on 2005/02/09 11:36:05 UTC

Charset (Struts and Velocity)

Hi there,

Although,

1. I have defined the charset in struts-config.xml like the following
<controller contentType="text/html; charset=ISO-8859-7"/>
2. In velocity properties I have set both 
input.encoding=ISO-8859-7
output.encoding=ISO-8859-7
3. my html templates have the content type set properly
4. my resource files are in the corrent content type

I still get question marks (?) displayed back to the browser when displaying 
anything that comes from an ApplicationResource file :(

Thanks in advance.
Markos Charatzas

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Charset (Struts and Velocity)

Posted by Markos Charatzas <xa...@forthnet.gr>.
Just to point out that the data stored in the DB is using cp-1253 :/

So far I didnt have to deal with ResourceBundles so all text was inside the 
HTML templates.

I cant seem to understand why setting the output encoding in 
velocity.properties to ISO-8859-7 would cause the data coming from the 
ResourceBundles not to display properly since *its encoded* in that same 
charset :/

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Charset (Struts and Velocity)

Posted by Markos Charatzas <xa...@forthnet.gr>.
On Friday 11 February 2005 07:21, Shinobu Kawai wrote:
> "resource files" and "charset" might be your problem.  Do you mean
> your resource files have non-ascii characters in it?  If so, that's
> your problem.  They must be escaped java-wise like "\u1234".
> cf.
> http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding


Yes, they actually have Greek character so I have saved them in ISO-8859-7

Ok here is what I've done.
I removed the contentType declaration in struts-config.xml
Now, in velocity.properties *if* i put either 

"output.encoding=ISO-8859-7"
or
"default.contentType=text/html; charset=ISO-8859-7"

then all data coming from the resource bundles isnt displayed properly (????)

if I remove either declaration in velocity.properties then the data displays 
correctly *but* all data (encoded in ISO-8859-7) made available to velocity 
via the "request.setAttribute(String, Object)" is displayed as "???". 

:S

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Charset (Struts and Velocity)

Posted by Shinobu Kawai <sh...@gmail.com>.
Hi Markos,

> > It's all Java stuff.  Java stores data in memory as Unicode, so
> > everything going into Java must be converted into Unicode.  Currently,
> > there is no way Java can tell whether a file is ascii or Greek or
> > Japanese or whatever.  So, you have to Unicode escape the files.
> > native2ascii makes life a bit easier.  ;)
> 
> Ok this is true, and maybe we are getting a bit out of topic but, why cant I
> just save the file in UTF-8 format? Isn't that unicode? :/

The quick answer is, "because that's how it's implemented".

> Also, while searching for a solution I came across the load(InputStream)
> method of java.util.Properties which has the value of charset hardcoded to
> "8859_1" which made me wonder...

But I guess you already know that...  So you see, although Java
internally uses unicode, Properties only accepts ascii files for
external storage.  Of course, you always have the choice to hack
Struts.  ;)

Best regards,
-- Shinobu

--
Shinobu Kawai <sh...@gmail.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Charset (Struts and Velocity)

Posted by mailmur <ma...@yahoo.com>.
> On Friday 11 February 2005 17:45, Shinobu Kawai
> wrote:
> > It's all Java stuff.  Java stores data in memory
> as Unicode, so
> > everything going into Java must be converted into
> Unicode.  Currently,
> > there is no way Java can tell whether a file is
> ascii or Greek or
> > Japanese or whatever.  So, you have to Unicode
> escape the files.
> > native2ascii makes life a bit easier.  ;)
> 
> Ok this is true, and maybe we are getting a bit out
> of topic but, why cant I 
> just save the file in UTF-8 format? Isn't that
> unicode? :/
> 
> Also, while searching for a solution I came across
> the load(InputStream) 
> method of java.util.Properties which has the value
> of charset hardcoded to 
> "8859_1" which made me wonder...

See my webpage and about UnicodeFileResourceLoader
extension.
http://koti.mbnet.fi/akini/java/unicodereader/

My loader handles properly UTF-8 BOM marker, which you
will get if use windows Notepad. Bom marker is a good
thing, but current java readers cannot handle it
properly (but do handle fine UTF-16 bom markers).

Java default uses ISO-8859-1 as an encoding if one is
not explicitly given. It is a source of various
problems in internationalization issues.

I always save all java .properties files as UTF-8 file
and load them with java.io.StreamInputStream instance
or my UnicodeInputStream/Reader utility classes.

If you generate web pages, _always_ assign
response.setContentType("text/html; charset=UTF-8") to
make life easier at browser side.


		
__________________________________ 
Do you Yahoo!? 
All your favorites on one personal page � Try My Yahoo!
http://my.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Charset (Struts and Velocity)

Posted by Markos Charatzas <xa...@forthnet.gr>.
On Friday 11 February 2005 17:45, Shinobu Kawai wrote:
> It's all Java stuff.  Java stores data in memory as Unicode, so
> everything going into Java must be converted into Unicode.  Currently,
> there is no way Java can tell whether a file is ascii or Greek or
> Japanese or whatever.  So, you have to Unicode escape the files.
> native2ascii makes life a bit easier.  ;)

Ok this is true, and maybe we are getting a bit out of topic but, why cant I 
just save the file in UTF-8 format? Isn't that unicode? :/

Also, while searching for a solution I came across the load(InputStream) 
method of java.util.Properties which has the value of charset hardcoded to 
"8859_1" which made me wonder...

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: graphs using velocity

Posted by Shinobu Kawai <sh...@gmail.com>.
Hi prasad,

>        Can anybody tell me way to generate graphs
> using velocity.
>        In my project i need to generate all types of
> graphs using my database I am using Turbine framework
> and torque for database and velocity as template
> engine.

What kind of graph did you have in mind?  If the format is not text,
chances are that you won't be able to use Velocity for it.

Best regards,
-- Shinobu

--
Shinobu Kawai <sh...@gmail.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: graphs using velocity

Posted by prasad neo <ne...@yahoo.com>.
  
    I have seen these graphs but where i will get
these  macros, is it inbuild in velocity engine? or i
have to embeed it from outside.
   
    how to build these varibles .



 --- Will Glass-Husain <wg...@forio.com> wrote: 
> PS.  One nice way Velocity can help with graphs is
> through macros.  If you 
> end up with a long complicated <img> url to generate
> a graph, abstract this 
> with a macro.  Our Velocity-based system has a
> number of graph related 
> macros.
>
http://www.forio.com/broadcastdocs/creating_interfaces/how_to_create_graphs.htm
> 
> For example, in our system the macro
> #LineGraph (["Revenue", "Costs"] 400 300)
> 
> generates the text
> 
> <img 
>
src="graph?FD_rand=1861&FD_graph=1&VariableName=Revenue&VariableName=Costs&Width=400&Height=300"
> 
> width="400" height="300">
> 
> which instructs our custom-written graph servlet to
> generate a graph of the 
> variables revenue and costs over time (in a GIF
> image sized 400x300).
> 
> Best,
> WILL
> 
> ----- Original Message ----- 
> From: "prasad neo" <ne...@yahoo.com>
> To: "Velocity Users List"
> <ve...@jakarta.apache.org>
> Sent: Monday, February 14, 2005 11:15 PM
> Subject: Re: graphs using velocity
> 
> 
> > thanks  Will Glass-Husain.
> > I will try jfree tool.
> > ok bye
> >
> >
> >
> > --- Will Glass-Husain <wg...@forio.com> wrote:
> >> Hi,
> >>
> >> I have a Velocity based web application that
> >> includes graphs.  I don't use
> >> velocity to generate graphs, I use a third party
> >> graphing app.  My web page
> >> includes a img tag with a special URL which
> displays
> >> a JPEG or GIF graph.
> >>
> >> There's a couple of different libraries that can
> >> generate the graphs.  You
> >> might try JFreeChart if you're looking for a free
> >> library.  Personally, I
> >> really like the commercial but inexpensive
> package
> >> KavaCharts (includes both
> >> server and client side components).  There's also
> a
> >> number of much more
> >> expensive server-side tools.
> >>
> >> WILL
> >>
> >> ----- Original Message ----- 
> >> From: "prasad neo" <ne...@yahoo.com>
> >> To: "Velocity Users List"
> >> <ve...@jakarta.apache.org>; "Shinobu
> >> Kawai" <sh...@gmail.com>
> >> Sent: Monday, February 14, 2005 10:53 PM
> >> Subject: graphs using velocity
> >>
> >>
> >> > Hii all
> >> >        Can anybody tell me way to generate
> graphs
> >> > using velocity.
> >> >        In my project i need to generate all
> types
> >> of
> >> > graphs using my database I am using Turbine
> >> framework
> >> > and torque for database and velocity as
> template
> >> > engine.
> >> >
> >> > so please help me
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > --- Shinobu Kawai <sh...@gmail.com>
> wrote:
> >> >> Hi Nathan,
> >> >>
> >> >> > > > no, i don't think it's documented
> anywhere.
> >> >> any good idea for where
> >> >> > > > such a note should go?
> >> >> > >
> >> >> > > I would definitely want one in the VVS
> >> javadoc
> >> >> and/or view tool top
> >> >> > > page.
> >> >> >
> >> >> > wanna make a patch? :)
> >> >>
> >> >> I'll file a bugzilla issue for you.  ;)
> >> >> ## I'll make the patch if I have some extra
> time.
> >> >>
> >> >> > >Would it be comfortable in the Velocity
> >> developer
> >> >> guide?
> >> >> >
> >> >> > i dunno, but certainly not unless/until the
> VVS
> >> >> makes it in there too.
> >> >>
> >> >> Figured you would say that.  :)
> >> >>
> >> >> Best regards,
> >> >> -- Shinobu
> >> >>
> >> >> --
> >> >> Shinobu Kawai <sh...@gmail.com>
> >> >>
> >> >>
> >> >
> >>
> >
>
---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail:
> >> >> velocity-user-unsubscribe@jakarta.apache.org
> >> >> For additional commands, e-mail:
> >> >> velocity-user-help@jakarta.apache.org
> >> >>
> >> >>
> >> >
> >> >
> >>
> >
>
________________________________________________________________________
> >> > Yahoo! India Matrimony: Find your life partner
> >> online
> >> > Go to: http://yahoo.shaadi.com/india-matrimony
> >> >
> >> >
> >>
> >
>
---------------------------------------------------------------------
> >> > To unsubscribe, e-mail:
> >> velocity-user-unsubscribe@jakarta.apache.org
> >> > For additional commands, e-mail:
> >> velocity-user-help@jakarta.apache.org
> >> >
> >>
> >>
> >>
> >
>
---------------------------------------------------------------------
> >> To unsubscribe, e-mail:
> >> velocity-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail:
> >> velocity-user-help@jakarta.apache.org
> >>
> >>
> >
> >
>
________________________________________________________________________
> > Yahoo! India Matrimony: Find your life partner
> online
> > Go to: http://yahoo.shaadi.com/india-matrimony
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> velocity-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> velocity-user-help@jakarta.apache.org
> > 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> velocity-user-help@jakarta.apache.org
> 
>  

________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: graphs using velocity

Posted by Dr Daniel Graham <da...@gr8.tv>.
IF you just need a little graph .. say a simple bar chart or line graph, 
you can use
a table, and stretch a 1 pixel gif to your desired width ...

<td width="90%"><img src=/imgs/blue1p.gif border=1 WIDTH=163 HEIGHT=12
></td>
<td width="90%"><img src=/imgs/blue1p.gif border=1 WIDTH=120 HEIGHT=12
></td>


and so on.

If you want a line graph, place a 1 pixed gif stretched before it then 
draw a single line .. 

you can do lot's of things like that with tables .. it's a bit heavy on 
HTML but not as much as a JPEG and so on .. and you'll usually only do it
for a limited number of columns.

HTH

DG



Will Glass-Husain wrote:

> Hi Prasad,
>
> This probably won't help you, as these are are custom VelocityMacros 
> we include in our system. (an online simulation engine called Forio 
> Broadcast). The source is not available, but the macros are fairly 
> simple.  (they just translate names of variables into a img tag with a 
> long URL).  Really, they're just a convenience.
>
> Still, if you're interested you can read our documentation.  "Revenue" 
> and "Costs" are simulation variables specific to our particular system 
> (basically, they are a series of double values arrayed over time).
> http://www.forio.com/broadcastdocs/creating_interfaces/how_to_create_graphs.htm 
>
>
> For more info on Velocity macros, read the Velocity docs.
> http://jakarta.apache.org/velocity/user-guide.html#Velocimacros
>
> For more info on how to create your own graph servlet, you'll have to 
> read the docs of the third-party graphing library you end up choosing.
>
> WILL
>
>
>
>
> ----- Original Message ----- From: "prasad neo" <ne...@yahoo.com>
> To: "Velocity Users List" <ve...@jakarta.apache.org>
> Sent: Monday, February 14, 2005 11:44 PM
> Subject: Re: graphs using velocity
>
>
>>
>>   how to build these varibles revenue and Costs. what
>> is its datatype.
>>   Is there any documentation for these macros if it
>> is then please send me links.
>>
>>
>>
>> --- Will Glass-Husain <wg...@forio.com> wrote:
>>
>>> PS.  One nice way Velocity can help with graphs is
>>> through macros.  If you
>>> end up with a long complicated <img> url to generate
>>> a graph, abstract this
>>> with a macro.  Our Velocity-based system has a
>>> number of graph related
>>> macros.
>>>
>> http://www.forio.com/broadcastdocs/creating_interfaces/how_to_create_graphs.htm 
>>
>>
>>>
>>> For example, in our system the macro
>>> #LineGraph (["Revenue", "Costs"] 400 300)
>>>
>>> generates the text
>>>
>>> <img
>>>
>> src="graph?FD_rand=1861&FD_graph=1&VariableName=Revenue&VariableName=Costs&Width=400&Height=300" 
>>
>>
>>>
>>> width="400" height="300">
>>>
>>> which instructs our custom-written graph servlet to
>>> generate a graph of the
>>> variables revenue and costs over time (in a GIF
>>> image sized 400x300).
>>>
>>> Best,
>>> WILL
>>>
>>> ----- Original Message ----- From: "prasad neo" <ne...@yahoo.com>
>>> To: "Velocity Users List"
>>> <ve...@jakarta.apache.org>
>>> Sent: Monday, February 14, 2005 11:15 PM
>>> Subject: Re: graphs using velocity
>>>
>>>
>>> > thanks  Will Glass-Husain.
>>> > I will try jfree tool.
>>> > ok bye
>>> >
>>> >
>>> >
>>> > --- Will Glass-Husain <wg...@forio.com> wrote:
>>> >> Hi,
>>> >>
>>> >> I have a Velocity based web application that
>>> >> includes graphs.  I don't use
>>> >> velocity to generate graphs, I use a third party
>>> >> graphing app.  My web page
>>> >> includes a img tag with a special URL which
>>> displays
>>> >> a JPEG or GIF graph.
>>> >>
>>> >> There's a couple of different libraries that can
>>> >> generate the graphs.  You
>>> >> might try JFreeChart if you're looking for a free
>>> >> library.  Personally, I
>>> >> really like the commercial but inexpensive
>>> package
>>> >> KavaCharts (includes both
>>> >> server and client side components).  There's also
>>> a
>>> >> number of much more
>>> >> expensive server-side tools.
>>> >>
>>> >> WILL
>>> >>
>>> >> ----- Original Message ----- >> From: "prasad neo" 
>>> <ne...@yahoo.com>
>>> >> To: "Velocity Users List"
>>> >> <ve...@jakarta.apache.org>; "Shinobu
>>> >> Kawai" <sh...@gmail.com>
>>> >> Sent: Monday, February 14, 2005 10:53 PM
>>> >> Subject: graphs using velocity
>>> >>
>>> >>
>>> >> > Hii all
>>> >> >        Can anybody tell me way to generate
>>> graphs
>>> >> > using velocity.
>>> >> >        In my project i need to generate all
>>> types
>>> >> of
>>> >> > graphs using my database I am using Turbine
>>> >> framework
>>> >> > and torque for database and velocity as
>>> template
>>> >> > engine.
>>> >> >
>>> >> > so please help me
>>> >> >
>>> >> >
>>> >> >
>>> >> >
>>> >> >
>>> >> >
>>> >> >
>>> >> >
>>> >> >
>>> >> >
>>> >> >
>>> >> > --- Shinobu Kawai <sh...@gmail.com>
>>> wrote:
>>> >> >> Hi Nathan,
>>> >> >>
>>> >> >> > > > no, i don't think it's documented
>>> anywhere.
>>> >> >> any good idea for where
>>> >> >> > > > such a note should go?
>>> >> >> > >
>>> >> >> > > I would definitely want one in the VVS
>>> >> javadoc
>>> >> >> and/or view tool top
>>> >> >> > > page.
>>> >> >> >
>>> >> >> > wanna make a patch? :)
>>> >> >>
>>> >> >> I'll file a bugzilla issue for you.  ;)
>>> >> >> ## I'll make the patch if I have some extra
>>> time.
>>> >> >>
>>> >> >> > >Would it be comfortable in the Velocity
>>> >> developer
>>> >> >> guide?
>>> >> >> >
>>> >> >> > i dunno, but certainly not unless/until the
>>> VVS
>>> >> >> makes it in there too.
>>> >> >>
>>> >> >> Figured you would say that.  :)
>>> >> >>
>>> >> >> Best regards,
>>> >> >> -- Shinobu
>>> >> >>
>>> >> >> --
>>> >> >> Shinobu Kawai <sh...@gmail.com>
>>> >> >>
>>> >> >>
>>> >> >
>>> >>
>>> >
>>>
>> ---------------------------------------------------------------------
>>
>>> >> >> To unsubscribe, e-mail:
>>> >> >> velocity-user-unsubscribe@jakarta.apache.org
>>> >> >> For additional commands, e-mail:
>>> >> >> velocity-user-help@jakarta.apache.org
>>> >> >>
>>> >> >>
>>> >> >
>>> >> >
>>> >>
>>> >
>>>
>> ________________________________________________________________________
>>
>>> >> > Yahoo! India Matrimony: Find your life partner
>>> >> online
>>> >> > Go to: http://yahoo.shaadi.com/india-matrimony
>>> >> >
>>> >> >
>>> >>
>>> >
>>>
>> ---------------------------------------------------------------------
>>
>>> >> > To unsubscribe, e-mail:
>>> >> velocity-user-unsubscribe@jakarta.apache.org
>>> >> > For additional commands, e-mail:
>>> >> velocity-user-help@jakarta.apache.org
>>> >> >
>>> >>
>>> >>
>>> >>
>>> >
>>>
>> ---------------------------------------------------------------------
>>
>>> >> To unsubscribe, e-mail:
>>> >> velocity-user-unsubscribe@jakarta.apache.org
>>> >> For additional commands, e-mail:
>>> >> velocity-user-help@jakarta.apache.org
>>> >>
>>> >>
>>> >
>>> >
>>>
>> ________________________________________________________________________
>>
>>> > Yahoo! India Matrimony: Find your life partner
>>> online
>>> > Go to: http://yahoo.shaadi.com/india-matrimony
>>> >
>>> >
>>>
>> ---------------------------------------------------------------------
>>
>>> > To unsubscribe, e-mail:
>>> velocity-user-unsubscribe@jakarta.apache.org
>>> > For additional commands, e-mail:
>>> velocity-user-help@jakarta.apache.org
>>> >
>>>
>>>
>>>
>> ---------------------------------------------------------------------
>>
>>> To unsubscribe, e-mail:
>>> velocity-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail:
>>> velocity-user-help@jakarta.apache.org
>>>
>>>
>>
>> ________________________________________________________________________
>> Yahoo! India Matrimony: Find your life partner online
>> Go to: http://yahoo.shaadi.com/india-matrimony
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.8.8 - Release Date: 14/02/2005


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: graphs using velocity

Posted by Will Glass-Husain <wg...@forio.com>.
Hi Prasad,

This probably won't help you, as these are are custom VelocityMacros we 
include in our system. (an online simulation engine called Forio Broadcast). 
The source is not available, but the macros are fairly simple.  (they just 
translate names of variables into a img tag with a long URL).  Really, 
they're just a convenience.

Still, if you're interested you can read our documentation.  "Revenue" and 
"Costs" are simulation variables specific to our particular system 
(basically, they are a series of double values arrayed over time).
http://www.forio.com/broadcastdocs/creating_interfaces/how_to_create_graphs.htm

For more info on Velocity macros, read the Velocity docs.
http://jakarta.apache.org/velocity/user-guide.html#Velocimacros

For more info on how to create your own graph servlet, you'll have to read 
the docs of the third-party graphing library you end up choosing.

WILL




----- Original Message ----- 
From: "prasad neo" <ne...@yahoo.com>
To: "Velocity Users List" <ve...@jakarta.apache.org>
Sent: Monday, February 14, 2005 11:44 PM
Subject: Re: graphs using velocity


>
>   how to build these varibles revenue and Costs. what
> is its datatype.
>   Is there any documentation for these macros if it
> is then please send me links.
>
>
>
> --- Will Glass-Husain <wg...@forio.com> wrote:
>> PS.  One nice way Velocity can help with graphs is
>> through macros.  If you
>> end up with a long complicated <img> url to generate
>> a graph, abstract this
>> with a macro.  Our Velocity-based system has a
>> number of graph related
>> macros.
>>
> http://www.forio.com/broadcastdocs/creating_interfaces/how_to_create_graphs.htm
>>
>> For example, in our system the macro
>> #LineGraph (["Revenue", "Costs"] 400 300)
>>
>> generates the text
>>
>> <img
>>
> src="graph?FD_rand=1861&FD_graph=1&VariableName=Revenue&VariableName=Costs&Width=400&Height=300"
>>
>> width="400" height="300">
>>
>> which instructs our custom-written graph servlet to
>> generate a graph of the
>> variables revenue and costs over time (in a GIF
>> image sized 400x300).
>>
>> Best,
>> WILL
>>
>> ----- Original Message ----- 
>> From: "prasad neo" <ne...@yahoo.com>
>> To: "Velocity Users List"
>> <ve...@jakarta.apache.org>
>> Sent: Monday, February 14, 2005 11:15 PM
>> Subject: Re: graphs using velocity
>>
>>
>> > thanks  Will Glass-Husain.
>> > I will try jfree tool.
>> > ok bye
>> >
>> >
>> >
>> > --- Will Glass-Husain <wg...@forio.com> wrote:
>> >> Hi,
>> >>
>> >> I have a Velocity based web application that
>> >> includes graphs.  I don't use
>> >> velocity to generate graphs, I use a third party
>> >> graphing app.  My web page
>> >> includes a img tag with a special URL which
>> displays
>> >> a JPEG or GIF graph.
>> >>
>> >> There's a couple of different libraries that can
>> >> generate the graphs.  You
>> >> might try JFreeChart if you're looking for a free
>> >> library.  Personally, I
>> >> really like the commercial but inexpensive
>> package
>> >> KavaCharts (includes both
>> >> server and client side components).  There's also
>> a
>> >> number of much more
>> >> expensive server-side tools.
>> >>
>> >> WILL
>> >>
>> >> ----- Original Message ----- 
>> >> From: "prasad neo" <ne...@yahoo.com>
>> >> To: "Velocity Users List"
>> >> <ve...@jakarta.apache.org>; "Shinobu
>> >> Kawai" <sh...@gmail.com>
>> >> Sent: Monday, February 14, 2005 10:53 PM
>> >> Subject: graphs using velocity
>> >>
>> >>
>> >> > Hii all
>> >> >        Can anybody tell me way to generate
>> graphs
>> >> > using velocity.
>> >> >        In my project i need to generate all
>> types
>> >> of
>> >> > graphs using my database I am using Turbine
>> >> framework
>> >> > and torque for database and velocity as
>> template
>> >> > engine.
>> >> >
>> >> > so please help me
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >> > --- Shinobu Kawai <sh...@gmail.com>
>> wrote:
>> >> >> Hi Nathan,
>> >> >>
>> >> >> > > > no, i don't think it's documented
>> anywhere.
>> >> >> any good idea for where
>> >> >> > > > such a note should go?
>> >> >> > >
>> >> >> > > I would definitely want one in the VVS
>> >> javadoc
>> >> >> and/or view tool top
>> >> >> > > page.
>> >> >> >
>> >> >> > wanna make a patch? :)
>> >> >>
>> >> >> I'll file a bugzilla issue for you.  ;)
>> >> >> ## I'll make the patch if I have some extra
>> time.
>> >> >>
>> >> >> > >Would it be comfortable in the Velocity
>> >> developer
>> >> >> guide?
>> >> >> >
>> >> >> > i dunno, but certainly not unless/until the
>> VVS
>> >> >> makes it in there too.
>> >> >>
>> >> >> Figured you would say that.  :)
>> >> >>
>> >> >> Best regards,
>> >> >> -- Shinobu
>> >> >>
>> >> >> --
>> >> >> Shinobu Kawai <sh...@gmail.com>
>> >> >>
>> >> >>
>> >> >
>> >>
>> >
>>
> ---------------------------------------------------------------------
>> >> >> To unsubscribe, e-mail:
>> >> >> velocity-user-unsubscribe@jakarta.apache.org
>> >> >> For additional commands, e-mail:
>> >> >> velocity-user-help@jakarta.apache.org
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >>
>> >
>>
> ________________________________________________________________________
>> >> > Yahoo! India Matrimony: Find your life partner
>> >> online
>> >> > Go to: http://yahoo.shaadi.com/india-matrimony
>> >> >
>> >> >
>> >>
>> >
>>
> ---------------------------------------------------------------------
>> >> > To unsubscribe, e-mail:
>> >> velocity-user-unsubscribe@jakarta.apache.org
>> >> > For additional commands, e-mail:
>> >> velocity-user-help@jakarta.apache.org
>> >> >
>> >>
>> >>
>> >>
>> >
>>
> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail:
>> >> velocity-user-unsubscribe@jakarta.apache.org
>> >> For additional commands, e-mail:
>> >> velocity-user-help@jakarta.apache.org
>> >>
>> >>
>> >
>> >
>>
> ________________________________________________________________________
>> > Yahoo! India Matrimony: Find your life partner
>> online
>> > Go to: http://yahoo.shaadi.com/india-matrimony
>> >
>> >
>>
> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail:
>> velocity-user-unsubscribe@jakarta.apache.org
>> > For additional commands, e-mail:
>> velocity-user-help@jakarta.apache.org
>> >
>>
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> velocity-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail:
>> velocity-user-help@jakarta.apache.org
>>
>>
>
> ________________________________________________________________________
> Yahoo! India Matrimony: Find your life partner online
> Go to: http://yahoo.shaadi.com/india-matrimony
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: graphs using velocity

Posted by prasad neo <ne...@yahoo.com>.
   how to build these varibles revenue and Costs. what
is its datatype.
   Is there any documentation for these macros if it
is then please send me links.



 --- Will Glass-Husain <wg...@forio.com> wrote: 
> PS.  One nice way Velocity can help with graphs is
> through macros.  If you 
> end up with a long complicated <img> url to generate
> a graph, abstract this 
> with a macro.  Our Velocity-based system has a
> number of graph related 
> macros.
>
http://www.forio.com/broadcastdocs/creating_interfaces/how_to_create_graphs.htm
> 
> For example, in our system the macro
> #LineGraph (["Revenue", "Costs"] 400 300)
> 
> generates the text
> 
> <img 
>
src="graph?FD_rand=1861&FD_graph=1&VariableName=Revenue&VariableName=Costs&Width=400&Height=300"
> 
> width="400" height="300">
> 
> which instructs our custom-written graph servlet to
> generate a graph of the 
> variables revenue and costs over time (in a GIF
> image sized 400x300).
> 
> Best,
> WILL
> 
> ----- Original Message ----- 
> From: "prasad neo" <ne...@yahoo.com>
> To: "Velocity Users List"
> <ve...@jakarta.apache.org>
> Sent: Monday, February 14, 2005 11:15 PM
> Subject: Re: graphs using velocity
> 
> 
> > thanks  Will Glass-Husain.
> > I will try jfree tool.
> > ok bye
> >
> >
> >
> > --- Will Glass-Husain <wg...@forio.com> wrote:
> >> Hi,
> >>
> >> I have a Velocity based web application that
> >> includes graphs.  I don't use
> >> velocity to generate graphs, I use a third party
> >> graphing app.  My web page
> >> includes a img tag with a special URL which
> displays
> >> a JPEG or GIF graph.
> >>
> >> There's a couple of different libraries that can
> >> generate the graphs.  You
> >> might try JFreeChart if you're looking for a free
> >> library.  Personally, I
> >> really like the commercial but inexpensive
> package
> >> KavaCharts (includes both
> >> server and client side components).  There's also
> a
> >> number of much more
> >> expensive server-side tools.
> >>
> >> WILL
> >>
> >> ----- Original Message ----- 
> >> From: "prasad neo" <ne...@yahoo.com>
> >> To: "Velocity Users List"
> >> <ve...@jakarta.apache.org>; "Shinobu
> >> Kawai" <sh...@gmail.com>
> >> Sent: Monday, February 14, 2005 10:53 PM
> >> Subject: graphs using velocity
> >>
> >>
> >> > Hii all
> >> >        Can anybody tell me way to generate
> graphs
> >> > using velocity.
> >> >        In my project i need to generate all
> types
> >> of
> >> > graphs using my database I am using Turbine
> >> framework
> >> > and torque for database and velocity as
> template
> >> > engine.
> >> >
> >> > so please help me
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > --- Shinobu Kawai <sh...@gmail.com>
> wrote:
> >> >> Hi Nathan,
> >> >>
> >> >> > > > no, i don't think it's documented
> anywhere.
> >> >> any good idea for where
> >> >> > > > such a note should go?
> >> >> > >
> >> >> > > I would definitely want one in the VVS
> >> javadoc
> >> >> and/or view tool top
> >> >> > > page.
> >> >> >
> >> >> > wanna make a patch? :)
> >> >>
> >> >> I'll file a bugzilla issue for you.  ;)
> >> >> ## I'll make the patch if I have some extra
> time.
> >> >>
> >> >> > >Would it be comfortable in the Velocity
> >> developer
> >> >> guide?
> >> >> >
> >> >> > i dunno, but certainly not unless/until the
> VVS
> >> >> makes it in there too.
> >> >>
> >> >> Figured you would say that.  :)
> >> >>
> >> >> Best regards,
> >> >> -- Shinobu
> >> >>
> >> >> --
> >> >> Shinobu Kawai <sh...@gmail.com>
> >> >>
> >> >>
> >> >
> >>
> >
>
---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail:
> >> >> velocity-user-unsubscribe@jakarta.apache.org
> >> >> For additional commands, e-mail:
> >> >> velocity-user-help@jakarta.apache.org
> >> >>
> >> >>
> >> >
> >> >
> >>
> >
>
________________________________________________________________________
> >> > Yahoo! India Matrimony: Find your life partner
> >> online
> >> > Go to: http://yahoo.shaadi.com/india-matrimony
> >> >
> >> >
> >>
> >
>
---------------------------------------------------------------------
> >> > To unsubscribe, e-mail:
> >> velocity-user-unsubscribe@jakarta.apache.org
> >> > For additional commands, e-mail:
> >> velocity-user-help@jakarta.apache.org
> >> >
> >>
> >>
> >>
> >
>
---------------------------------------------------------------------
> >> To unsubscribe, e-mail:
> >> velocity-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail:
> >> velocity-user-help@jakarta.apache.org
> >>
> >>
> >
> >
>
________________________________________________________________________
> > Yahoo! India Matrimony: Find your life partner
> online
> > Go to: http://yahoo.shaadi.com/india-matrimony
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> velocity-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> velocity-user-help@jakarta.apache.org
> > 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> velocity-user-help@jakarta.apache.org
> 
>  

________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: graphs using velocity

Posted by Will Glass-Husain <wg...@forio.com>.
PS.  One nice way Velocity can help with graphs is through macros.  If you 
end up with a long complicated <img> url to generate a graph, abstract this 
with a macro.  Our Velocity-based system has a number of graph related 
macros.
http://www.forio.com/broadcastdocs/creating_interfaces/how_to_create_graphs.htm

For example, in our system the macro
#LineGraph (["Revenue", "Costs"] 400 300)

generates the text

<img 
src="graph?FD_rand=1861&FD_graph=1&VariableName=Revenue&VariableName=Costs&Width=400&Height=300" 
width="400" height="300">

which instructs our custom-written graph servlet to generate a graph of the 
variables revenue and costs over time (in a GIF image sized 400x300).

Best,
WILL

----- Original Message ----- 
From: "prasad neo" <ne...@yahoo.com>
To: "Velocity Users List" <ve...@jakarta.apache.org>
Sent: Monday, February 14, 2005 11:15 PM
Subject: Re: graphs using velocity


> thanks  Will Glass-Husain.
> I will try jfree tool.
> ok bye
>
>
>
> --- Will Glass-Husain <wg...@forio.com> wrote:
>> Hi,
>>
>> I have a Velocity based web application that
>> includes graphs.  I don't use
>> velocity to generate graphs, I use a third party
>> graphing app.  My web page
>> includes a img tag with a special URL which displays
>> a JPEG or GIF graph.
>>
>> There's a couple of different libraries that can
>> generate the graphs.  You
>> might try JFreeChart if you're looking for a free
>> library.  Personally, I
>> really like the commercial but inexpensive package
>> KavaCharts (includes both
>> server and client side components).  There's also a
>> number of much more
>> expensive server-side tools.
>>
>> WILL
>>
>> ----- Original Message ----- 
>> From: "prasad neo" <ne...@yahoo.com>
>> To: "Velocity Users List"
>> <ve...@jakarta.apache.org>; "Shinobu
>> Kawai" <sh...@gmail.com>
>> Sent: Monday, February 14, 2005 10:53 PM
>> Subject: graphs using velocity
>>
>>
>> > Hii all
>> >        Can anybody tell me way to generate graphs
>> > using velocity.
>> >        In my project i need to generate all types
>> of
>> > graphs using my database I am using Turbine
>> framework
>> > and torque for database and velocity as template
>> > engine.
>> >
>> > so please help me
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > --- Shinobu Kawai <sh...@gmail.com> wrote:
>> >> Hi Nathan,
>> >>
>> >> > > > no, i don't think it's documented anywhere.
>> >> any good idea for where
>> >> > > > such a note should go?
>> >> > >
>> >> > > I would definitely want one in the VVS
>> javadoc
>> >> and/or view tool top
>> >> > > page.
>> >> >
>> >> > wanna make a patch? :)
>> >>
>> >> I'll file a bugzilla issue for you.  ;)
>> >> ## I'll make the patch if I have some extra time.
>> >>
>> >> > >Would it be comfortable in the Velocity
>> developer
>> >> guide?
>> >> >
>> >> > i dunno, but certainly not unless/until the VVS
>> >> makes it in there too.
>> >>
>> >> Figured you would say that.  :)
>> >>
>> >> Best regards,
>> >> -- Shinobu
>> >>
>> >> --
>> >> Shinobu Kawai <sh...@gmail.com>
>> >>
>> >>
>> >
>>
> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail:
>> >> velocity-user-unsubscribe@jakarta.apache.org
>> >> For additional commands, e-mail:
>> >> velocity-user-help@jakarta.apache.org
>> >>
>> >>
>> >
>> >
>>
> ________________________________________________________________________
>> > Yahoo! India Matrimony: Find your life partner
>> online
>> > Go to: http://yahoo.shaadi.com/india-matrimony
>> >
>> >
>>
> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail:
>> velocity-user-unsubscribe@jakarta.apache.org
>> > For additional commands, e-mail:
>> velocity-user-help@jakarta.apache.org
>> >
>>
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> velocity-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail:
>> velocity-user-help@jakarta.apache.org
>>
>>
>
> ________________________________________________________________________
> Yahoo! India Matrimony: Find your life partner online
> Go to: http://yahoo.shaadi.com/india-matrimony
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: graphs using velocity

Posted by prasad neo <ne...@yahoo.com>.
thanks  Will Glass-Husain.
 I will try jfree tool.
ok bye



--- Will Glass-Husain <wg...@forio.com> wrote: 
> Hi,
> 
> I have a Velocity based web application that
> includes graphs.  I don't use 
> velocity to generate graphs, I use a third party
> graphing app.  My web page 
> includes a img tag with a special URL which displays
> a JPEG or GIF graph.
> 
> There's a couple of different libraries that can
> generate the graphs.  You 
> might try JFreeChart if you're looking for a free
> library.  Personally, I 
> really like the commercial but inexpensive package
> KavaCharts (includes both 
> server and client side components).  There's also a
> number of much more 
> expensive server-side tools.
> 
> WILL
> 
> ----- Original Message ----- 
> From: "prasad neo" <ne...@yahoo.com>
> To: "Velocity Users List"
> <ve...@jakarta.apache.org>; "Shinobu 
> Kawai" <sh...@gmail.com>
> Sent: Monday, February 14, 2005 10:53 PM
> Subject: graphs using velocity
> 
> 
> > Hii all
> >        Can anybody tell me way to generate graphs
> > using velocity.
> >        In my project i need to generate all types
> of
> > graphs using my database I am using Turbine
> framework
> > and torque for database and velocity as template
> > engine.
> >
> > so please help me
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > --- Shinobu Kawai <sh...@gmail.com> wrote:
> >> Hi Nathan,
> >>
> >> > > > no, i don't think it's documented anywhere.
> >> any good idea for where
> >> > > > such a note should go?
> >> > >
> >> > > I would definitely want one in the VVS
> javadoc
> >> and/or view tool top
> >> > > page.
> >> >
> >> > wanna make a patch? :)
> >>
> >> I'll file a bugzilla issue for you.  ;)
> >> ## I'll make the patch if I have some extra time.
> >>
> >> > >Would it be comfortable in the Velocity
> developer
> >> guide?
> >> >
> >> > i dunno, but certainly not unless/until the VVS
> >> makes it in there too.
> >>
> >> Figured you would say that.  :)
> >>
> >> Best regards,
> >> -- Shinobu
> >>
> >> --
> >> Shinobu Kawai <sh...@gmail.com>
> >>
> >>
> >
>
---------------------------------------------------------------------
> >> To unsubscribe, e-mail:
> >> velocity-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail:
> >> velocity-user-help@jakarta.apache.org
> >>
> >>
> >
> >
>
________________________________________________________________________
> > Yahoo! India Matrimony: Find your life partner
> online
> > Go to: http://yahoo.shaadi.com/india-matrimony
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> velocity-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> velocity-user-help@jakarta.apache.org
> > 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> velocity-user-help@jakarta.apache.org
> 
>  

________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: graphs using velocity

Posted by Will Glass-Husain <wg...@forio.com>.
Hi,

I have a Velocity based web application that includes graphs.  I don't use 
velocity to generate graphs, I use a third party graphing app.  My web page 
includes a img tag with a special URL which displays a JPEG or GIF graph.

There's a couple of different libraries that can generate the graphs.  You 
might try JFreeChart if you're looking for a free library.  Personally, I 
really like the commercial but inexpensive package KavaCharts (includes both 
server and client side components).  There's also a number of much more 
expensive server-side tools.

WILL

----- Original Message ----- 
From: "prasad neo" <ne...@yahoo.com>
To: "Velocity Users List" <ve...@jakarta.apache.org>; "Shinobu 
Kawai" <sh...@gmail.com>
Sent: Monday, February 14, 2005 10:53 PM
Subject: graphs using velocity


> Hii all
>        Can anybody tell me way to generate graphs
> using velocity.
>        In my project i need to generate all types of
> graphs using my database I am using Turbine framework
> and torque for database and velocity as template
> engine.
>
> so please help me
>
>
>
>
>
>
>
>
>
>
>
> --- Shinobu Kawai <sh...@gmail.com> wrote:
>> Hi Nathan,
>>
>> > > > no, i don't think it's documented anywhere.
>> any good idea for where
>> > > > such a note should go?
>> > >
>> > > I would definitely want one in the VVS javadoc
>> and/or view tool top
>> > > page.
>> >
>> > wanna make a patch? :)
>>
>> I'll file a bugzilla issue for you.  ;)
>> ## I'll make the patch if I have some extra time.
>>
>> > >Would it be comfortable in the Velocity developer
>> guide?
>> >
>> > i dunno, but certainly not unless/until the VVS
>> makes it in there too.
>>
>> Figured you would say that.  :)
>>
>> Best regards,
>> -- Shinobu
>>
>> --
>> Shinobu Kawai <sh...@gmail.com>
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> velocity-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail:
>> velocity-user-help@jakarta.apache.org
>>
>>
>
> ________________________________________________________________________
> Yahoo! India Matrimony: Find your life partner online
> Go to: http://yahoo.shaadi.com/india-matrimony
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


graphs using velocity

Posted by prasad neo <ne...@yahoo.com>.
Hii all
        Can anybody tell me way to generate graphs
using velocity.
        In my project i need to generate all types of
graphs using my database I am using Turbine framework
and torque for database and velocity as template
engine.
 
so please help me 











 --- Shinobu Kawai <sh...@gmail.com> wrote: 
> Hi Nathan,
> 
> > > > no, i don't think it's documented anywhere. 
> any good idea for where
> > > > such a note should go?
> > >
> > > I would definitely want one in the VVS javadoc
> and/or view tool top
> > > page.
> > 
> > wanna make a patch? :)
> 
> I'll file a bugzilla issue for you.  ;)
> ## I'll make the patch if I have some extra time.
> 
> > >Would it be comfortable in the Velocity developer
> guide?
> > 
> > i dunno, but certainly not unless/until the VVS
> makes it in there too.
> 
> Figured you would say that.  :)
> 
> Best regards,
> -- Shinobu
> 
> --
> Shinobu Kawai <sh...@gmail.com>
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> velocity-user-help@jakarta.apache.org
> 
>  

________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Charset (Struts and Velocity)

Posted by Shinobu Kawai <sh...@gmail.com>.
Hi Nathan,

> > > no, i don't think it's documented anywhere.  any good idea for where
> > > such a note should go?
> >
> > I would definitely want one in the VVS javadoc and/or view tool top
> > page.
> 
> wanna make a patch? :)

I'll file a bugzilla issue for you.  ;)
## I'll make the patch if I have some extra time.

> >Would it be comfortable in the Velocity developer guide?
> 
> i dunno, but certainly not unless/until the VVS makes it in there too.

Figured you would say that.  :)

Best regards,
-- Shinobu

--
Shinobu Kawai <sh...@gmail.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Charset (Struts and Velocity)

Posted by Nathan Bubna <nb...@gmail.com>.
On Mon, 14 Feb 2005 01:01:23 -0800, Shinobu Kawai
<sh...@gmail.com> wrote:
> Hi Nathan,
> 
> > > > the VelocityViewServlet (largely in the interest of compatibility with
> > > > VelocityServlet) does take the output.encoding property into account,
> > > > but only if there is no charset specified within the
> > > > default.contentType property.
> > >
> > > Didn't know that.  Maybe it needs to get it the docs.  :)
> > > ## Or is it already there?
> >
> > no, i don't think it's documented anywhere.  any good idea for where
> > such a note should go?
> 
> I would definitely want one in the VVS javadoc and/or view tool top
> page.  

wanna make a patch? :)

>Would it be comfortable in the Velocity developer guide?

i dunno, but certainly not unless/until the VVS makes it in there too.

> Best regards,
> -- Shinobu
> 
> --
> Shinobu Kawai <sh...@gmail.com>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Charset (Struts and Velocity)

Posted by Shinobu Kawai <sh...@gmail.com>.
Hi Nathan,

> > > the VelocityViewServlet (largely in the interest of compatibility with
> > > VelocityServlet) does take the output.encoding property into account,
> > > but only if there is no charset specified within the
> > > default.contentType property.
> >
> > Didn't know that.  Maybe it needs to get it the docs.  :)
> > ## Or is it already there?
> 
> no, i don't think it's documented anywhere.  any good idea for where
> such a note should go?

I would definitely want one in the VVS javadoc and/or view tool top
page.  Would it be comfortable in the Velocity developer guide?

Best regards,
-- Shinobu

--
Shinobu Kawai <sh...@gmail.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Charset (Struts and Velocity)

Posted by Nathan Bubna <nb...@gmail.com>.
On Fri, 11 Feb 2005 13:59:38 -0800, Shinobu Kawai
<sh...@gmail.com> wrote:
> Hi Nathan,
> 
> > > > Still I cannot understand why setting the output.encoding to ISO-8859-7 in
> > > > velocity.properties has that effect I mentioned earlier.
> > > >
> > > > Even more since you pointed out that the output.encoding doesn't matter unless
> > > > you're using VelocityServlet or Anakia and Im using VelocityViewServlet
> > >
> > > That IS weird.  Somebody might want to look into that.
> >
> > the VelocityViewServlet (largely in the interest of compatibility with
> > VelocityServlet) does take the output.encoding property into account,
> > but only if there is no charset specified within the
> > default.contentType property.
> 
> Didn't know that.  Maybe it needs to get it the docs.  :)
> ## Or is it already there?

no, i don't think it's documented anywhere.  any good idea for where
such a note should go?

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Charset (Struts and Velocity)

Posted by Shinobu Kawai <sh...@gmail.com>.
Hi Nathan,

> > > Still I cannot understand why setting the output.encoding to ISO-8859-7 in
> > > velocity.properties has that effect I mentioned earlier.
> > >
> > > Even more since you pointed out that the output.encoding doesn't matter unless
> > > you're using VelocityServlet or Anakia and Im using VelocityViewServlet
> >
> > That IS weird.  Somebody might want to look into that.
> 
> the VelocityViewServlet (largely in the interest of compatibility with
> VelocityServlet) does take the output.encoding property into account,
> but only if there is no charset specified within the
> default.contentType property.

Didn't know that.  Maybe it needs to get it the docs.  :)
## Or is it already there?

Best regards,
-- Shinobu

--
Shinobu Kawai <sh...@gmail.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Charset (Struts and Velocity)

Posted by Nathan Bubna <nb...@gmail.com>.
On Fri, 11 Feb 2005 07:45:19 -0800, Shinobu Kawai
<sh...@gmail.com> wrote:
...
> > Still I cannot understand why setting the output.encoding to ISO-8859-7 in
> > velocity.properties has that effect I mentioned earlier.
> >
> > Even more since you pointed out that the output.encoding doesn't matter unless
> > you're using VelocityServlet or Anakia and Im using VelocityViewServlet
> 
> That IS weird.  Somebody might want to look into that.

the VelocityViewServlet (largely in the interest of compatibility with
VelocityServlet) does take the output.encoding property into account,
but only if there is no charset specified within the
default.contentType property.

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Charset (Struts and Velocity)

Posted by Shinobu Kawai <sh...@gmail.com>.
Hi Markos,

> >They must be escaped java-wise like "\u1234".
> 
> Shinobu I did that and it worked. Thanks.

Welcome.  :)

> Although I find it a bit hard to accept that any resource bundle must be in
> that format. That makes life a bit harder :/

It's all Java stuff.  Java stores data in memory as Unicode, so
everything going into Java must be converted into Unicode.  Currently,
there is no way Java can tell whether a file is ascii or Greek or
Japanese or whatever.  So, you have to Unicode escape the files. 
native2ascii makes life a bit easier.  ;)

> Still I cannot understand why setting the output.encoding to ISO-8859-7 in
> velocity.properties has that effect I mentioned earlier.
> 
> Even more since you pointed out that the output.encoding doesn't matter unless
> you're using VelocityServlet or Anakia and Im using VelocityViewServlet

That IS weird.  Somebody might want to look into that.

Best regards,
-- Shinobu

--
Shinobu Kawai <sh...@gmail.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Charset (Struts and Velocity)

Posted by Markos Charatzas <xa...@forthnet.gr>.
On Friday 11 February 2005 07:21, Shinobu Kawai wrote:
>They must be escaped java-wise like "\u1234".

Shinobu I did that and it worked. Thanks.

Although I find it a bit hard to accept that any resource bundle must be in 
that format. That makes life a bit harder :/

Still I cannot understand why setting the output.encoding to ISO-8859-7 in 
velocity.properties has that effect I mentioned earlier. 

Even more since you pointed out that the output.encoding doesn't matter unless 
you're using VelocityServlet or Anakia and Im using VelocityViewServlet

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Charset (Struts and Velocity)

Posted by Shinobu Kawai <sh...@gmail.com>.
Hi Markos,

> > Please refresh my memory.  Was there a way to specify "content type"
> > in "resource files"?  I thought they were just PropertyResourceBundle
> > files.
> 
> I meant charset, thanks for pointing that out.
> 
> > Question marks usually means that the charset converter couldn't find
> > the suitable character for the conversion.  If you spit out some log
> > from java, is it encoded properly, or do you get question marks there,
> > too?
> 
> Yeah, everything comes out fine in all except when the output comes from a
> resource bundle :/

"resource files" and "charset" might be your problem.  Do you mean
your resource files have non-ascii characters in it?  If so, that's
your problem.  They must be escaped java-wise like "\u1234".
cf. http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html#encoding

Best regards,
-- Shinobu

--
Shinobu Kawai <sh...@gmail.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Charset (Struts and Velocity)

Posted by Nathan Bubna <nb...@gmail.com>.
<disclaimer>i've only halfheartedly read this thread and personally
never use non-default charsets</disclaimer>

have you tried setting the default.contentType property that the VVS
looks for?

e.g.  "default.contentType=text/html; charset=ISO-8859-1"

i'm half-doubting that's the problem, but it wouldn't hurt to try.

On Thu, 10 Feb 2005 12:54:43 +0200, Markos Charatzas <xa...@forthnet.gr> wrote:
> Hi Shinobu,
> 
> > #*
> > Actually, the output.encoding doesn't matter unless you're using
> > VelocityServlet or Anakia.  ;)
> 
> Yeap you are right...it must have been there since we migrated to
> VelocityViewServlet :)
> 
> > Please refresh my memory.  Was there a way to specify "content type"
> > in "resource files"?  I thought they were just PropertyResourceBundle
> > files.
> 
> I meant charset, thanks for pointing that out.
> 
> > Question marks usually means that the charset converter couldn't find
> > the suitable character for the conversion.  If you spit out some log
> > from java, is it encoded properly, or do you get question marks there,
> > too?
> 
> Yeah, everything comes out fine in all except when the output comes from a
> resource bundle :/
> 
> Thank you.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Charset (Struts and Velocity)

Posted by Markos Charatzas <xa...@forthnet.gr>.
Hi Shinobu,

> #*
> Actually, the output.encoding doesn't matter unless you're using
> VelocityServlet or Anakia.  ;)

Yeap you are right...it must have been there since we migrated to 
VelocityViewServlet :)

> Please refresh my memory.  Was there a way to specify "content type"
> in "resource files"?  I thought they were just PropertyResourceBundle
> files.

I meant charset, thanks for pointing that out.

> Question marks usually means that the charset converter couldn't find
> the suitable character for the conversion.  If you spit out some log
> from java, is it encoded properly, or do you get question marks there,
> too?

Yeah, everything comes out fine in all except when the output comes from a 
resource bundle :/

Thank you.

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Charset (Struts and Velocity)

Posted by Shinobu Kawai <sh...@gmail.com>.
Hi Markos,

> Although,
> 
> 1. I have defined the charset in struts-config.xml like the following
> <controller contentType="text/html; charset=ISO-8859-7"/>
> 2. In velocity properties I have set both
> input.encoding=ISO-8859-7
> output.encoding=ISO-8859-7

#*
Actually, the output.encoding doesn't matter unless you're using
VelocityServlet or Anakia.  ;)
   http://jakarta.apache.org/velocity/developer-guide.html#Velocity%20Configuration%20Keys%20and%20Values
*#

> 3. my html templates have the content type set properly
> 4. my resource files are in the corrent content type

Please refresh my memory.  Was there a way to specify "content type"
in "resource files"?  I thought they were just PropertyResourceBundle
files.

> I still get question marks (?) displayed back to the browser when displaying
> anything that comes from an ApplicationResource file :(

Question marks usually means that the charset converter couldn't find
the suitable character for the conversion.  If you spit out some log
from java, is it encoded properly, or do you get question marks there,
too?

Best regards,
-- Shinobu

--
Shinobu "Kawai" Yoshida <sh...@gmail.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


RE: VelocityViewServlet Differences with VelocityServlet

Posted by Steve O'Hara <so...@pivotal-solutions.co.uk>.
Hi Nathan,

Here's the trace:-

java.lang.IllegalStateException: getAttribute: Session already invalidated
	at
org.apache.catalina.session.StandardSession.getAttribute(StandardSession.jav
a:900)
	at
org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessi
onFacade.java:171)
	at
org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessi
onFacade.java:171)
	at
org.apache.velocity.tools.view.context.ChainedContext.getAttribute(ChainedCo
ntext.java:194)
	at
org.apache.velocity.tools.view.context.ChainedContext.internalGet(ChainedCon
text.java:176)
	at
org.apache.velocity.context.AbstractContext.get(AbstractContext.java:200)
	at
org.apache.velocity.context.InternalContextAdapterImpl.get(InternalContextAd
apterImpl.java:162)
	at
org.apache.velocity.runtime.parser.node.ASTReference.getVariableValue(ASTRef
erence.java:623)
	at
org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.ja
va:151)
	at
org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.jav
a:220)
	at
org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:55)
	at
org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement
.java:70)
	at
org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:23
0)
	at org.apache.velocity.Template.merge(Template.java:256)
	at
org.apache.velocity.tools.view.servlet.VelocityViewServlet.mergeTemplate(Vel
ocityViewServlet.java:592)
	at
org.apache.velocity.tools.view.servlet.VelocityViewServlet.doRequest(Velocit
yViewServlet.java:417)
	at
org.apache.velocity.tools.view.servlet.VelocityViewServlet.doGet(VelocityVie
wServlet.java:373)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:243)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:190)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
	at
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
46)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
	at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:170)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
	at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
64)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
	at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
66)
	at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
	at
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
1027)
	at
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125
)
	at java.lang.Thread.run(Thread.java:536)

thanks,

Steve

-----Original Message-----
From: Nathan Bubna [mailto:nbubna@gmail.com]
Sent: 09 February 2005 17:14
To: Velocity Users List; sohara@pivotal-solutions.co.uk
Subject: Re: VelocityViewServlet Differences with VelocityServlet


hmm.  i've not had problems with invalidated sessions before.  can you
give us some of that stack trace?  i wanna see where this is
happening.

On Wed, 9 Feb 2005 11:11:38 -0000, Steve O'Hara
<so...@pivotal-solutions.co.uk> wrote:
>
> I've taken the advice offered by everyone to switch to using the
> VelocityViewServlet but I've got a strange error occurring which didn't
> happen with VelocityServlet (or if it did, it was caught).
>
> When I log out from my application I clear the session object by doing a
> session().invalidate()
> Now, when the template for the logout screen is merged by Velocity. I get
> the following error;
>
> java.lang.IllegalStateException: getAttribute: Session already invalidated
>
> I can't understand this, I don't refer to the session object in my
template
> so why is the VelocityViewServlet checking the session object?  Also, why
> doesn't it catch this error gracefully?
>
> Steve
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: VelocityViewServlet Differences with VelocityServlet

Posted by Nathan Bubna <nb...@gmail.com>.
hmm.  i've not had problems with invalidated sessions before.  can you
give us some of that stack trace?  i wanna see where this is
happening.

On Wed, 9 Feb 2005 11:11:38 -0000, Steve O'Hara
<so...@pivotal-solutions.co.uk> wrote:
> 
> I've taken the advice offered by everyone to switch to using the
> VelocityViewServlet but I've got a strange error occurring which didn't
> happen with VelocityServlet (or if it did, it was caught).
> 
> When I log out from my application I clear the session object by doing a
> session().invalidate()
> Now, when the template for the logout screen is merged by Velocity. I get
> the following error;
> 
> java.lang.IllegalStateException: getAttribute: Session already invalidated
> 
> I can't understand this, I don't refer to the session object in my template
> so why is the VelocityViewServlet checking the session object?  Also, why
> doesn't it catch this error gracefully?
> 
> Steve
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


VelocityViewServlet Differences with VelocityServlet

Posted by Steve O'Hara <so...@pivotal-solutions.co.uk>.
I've taken the advice offered by everyone to switch to using the
VelocityViewServlet but I've got a strange error occurring which didn't
happen with VelocityServlet (or if it did, it was caught).

When I log out from my application I clear the session object by doing a
session().invalidate()
Now, when the template for the logout screen is merged by Velocity. I get
the following error;

java.lang.IllegalStateException: getAttribute: Session already invalidated

I can't understand this, I don't refer to the session object in my template
so why is the VelocityViewServlet checking the session object?  Also, why
doesn't it catch this error gracefully?

Steve




---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org