Simple question regarding including double quotes in #set

2006-10-18 Thread Manish
How do I include double quotes in the #set variables? This is what I am trying 
to get working, note that including this in single quotes won't render some 
variable values that I want.


#set($keywords = 'meta name=keywords content=information, xyz, something, 
$person.name, $person.address/')


TIA,
- Manish




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



Re: Simple question regarding including double quotes in #set

2006-10-18 Thread Manish

Never mind - I got this working!

#set($keywords = $render.eval('meta name=keywords content=information, xyz, 
something,  $person.name, $person.address/'))


- Manish


- Original Message - 
From: Manish [EMAIL PROTECTED]

To: Velocity Users List velocity-user@jakarta.apache.org
Sent: Wednesday, October 18, 2006 1:37 PM
Subject: Simple question regarding including double quotes in #set


How do I include double quotes in the #set variables? This is what I am trying 
to get working, note that including this in single quotes won't render some 
variable values that I want.


#set($keywords = 'meta name=keywords content=information, xyz, something, 
$person.name, $person.address/')


TIA,
- Manish




-
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: How to use velocity tools from a non-web-application

2006-09-13 Thread Manish
In a non web application you can simply add an instance of any required tool to 
the Velocty context  can use it in your template.


hth,
- Manish


- Original Message - 
From: Mohsen Saboorian [EMAIL PROTECTED]

To: velocity-user@jakarta.apache.org
Sent: Thursday, September 14, 2006 9:43 AM
Subject: How to use velocity tools from a non-web-application




Hi,
I'm using Velocity as an embedded template engine for some code generation
in an application. I tried hard to convert a String to an Integer value (so
that I can use it in a simple calculation), but could not do that either
when wrapped attributes in a class with a toInteger() method.

Anyway, I've noticed that there is a tool for that (generic math tool). Is
it possible to use it in my app (the sample projects on the download archive
of velocity-tools are all web application who refer to an XML file through
web.xml). How can I refer to toolbox.xml?

Thanks.
--
View this message in context: 
http://www.nabble.com/How-to-use-velocity-tools-from-a-non-web-application-tf2269519.html#a6299220

Sent from the Velocity - User forum at Nabble.com.


-
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 we configuring ApplicationResources.properties for Velocity?

2006-08-16 Thread Manish
You can put your own tool in the context which will pick up from the resourse 
bundle...should be straight-forward I'd think.


- Manish



- Original Message - 
From: Rakesh Reddy [EMAIL PROTECTED]

To: Velocity Users List velocity-user@jakarta.apache.org
Sent: Thursday, August 17, 2006 12:29 AM
Subject: Re: Can we configuring ApplicationResources.properties for Velocity?



Thanks for the help.
But I am not looking for VelocityStruts support (I am not trying to use the 
velocity in view layer or on the front end in JSP's), I am trying to create a 
standalone application where I have some 10-20 VM templates (which are 
basically some email notification templates), and I want these templates to be 
internationalized.
It would be great where I can feed the Applicationresource.properties (some 
thing like this kind of file) to velocity engine.


Regards
Rakesh

Nathan Bubna [EMAIL PROTECTED] wrote: If you are using the VelocityStruts 
support in VelocityTools, then the

MessageTool is what you are looking for.

http://jakarta.apache.org/velocity/tools/struts/MessageTool.html

Use of this is demonstrated in the velstruts example application that
comes with VelocityTools.

On 8/16/06, Rakesh Reddy  wrote:

Hi --

Is there any way to configure the Velocity enigine to use the 
ApplicationResources.properties (For internationalization) while generating 
the text from templates? Instead of the passing the inviduall label value.


Regrads
Rakesh




-
Get your email and more, right on the  new Yahoo.com



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




-
Do you Yahoo!?
Everyone is raving about the  all-new Yahoo! Mail Beta. 




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



Re: Concatenating String in VTL

2006-02-08 Thread Manish
Simply do this - 
#set($finalService=${serviceName}Service)


- Manish


- Original Message - 
From: Anagha [EMAIL PROTECTED]

To: velocity-user velocity-user@jakarta.apache.org
Sent: Thursday, February 09, 2006 12:56 PM
Subject: Concatenating String in VTL


Hi,
Trying out following in the VTL :

#set($finalService=$serviceName+Service)
$finalService

where $serviceName has some string in it.
The output is
$finalService

Is there any other way to concat string in VTL?
Any help is welcome.
--
Thanks  Regards,
Anagha



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



Re: Concatenating String in VTL

2006-02-08 Thread Manish
This should be useful for you if you have just started with velocity -- as it 
seems from your posts in the list

http://jakarta.apache.org/velocity/docs/user-guide.html

HTH,
- manish

- Original Message - 
From: Anagha [EMAIL PROTECTED]

To: velocity-user velocity-user@jakarta.apache.org
Sent: Thursday, February 09, 2006 12:56 PM
Subject: Concatenating String in VTL


Hi,
Trying out following in the VTL :

#set($finalService=$serviceName+Service)
$finalService

where $serviceName has some string in it.
The output is
$finalService

Is there any other way to concat string in VTL?
Any help is welcome.
--
Thanks  Regards,
Anagha



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



Accessing velocity context...

2006-01-20 Thread Manish
I am using velocity with struts, is there a way I can access velocity context 
directly from within a struts action?


- Manish 




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



Re: Accessing velocity context...

2006-01-20 Thread Manish

Exactly that's what we're doing.
But for some reasons I need a handle to the context, and I am wondering how can 
I do that?


- Manish

- Original Message - 
From: Nathan Bubna [EMAIL PROTECTED]

To: Velocity Users List velocity-user@jakarta.apache.org
Sent: Friday, January 20, 2006 10:50 PM
Subject: Re: Accessing velocity context...


no.  the velocity context is not created until after the action passes
of handling of the request to the VelocityViewServlet.  so, the
velocity context does not exist at the time the action is being
executed.   if you need to put stuff in the context, put them in the
request attributes; remember that the VelocityViewServlet uses a
ChainedContext that transparently exposes request attributes to the
template.

On 1/20/06, Manish [EMAIL PROTECTED] wrote:

I am using velocity with struts, is there a way I can access velocity context
directly from within a struts action?

- Manish



-
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: Accessing velocity context...

2006-01-20 Thread Manish

I know I know
But at this stage I do not know much either...will have to wait till Monday to 
know why exactly it is needed.
As of now I have only been asked a question, and I also said no to it -- but I 
wanted to confirm on the list itself.


I need fully prepared ChainedContext created by the VelocityViewServlet for that 
particular request, one of my objects stored in the context itself may need to 
access the context (I know it sounds vague...but I can't help it either). The 
way one can access ServletContext in servlets...


Any pointers??

TIA,
- Manish




- Original Message - 
From: Nathan Bubna [EMAIL PROTECTED]

To: Velocity Users List velocity-user@jakarta.apache.org
Sent: Friday, January 20, 2006 11:23 PM
Subject: Re: Accessing velocity context...


some reasons, eh?  that doesn't really help us help you.  how's
this...  do you need just any velocity context (very easy to do), a
functional ViewContext (a bit more difficult, but possible), or a
fully prepared ChainedContext created by the VelocityViewServlet for
that servlet request (not possible in VelocityStruts)?

On 1/20/06, Manish [EMAIL PROTECTED] wrote:

Exactly that's what we're doing.
But for some reasons I need a handle to the context, and I am wondering how 
can

I do that?

- Manish

- Original Message -
From: Nathan Bubna [EMAIL PROTECTED]
To: Velocity Users List velocity-user@jakarta.apache.org
Sent: Friday, January 20, 2006 10:50 PM
Subject: Re: Accessing velocity context...


no.  the velocity context is not created until after the action passes
of handling of the request to the VelocityViewServlet.  so, the
velocity context does not exist at the time the action is being
executed.   if you need to put stuff in the context, put them in the
request attributes; remember that the VelocityViewServlet uses a
ChainedContext that transparently exposes request attributes to the
template.

On 1/20/06, Manish [EMAIL PROTECTED] wrote:
 I am using velocity with struts, is there a way I can access velocity 
 context

 directly from within a struts action?

 - Manish



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



Installing VelocityWebEdit plug-in

2006-01-03 Thread Manish
I am trying to install VelocityWebEdit plug-in for my Eclipse 3.1.1 I have 
copied com.hudson.velocityweb_1.0.7 folder under eclipse's plugins directory, 
but do not know how do I install it by specifying search for new features to 
insatll, which update site URL do I need to use here. Is there any other way I 
can do this?


Is anybody using this plug-in for velocity with eclipse 3.1? Any pointers wil be 
highly appreciated.


TIA,
- Manish



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



Render tool

2005-11-24 Thread Manish
I am planning to use velocity render tool, but do not know how can I refer
to the default context for the same. I am using Velocity with struts.

- Manish



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



Re: Render tool

2005-11-24 Thread Manish
Never Mind!!!
I found the answer... ViewRenderTool does not require context I was
looking at RenderTool help!! ;-)

- Manish

- Original Message -
From: Manish [EMAIL PROTECTED]
To: Velocity Users List velocity-user@jakarta.apache.org
Sent: Thursday, November 24, 2005 2:05 PM
Subject: Render tool


 I am planning to use velocity render tool, but do not know how can I refer
 to the default context for the same. I am using Velocity with struts.

 - Manish



 -
 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: [HELP] The differences between ActionMessagesTool and MessagesTool?

2005-07-25 Thread Manish

- Original Message -
From: Pham Anh Tuan [EMAIL PROTECTED]
To: Velocity Users List velocity-user@jakarta.apache.org; Bayarsaikhan
VOLODYA [EMAIL PROTECTED]
Sent: Monday, July 25, 2005 1:17 PM
Subject: Re: [HELP] The differences between ActionMessagesTool and
MessagesTool?


 as you said, we must send our messages with GLOBAL_MESSAGE ?

 if so, I'm clear :D


NO!!!
You can send any message with ActionMessagesTool , but as someone pointed
out, the difference lies in from where the message is picked up.

- Manish





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



Re: [HELP] The differences between ActionMessagesTool and MessagesTool?

2005-07-25 Thread Manish
One -- These two are not contradictory answers
Two -- I was answering your question about we must send our messages with
GLOBAL_MESSAGE ?, which is not true, you can have any name for that
message. I am saying you can use any message type, not necessarily
GLOBAL_MESSAGE.

Errors indeed go to errors an messages to messages. That's as clear as it
gets, the class name difference itself suggests that. What you put as
message (user added) and what you put as error (duplicate user) is sth that
you have to decide while using struts, accordingly you'll have to retrieve
that in your velocity template.

HTH,
- Manish



- Original Message -
From: Pham Anh Tuan [EMAIL PROTECTED]
To: Velocity Users List velocity-user@jakarta.apache.org; Bayarsaikhan
VOLODYA [EMAIL PROTECTED]
Sent: Monday, July 25, 2005 1:31 PM
Subject: Re: [HELP] The differences between ActionMessagesTool and
MessagesTool?


 one answers:
 that is true. if you add
 ActionError, it goes to ErrorsTool
 ActionMessage,it goes to ActionMessageTool

 another one answers:
 NO!!!
 You can send any message with ActionMessagesTool , but as someone
pointed
 out, the difference lies in from where the message is picked up.

 who is right ?
 - Original Message -
 From: Bayarsaikhan VOLODYA [EMAIL PROTECTED]
 To: Velocity Users List velocity-user@jakarta.apache.org
 Sent: Monday, July 25, 2005 2:52 PM
 Subject: Fwd: [HELP] The differences between ActionMessagesTool and
 MessagesTool?


  that is true. if you add
  ActionError, it goes to ErrorsTool
  ActionMessage,it goes to ActionMessageTool
 
 
  -- Forwarded message --
  From: Pham Anh Tuan [EMAIL PROTECTED]
  Date: Jul 25, 2005 10:47 AM
  Subject: Re: [HELP] The differences between ActionMessagesTool and
  MessagesTool?
  To: Velocity Users List velocity-user@jakarta.apache.org,
  Bayarsaikhan VOLODYA [EMAIL PROTECTED]
 
 
  as you said, we must send our messages with GLOBAL_MESSAGE ?
 
  if so, I'm clear :D
 
  thanks Bayarsaikhan
  - Original Message -
  From: Bayarsaikhan VOLODYA [EMAIL PROTECTED]
  To: Velocity Users List velocity-user@jakarta.apache.org
  Sent: Monday, July 25, 2005 2:38 PM
  Subject: Fwd: [HELP] The differences between ActionMessagesTool and
  MessagesTool?
 
 
  it is not only used for form validation but also used for all kind of
  messages u wish to send from struts actions. to send message to
  velocity from struts, we use this code;
 
  ***
  ActionMessages msgs = new ActionMessages();
  msgs.add(ActionMessages.GLOBAL_MESSAGE, new
ActionMessage(user.added));
  saveMessages(request,msgs);
  ***
 
  clear?
 
  -- Forwarded message --
  From: Pham Anh Tuan [EMAIL PROTECTED]
  Date: Jul 25, 2005 10:29 AM
  Subject: Re: [HELP] The differences between ActionMessagesTool and
  MessagesTool?
  To: Velocity Users List velocity-user@jakarta.apache.org,
  Bayarsaikhan VOLODYA [EMAIL PROTECTED]
 
 
  Thanks Bayarsaikhan,
 
  but as you said, ActionMessagesTool is used rarely, because it's only
for
  form validation error?
 
  plz give me more cases so we can use ActionMessagesTool Bayarsaikhan...
  :(
  - Original Message -
  From: Bayarsaikhan VOLODYA [EMAIL PROTECTED]
  To: Velocity Users List velocity-user@jakarta.apache.org
  Sent: Monday, July 25, 2005 2:01 PM
  Subject: Re: [HELP] The differences between ActionMessagesTool and
  MessagesTool?
 
 
 - ActionMessagesTool is used to retrieve messages from struts. for
  example, form validation error messages coming from struts validation.
  - MessagesTool is used to retrieve locale messages from
  Applicationresource.properties file.
 
 
  On 7/25/05, Pham Anh Tuan [EMAIL PROTECTED] wrote:
  hi all,
 
  would you plz show me the differences between ActionMessagesTool and
  MessagesTool.
 
  I don't know exactly what they are :(
 
  thanks for reading!
 
  Pham
 
 
 
  --
  Bayarsaikhan VOLODYA
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 
  --
  Bayarsaikhan VOLODYA
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 
  --
  Bayarsaikhan VOLODYA
 
  -
  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: [HELP] The differences between ActionMessagesTool and MessagesTool?

2005-07-25 Thread Manish
One -- These two are not contradictory answers
Two -- I was answering your question about we must send our messages with
GLOBAL_MESSAGE ?, which is not true, you can have any name for that
message. I am saying you can use any message type, not necessarily
GLOBAL_MESSAGE.

Errors indeed go to errors an messages to messages. That's as clear as it
gets, the class name difference itself suggests that. What you put as
message (user added) and what you put as error (duplicate user) is sth that
you have to decide while using struts, accordingly you'll have to retrieve
that in your velocity template.

HTH,
- Manish


- Original Message -
From: Pham Anh Tuan [EMAIL PROTECTED]
To: Velocity Users List velocity-user@jakarta.apache.org; Bayarsaikhan
VOLODYA [EMAIL PROTECTED]
Sent: Monday, July 25, 2005 1:31 PM
Subject: Re: [HELP] The differences between ActionMessagesTool and
MessagesTool?


 one answers:
 that is true. if you add
 ActionError, it goes to ErrorsTool
 ActionMessage,it goes to ActionMessageTool

 another one answers:
 NO!!!
 You can send any message with ActionMessagesTool , but as someone
pointed
 out, the difference lies in from where the message is picked up.

 who is right ?
 - Original Message -
 From: Bayarsaikhan VOLODYA [EMAIL PROTECTED]
 To: Velocity Users List velocity-user@jakarta.apache.org
 Sent: Monday, July 25, 2005 2:52 PM
 Subject: Fwd: [HELP] The differences between ActionMessagesTool and
 MessagesTool?


  that is true. if you add
  ActionError, it goes to ErrorsTool
  ActionMessage,it goes to ActionMessageTool
 
 
  -- Forwarded message --
  From: Pham Anh Tuan [EMAIL PROTECTED]
  Date: Jul 25, 2005 10:47 AM
  Subject: Re: [HELP] The differences between ActionMessagesTool and
  MessagesTool?
  To: Velocity Users List velocity-user@jakarta.apache.org,
  Bayarsaikhan VOLODYA [EMAIL PROTECTED]
 
 
  as you said, we must send our messages with GLOBAL_MESSAGE ?
 
  if so, I'm clear :D
 
  thanks Bayarsaikhan
  - Original Message -
  From: Bayarsaikhan VOLODYA [EMAIL PROTECTED]
  To: Velocity Users List velocity-user@jakarta.apache.org
  Sent: Monday, July 25, 2005 2:38 PM
  Subject: Fwd: [HELP] The differences between ActionMessagesTool and
  MessagesTool?
 
 
  it is not only used for form validation but also used for all kind of
  messages u wish to send from struts actions. to send message to
  velocity from struts, we use this code;
 
  ***
  ActionMessages msgs = new ActionMessages();
  msgs.add(ActionMessages.GLOBAL_MESSAGE, new
ActionMessage(user.added));
  saveMessages(request,msgs);
  ***
 
  clear?
 
  -- Forwarded message --
  From: Pham Anh Tuan [EMAIL PROTECTED]
  Date: Jul 25, 2005 10:29 AM
  Subject: Re: [HELP] The differences between ActionMessagesTool and
  MessagesTool?
  To: Velocity Users List velocity-user@jakarta.apache.org,
  Bayarsaikhan VOLODYA [EMAIL PROTECTED]
 
 
  Thanks Bayarsaikhan,
 
  but as you said, ActionMessagesTool is used rarely, because it's only
for
  form validation error?
 
  plz give me more cases so we can use ActionMessagesTool Bayarsaikhan...
  :(
  - Original Message -
  From: Bayarsaikhan VOLODYA [EMAIL PROTECTED]
  To: Velocity Users List velocity-user@jakarta.apache.org
  Sent: Monday, July 25, 2005 2:01 PM
  Subject: Re: [HELP] The differences between ActionMessagesTool and
  MessagesTool?
 
 
 - ActionMessagesTool is used to retrieve messages from struts. for
  example, form validation error messages coming from struts validation.
  - MessagesTool is used to retrieve locale messages from
  Applicationresource.properties file.
 
 
  On 7/25/05, Pham Anh Tuan [EMAIL PROTECTED] wrote:
  hi all,
 
  would you plz show me the differences between ActionMessagesTool and
  MessagesTool.
 
  I don't know exactly what they are :(
 
  thanks for reading!
 
  Pham
 
 
 
  --
  Bayarsaikhan VOLODYA
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 
  --
  Bayarsaikhan VOLODYA
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 
  --
  Bayarsaikhan VOLODYA
 
  -
  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: Problems with VelocityStruts's ErrorsTool

2005-07-18 Thread Manish
change
#if ($errors.exists())
to
#if ($errors.exist())

HTH,
- Manish


- Original Message -
From: Mikko Nylén [EMAIL PROTECTED]
To: velocity-user@jakarta.apache.org
Sent: Monday, July 18, 2005 3:56 PM
Subject: Problems with VelocityStruts's ErrorsTool


 Hi!,

 I have a little problem with VelocityStruts's ErrorsTool's exists()
 method. It seems that it isn't working properly, as if I do write
 something like this in my template:

 #if ($errors.exists())
 ul
 #foreach ($error in $errors.all)
li$error/li
 #end
 /ul
 #end

 ...it doesn't display anything. However, if I remove the #if-line (and
 of course, the corresponding #end-line), it does display the errors as
 expected:

 ul
 liUsername is required/li
 liPassword is required/li
 /ul

 What could be wrong?

 Another issue I have met is with the ErrorsTool's get(String property)
 method. If I do something like this in my action class's execute():

 ActionMessages errors = new ActionMessages();
 errors.add(username, new ActionMessage(error.noSuchUser, username));
 saveErrors(errors);

 ...and when my template have this:

 ul
 #foreach ($error in $errors.get(username))
 li$error/li
 #end
 /ul

 ...shouldn't it display something like this?

 ul
 liNo such user testuser/li
 /ul


 Thanks for the reply in advance,

 - Mikko Nylén

 -
 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: help for format

2005-06-12 Thread Manish
Use NumberTool

- Manish

- Original Message -
From: Sandeep Patil [EMAIL PROTECTED]
To: velocity-user@jakarta.apache.org
Sent: Monday, June 13, 2005 9:49 AM
Subject: help for format


hi,
  if i want show my number with the pattern ###,### what should i do.if u
have any related help pl forward to me.
bye.




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



Velociy template testing....

2005-06-09 Thread Manish
I use velocity with struts. Many of the objects that I set for velocity
templates have bee changed significant, so the constructs such as -
$objectName.methodName()
are going to fail. I am wondering if it is possible for me to somehow
automate this testing so that I know which of the method calls failed in
velocity templates. AFAIK, as of now velocity fails silently (without
exception or error) when such calls fail, only with log statements maybe.

I can make changes by hand in all the templates, but we want a full-proof
automated testing that will test velocity template as a view to see if it
is missing some of the information. Is this possible? If yes, how would
automate this testing with which tools (otherwise I am using JUnit for
struts action tool)??

We are considering more robust and reliable solution to make this
transition.

rgds,
- Manish




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



Re: can't get the strutslinktool to work.

2005-05-20 Thread Manish
Use -
 form action=$link.setAction(DBafdslet)

provided you have configured action DBafdslet properly in your
struts-config

HTH,
- Manish

- Original Message -
From: marc [EMAIL PROTECTED]
To: velocity-user@jakarta.apache.org
Sent: Friday, May 20, 2005 11:44 AM
Subject: Re: can't get the strutslinktool to work.


 Well tryed it did't work. It still puts in blanks.

 This for example:
 form action=$link.setAction(/DBafdslet)

 Will porduce this in my htmlpage:

 form action=/HelpDesk

 As you can see not apending /DBafdslet after /HelpDesk. Is this a common
 problem, or is it just that can't get it to work?


 PS using struts 1.2.4 and have tryed with both velocity-tools 1.1 and
 the dev souces.

 Shinobu Kawai wrote:
  Hi Marc,
 
 
 I have just started playing with velocity and struts.
 
 But got a problem with the setAction in strutslinktool. Every time I try
 to use it just fills in blanks. That be in a link or in a form. Just
BLANK.
 
 I can use the  setForward just fin.
 
 Any ideas?
 
 
  Which versions of Struts/VelocityTools are you using?  For Struts 1.2,
  you need VelocityTools 1.2, which is still under development.
 http://cvs.apache.org/snapshots/velocity-tools/
 
  Best regards,
  -- Shinobu
 
  --
  Shinobu Kawai [EMAIL PROTECTED]


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





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



Weird execution of code

2005-04-07 Thread Manish
Something weird is happening here...
I have this piece of code in my Velocity template file -

$request.getLocalAddr()

This works fine on other machine and gives the correct local IP, however on
other machine this results in null value, why is it so?
What configuration issue could affect this? Any other ideas? I am lost...

TIA,
- Manish




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



Trapping template not found error

2005-02-28 Thread Manish
We are using struts + velocity combination and all errors are trapped and
handled by GlobalExceptionHandler, however when velocity template is not
found (missing or due to any other reason), I see stack trace in  the
browser -

 Org.apache.velocity.exception.ResourceNotFoundException

How can I make sure that this error is handled gracefully as well ad a
decent message is shown to the user.
A lot of these templates are being handled by a designer now, and are
referred from another template with #parse

TIA,
- Manish



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



Velocity and JDBC

2005-02-22 Thread Manish
Is it possible to use straight JDBC/SQL type of calls in Velocity directly
for web page creation?
(Well, this question comes from Jasper reports background which allows such
things for a DB)
What would be the best approach to display DB results on page.

- Manish



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



Re: Velocity and JDBC

2005-02-22 Thread Manish
 What would be the best approach to display DB results on page.
I'd check out Claude's project, Velosurf.
http://velosurf.sourceforge.net/


Thanks for the link!! :)
Is it feasible to use velosurf with Struts/Velocity paradigm.
Some design restrictions require me to use action for every link on web page
so that it passes through the custom request processor that we have.
So need to know about this feasibility before I look into more details. Any
inputs will be highly appreciated.

TIA,
- Manish




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



Re: Resource loader path problems!!! Never easy...

2005-02-16 Thread Manish
Thanks!!!
Found how to use multiple paths in velocity developer's guide and it seems
to be working now.

- Manish

- Original Message -
From: Nathan Bubna [EMAIL PROTECTED]
To: Velocity Users List velocity-user@jakarta.apache.org
Sent: Wednesday, February 16, 2005 10:44 AM
Subject: Re: Resource loader path problems!!! Never easy...


 you probably just need to add the path to the new directory to your
 foo.resource.loader.path property in your velocity properties.  most
 resource loaders should accept a comma delimited list for the path
 property.

 if that doesn't work, answer the following questions to help us help
you...
 what resource loader(s) are you using?
 what are your resource loader properties?
 what is the path for the new directory relative to your old one?


 On Wed, 16 Feb 2005 10:12:27 +0530, Manish [EMAIL PROTECTED] wrote:
  I am using struts+velocity and we keep all VMs files in our webapps
  directory, and it works.
  Now I need to have a separate directory XYZ to store some velocity
  templates away from rest of the templates, but when I create this XYZ
  directory and move my selected templates there, I get exception -
Resource
  Not Found. What can I do to make sure that ALL templates are available,
the
  original ones in webapps directory , and these templates which are under
  XYZ directory under same webapps directory. How to do that?
 
  TIA,
  - Manish
 
  -
  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]



Resource loader path problems!!! Never easy...

2005-02-15 Thread Manish
I am using struts+velocity and we keep all VMs files in our webapps
directory, and it works.
Now I need to have a separate directory XYZ to store some velocity
templates away from rest of the templates, but when I create this XYZ
directory and move my selected templates there, I get exception - Resource
Not Found. What can I do to make sure that ALL templates are available, the
original ones in webapps directory , and these templates which are under
XYZ directory under same webapps directory. How to do that?

TIA,
- Manish



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



Map not working in velocity??

2005-01-31 Thread Manish
well, I am astonished as hell to see that Map is not working velocity.
I have declared it properly,
#set( $another_map = {banana : good, roast beef : bad})

but I get this error -
Lexical error: org.apache.velocity.runtime.parser.TokenMgrError: Lexical
error at line 14, column 22. Encountered: { (123), after : 
org.apache.velocity.exception.ParseErrorException: Lexical error:
org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at line 14,
column 22.  Encountered: { (123), after : 
at org.apache.velocity.Template.process(Template.java:141)
at
org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(Resour
ceManagerImpl.java:423)
at
org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(Resourc
eManagerImpl.java:341)
at
org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java
:831)
at
org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java
:813)
at
org.apache.velocity.runtime.RuntimeSingleton.getTemplate(RuntimeSingleton.ja
va:285)

Please help!!!

TIA,
 - Manish



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



Re: Map not working in velocity??

2005-01-31 Thread Manish
But I have seen lot of people mentioning here about using Maps, how do they
do it?

- Manish

- Original Message -
From: Brad Eisan [EMAIL PROTECTED]
To: Velocity Users List velocity-user@jakarta.apache.org
Sent: Monday, January 31, 2005 5:37 PM
Subject: Re: Map not working in velocity??


 On 31 Jan 2005, at 12:07, Manish wrote:

  well, I am astonished as hell to see that Map is not working velocity.
  I have declared it properly,
  #set( $another_map = {banana : good, roast beef : bad})
 
  but I get this error -
  Lexical error: org.apache.velocity.runtime.parser.TokenMgrError:
  Lexical
  error at line 14, column 22. Encountered: { (123), after : 
  org.apache.velocity.exception.ParseErrorException: Lexical error:
  org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at
  line 14,
  column 22.  Encountered: { (123), after : 
  at org.apache.velocity.Template.process(Template.java:141)
  at
  org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(R
  esour
  ceManagerImpl.java:423)
  at
  org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(Re
  sourc
  eManagerImpl.java:341)
  at
  org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance
  .java
  :831)
  at
  org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance
  .java
  :813)
  at
  org.apache.velocity.runtime.RuntimeSingleton.getTemplate(RuntimeSinglet
  on.ja
  va:285)
 
  Please help!!!

 Maps are not yet available in 1.4 .. See the below post ..

 http://mail-archives.apache.org/eyebrowse/ReadMsg?listName=velocity-
 [EMAIL PROTECTED]msgId=2000911

 Cheers,
 Brad


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



Adding map to toolbox

2005-01-31 Thread Manish
Well, I tried to ad a HashMap to a toolbox as well, but none of its methods
(put basically) is working except clear()

This is what I did in tool box-

 tool
  keymymap/key
  scopeapplication/scope
  classjava.util.HashMap/class
 /tool

Then I my velocity code I try this -

$mymap.clear()
$mymap.put(label.name,manish)
$mymap.put(label.country, India)

but It doesn't work. The template shows me this -

$mymap.put(label.name,manish) $circus.map.put(label.country, India)

The clear is not shown, so I am assuming that it's getting executed a $mymap
is not NULL.
Any help, pointers???

TIA,
- Manish



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



Re: Adding map to toolbox

2005-01-31 Thread Manish
Never mind, I got it.
It was printing it because return value for all these map.put operations was
NULL.
call to clear() wasn't printed because it is void.
I put this all like this, and it's working now -

!--
$mymap.clear()
$mymap.put(label.name,manish)
$mymap.put(label.country, India)
--

- Manish

- Original Message -
From: Manish [EMAIL PROTECTED]
To: Velocity Users List velocity-user@jakarta.apache.org
Sent: Monday, January 31, 2005 7:32 PM
Subject: Adding map to toolbox


 Well, I tried to ad a HashMap to a toolbox as well, but none of its
methods
 (put basically) is working except clear()

 This is what I did in tool box-

  tool
   keymymap/key
   scopeapplication/scope
   classjava.util.HashMap/class
  /tool

 Then I my velocity code I try this -

 $mymap.clear()
 $mymap.put(label.name,manish)
 $mymap.put(label.country, India)

 but It doesn't work. The template shows me this -

 $mymap.put(label.name,manish) $circus.map.put(label.country,
India)

 The clear is not shown, so I am assuming that it's getting executed a
$mymap
 is not NULL.
 Any help, pointers???

 TIA,
 - Manish



 -
 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: Adding map to toolbox

2005-01-31 Thread Manish
I did indeed put quiet notation, just forgot to add it here.

- Manish

- Original Message -
From: Nathan Bubna [EMAIL PROTECTED]
To: Velocity Users List velocity-user@jakarta.apache.org
Sent: Monday, January 31, 2005 9:21 PM
Subject: Re: Adding map to toolbox


 or you can just use quiet notation:

 $!mymap.put('label.name', 'manish')


 On Mon, 31 Jan 2005 19:58:31 +0530, Manish [EMAIL PROTECTED] wrote:
  Never mind, I got it.
  It was printing it because return value for all these map.put operations
was
  NULL.
  call to clear() wasn't printed because it is void.
  I put this all like this, and it's working now -
 
  !--
  $mymap.clear()
  $mymap.put(label.name,manish)
  $mymap.put(label.country, India)
  --
 
  - Manish
 
  - Original Message -
  From: Manish [EMAIL PROTECTED]
  To: Velocity Users List velocity-user@jakarta.apache.org
  Sent: Monday, January 31, 2005 7:32 PM
  Subject: Adding map to toolbox
 
   Well, I tried to ad a HashMap to a toolbox as well, but none of its
  methods
   (put basically) is working except clear()
  
   This is what I did in tool box-
  
tool
 keymymap/key
 scopeapplication/scope
 classjava.util.HashMap/class
/tool
  
   Then I my velocity code I try this -
  
   $mymap.clear()
   $mymap.put(label.name,manish)
   $mymap.put(label.country, India)
  
   but It doesn't work. The template shows me this -
  
   $mymap.put(label.name,manish) $circus.map.put(label.country,
  India)
  
   The clear is not shown, so I am assuming that it's getting executed a
  $mymap
   is not NULL.
   Any help, pointers???
  
   TIA,
   - Manish
  
  
  
   -
   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: Map not working in velocity??

2005-01-31 Thread Manish
But I have seen lot of people mentioning here about using Maps, how do they
do it?

- Manish



- Original Message -
From: Brad Eisan [EMAIL PROTECTED]
To: Velocity Users List velocity-user@jakarta.apache.org
Sent: Monday, January 31, 2005 5:37 PM
Subject: Re: Map not working in velocity??


 On 31 Jan 2005, at 12:07, Manish wrote:

  well, I am astonished as hell to see that Map is not working velocity.
  I have declared it properly,
  #set( $another_map = {banana : good, roast beef : bad})
 
  but I get this error -
  Lexical error: org.apache.velocity.runtime.parser.TokenMgrError:
  Lexical
  error at line 14, column 22. Encountered: { (123), after : 
  org.apache.velocity.exception.ParseErrorException: Lexical error:
  org.apache.velocity.runtime.parser.TokenMgrError: Lexical error at
  line 14,
  column 22.  Encountered: { (123), after : 
  at org.apache.velocity.Template.process(Template.java:141)
  at
  org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(R
  esour
  ceManagerImpl.java:423)
  at
  org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(Re
  sourc
  eManagerImpl.java:341)
  at
  org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance
  .java
  :831)
  at
  org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance
  .java
  :813)
  at
  org.apache.velocity.runtime.RuntimeSingleton.getTemplate(RuntimeSinglet
  on.ja
  va:285)
 
  Please help!!!

 Maps are not yet available in 1.4 .. See the below post ..

 http://mail-archives.apache.org/eyebrowse/ReadMsg?listName=velocity-
 [EMAIL PROTECTED]msgId=2000911

 Cheers,
 Brad


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



Change application directory

2005-01-27 Thread Manish
This should be easy, but somehow I am little confused. I have done this for
JSP/Sevlets, but I don't know what all things are requited to be changed if
I need to change my application directory using struts from ROOT to another
directory (I am using struts with velocity and not JSP). Will few changes in
struts-config.xml suffice or is more work required here?

As of now it gets served as -
http://.mydomain.com/index.do
I want to make it -
http://.mydomain.com/xyz/index.do

What all code changes will be required here?

- Manish



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



response.redirect

2005-01-03 Thread Manish Hatwalne
This must be trivial, but for some reasons I can't find it...
How can I do sth similar to response.redirect in velocity template?

TIA,
- Manish



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



response.redirect

2005-01-02 Thread Manish
This must be trivial, but for some reasons I can't find it...
How can I do sth similar to response.redirect in velocity template?

TIA,
- Manish




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



Re: response.redirect

2005-01-02 Thread Manish
It can be simply done as -
$response.sendRedirect(whatever_path)

For anyone else who's interested

- Manish

- Original Message - 
From: Manish [EMAIL PROTECTED]
To: Velocity Users List velocity-user@jakarta.apache.org
Sent: Monday, January 03, 2005 10:16 AM
Subject: response.redirect


 This must be trivial, but for some reasons I can't find it...
 How can I do sth similar to response.redirect in velocity template?
 
 TIA,
 - Manish
 
 
 
 
 -
 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]



Finding string literals

2004-12-27 Thread Manish
We have several velocity templates developed by many developers in last few
months.
We have used application.properties to get all the messages, labels, text
etc, however there might be few sting literals still existing in those
templates.
I was wondering if there was any way of having an automated test to find
string literals in velocity templates. Is there any?

Any inputs/pointers would be greatly appreciated.

TIA,
- Manish


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



Velocity logging

2004-11-23 Thread Manish
How can I configure velocity such that the logs go to the standard
catalina.out logs for Tomcat.

TIA,
- Manish


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



Access to request reponse objects in velocity template

2004-11-18 Thread Manish
Do I have implicit objects request and response available to my velocity
templates when I am using velocity with struts?

TIA,
- Manish


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



404 error

2004-11-07 Thread Manish
How can I have a global 404 error template in using Velocity-Struts?

- Manish



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



file not found in #include #parse

2004-11-07 Thread Manish
How can I handle the condition gracefully that file specified by$fileName
does not exist in either -

#include($fileName)
#parse($fileName)

As of now, when the file is not found, it throws exception -

Unable to find resource '/user/profile123.htm'
org.apache.velocity.exception.ResourceNotFoundException: Unable to find
resource '/user/profile123.htm'

TIA,
- Manish


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



Re: 404 error

2004-11-07 Thread Manish
Thanks Peter!
Got your point! :)

- Manish

- Original Message -
From: Peter Harrison [EMAIL PROTECTED]
To: Velocity Users List [EMAIL PROTECTED]
Sent: Monday, November 08, 2004 10:36 AM
Subject: Re: 404 error


 On Mon, 08 Nov 2004 18:05, Manish wrote:
  How can I have a global 404 error template in using Velocity-Struts?

 You don't. A 404 is really a function of Tomcat or your JSP runner. You
can
 configure your own messages if you wish within your web.xml.

 You can have your 404 error point to a error.jsp or a error.vm, or even a
 error.do. Its just a matter of configuration of the web.xml to point to
the
 appropriate URL. As an example here is the error redirect for our web
 application from web.xml:

 error-page
 error-code404/error-code
 location/errorpage.do/location
 /error-page




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



Re: file not found in #include #parse

2004-11-07 Thread Manish

  resourceExists().
 
http://jakarta.apache.org/velocity/api/org/apache/velocity/app/VelocityEngin
e.html#templateExists(java.lang.String)
 
http://jakarta.apache.org/velocity/api/org/apache/velocity/app/Velocity.html
#templateExists(java.lang.String)
 OTOH, it might be nice if we had properties like
 directive.include.throw.no.resource
 directive.parse.throw.no.resource


I agree!!!
BTW, if I have an HTML file, will this templateExists work for it?

- Manish


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



Example of AbstractPagerTool

2004-11-03 Thread Manish
Is there any example available for AbstractPagerTool How can I set
googlish links there?
Despite keeping default size to 20, somehow my slip size is only 19!!!

TIA,
- Manish


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



Re: Example of AbstractPagerTool

2004-11-03 Thread Manish
Well,

I am not 100% sure, but I think this part of the code is te reason why
slip-size of 20 returns only 19 items in the list.
Me thinks it's incorrect, can someone explain the reason behined this?

/* don't include current page in slip size calcs */
int adjSlipSize = slipSize - 1;

Is  Matthew Van Horn a regular here?

TIA,
- Manish


- Original Message -
From: Manish
To: Velocity Users List [EMAIL PROTECTED]
Sent: Wednesday, November 03, 2004 1:55 PM
Subject: Example of AbstractPagerTool


 Is there any example available for AbstractPagerTool How can I set
 googlish links there?
 Despite keeping default size to 20, somehow my slip size is only 19!!!

 TIA,
 - Manish


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



A link

2004-10-29 Thread Manish
I have an area in my form for user comments, the user may type following
text in his comments -
a href=http://some.url.com/;some name/a

I print this text in my template as -
$user.comments

However, this link is not treated as HTML but as normal text. How can I
treat it as HTML by default?
The user may or may not use HTML tags, but I'd still want to treat it as
HTML. How do I do this?

- Manish


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



Formatting price, decimals etc...

2004-10-26 Thread Manish Hatwalne
How can I format price, decimals etc in VTL?

TIA,
- Manish


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



Formatting price, decimals etc...

2004-10-25 Thread Manish
How can I format price, decimals etc in VTL?

TIA,
- Manish


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



Re: Formatting price, decimals etc...

2004-10-25 Thread Manish


  How can I format price, decimals etc in VTL?
 Try NumberTool.  ;)

http://jakarta.apache.org/velocity/tools/javadoc/org/apache/velocity/tools/g
eneric/NumberTool.html


Thanks! :)
I have another problem though, I am trying to format price, and this is what
I am using, but it puts decimal .00 in price which I do not want.
How can I have price such as - $100 instead of $100.00
$listprice itself is an integer.

I have tried -

$!num.format('currency', $listprice)
$!num.format('currency', $!num.format('integer', $p.listprice))

what can I do?

TIA,
- Manish



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



Testing HTML well-formedness

2004-10-21 Thread Manish
How can I test well-formedness of HTML produced by velocity template?
I am using Struts-Velocity combination.

TIA,
- Manish


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



Re: Testing HTML well-formedness

2004-10-21 Thread Manish

- Original Message - 
From: Ryan Lea [EMAIL PROTECTED]
To: Velocity Users List [EMAIL PROTECTED]
Sent: Thursday, October 21, 2004 1:40 PM
Subject: RE: Testing HTML well-formedness 


Whilst its possibly not the best way to do things - I test by dumping
the output (HTML) into a file and then using the www.w3.org html
validator and upload the file.  It will tell you everything right and
wrong about the file.


That's what I do !!! :)
But boss says it has to be automated JUnit test or sth...
So, how to do itt???

TIA,
- Manish



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



Re: Conditional display - Approach question

2004-10-20 Thread Manish
  What should be the best approach in this case, it's not just about
getting
  this done somehow.
  I'd highly appreciate any inputs here.
 First, I'd ask myself, What business does the unavailable books have
 in booklist in the first place?.  If there is a darn good reason, I'd
 choose (1).  Otherwise, (2) is my choice.
 As for the many programmers, ask them, Would you like to fix 100
 classes now, or 200 classes later?.  Postponing good design decisions
 increases the pressure upon the team.  Of course, it looks like you
 have the tests, so it wouldn't be so much pressure (IF they are
 automated).

Thanks for your inputs Shinobu,
I have indeed used approach (2) with some smart refactoring. My main concern
was the fact that every action now would require to go through this routine.
But the code I have rewritten now isolates this functionality and as long as
other actions use this module, they're safe. :)

The tests are automated indeed.

- Manish


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



Conditional display - Approach question

2004-10-19 Thread Manish
This is not a strictly Velocity question, but putting it here because I
believe that I'd be able to get good inputs here.

I use Velocity as view, and struts for actions. Now I have several actions
which search DB for various searches and produce a list.
I have single velocity template results' to which all these actions are
forwarded.

Now let's say I have a list of books which can be searched on various
parameters and various actions are defined for these searches. Now I need to
display only those books which satisfy condition - isAvailable (actual list
and condition is far more complex) and not otherwise. I have 2 approaches -

(1) Put a conditional check in velocity template while iterating though a
list to decide if the book should be displayed. It would be sth like this -

#foreach($book in booklist)
#if($StockManager.isAvailable($book.number))
 ## do whatever here...
#end
## don't display anything if book is not available
#end

(2) Another approach is to check this in VARIOUS actions while creating the
list itself if the book should be added to the list at all.

First approach sounds easier to implement, but it means that the view part
is taking decision about business logic, which sounds not so nice
Second approach is difficult because there are many actions that will have
to be changed, besides there are many programmers working on various
actions, so they all need to take care of that. So I am trying to avoid
this However, there's one more advantage here, if I do it this way I can
add a unit test to check that only available books are getting added.

What should be the best approach in this case, it's not just about getting
this done somehow.
I'd highly appreciate any inputs here.

TIA,
- Manish

p.s. BTW, is there anything similar to Java continue in VTL?




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



Velocity with Struts

2004-10-08 Thread Manish
Anybody using Velocity with struts?
Is there any article/tutorial available for the same? I haven't used struts
in last year or so (just used for a month before that), so not much
comfortable
with struts.

Any help, pointers would be highly appreciated!

TIA,
- Manish


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



Re: Velocity with Struts

2004-10-08 Thread Manish
Thanks a ton for the link Shinobu!!!
Somehow the velocity site had hidden this link from me ;) ;)

Can you pls tell me how do you typically put stuff in the velocity context
with struts? I searched through my action code (that someone lese wrote)
for context.put, but couldn't find it. I have used velocity from plain Java
classes before.

TIA,
- Manish
- Original Message -
From: Shinobu Kawai [EMAIL PROTECTED]
To: Velocity Users List [EMAIL PROTECTED]
Sent: Friday, October 08, 2004 12:44 PM
Subject: Re: Velocity with Struts



 Hi Manish,

  Anybody using Velocity with struts?
  Is there any article/tutorial available for the same? I haven't used
struts
  in last year or so (just used for a month before that), so not much
  comfortable
  with struts.
 I'm sure you've already looked here:
 http://jakarta.apache.org/velocity/tools/struts/

 There is also a nice sample in the Velocity Tools package:
   examples/velstruts.war
 Of course, this is only a sample, but it did well for me.

 Best regards,
 -- Shinobu Kawai

 --
 Shinobu Kawai [EMAIL PROTECTED]


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



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



Velocity with struts

2004-10-08 Thread Manish Hatwalne
Anybody using Velocity with struts?
Is there any article/tutorial available for the same? I haven't used struts
in last year or so (just used for a month before that), so not comfortable
with that.
Any help, pointers would be highly appreciated!

TIA,
- Manish


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



Compare null

2004-10-06 Thread Manish
How can I compare 'null' in my velocity template for if condition???
The following results in an error.

#if(null == $p.getDisplayaddressbool()){
}

TIA,
- Manish


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



Re: Compare null

2004-10-06 Thread Manish
Ah thanks!
This should work, but there a global macro somewhere in my code that
replaces all these blank  for nulls by NA value.
Now I'll have to figure out whether this test comes first or it is the
macro. Someone else wrote this code and he's leaving
It's fun being a programmer, excitement never stops! ;)

- Manish

p.s.
Nathan,
Are you one of the original developers of Velocity? I find your replies
quite useful and thorough.


- Original Message -
From: Nathan Bubna [EMAIL PROTECTED]
To: Velocity Users List [EMAIL PROTECTED]
Sent: Wednesday, October 06, 2004 12:43 PM
Subject: Re: Compare null


 Manish said:
  How can I compare 'null' in my velocity template for if condition???
  The following results in an error.
 
  #if(null == $p.getDisplayaddressbool()){
  }

 you're confusing java with VTL.  VTL has no null keyword or token. (though
it
 was discussed favorably in ages long past.)

 i've found the most reliable way to test for nulls is:

 #if( $!myboolean ==  ) foo is null! #end

 Nathan Bubna
 [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]