[jira] Created: (VELOCITY-542) minus sign in #set requires spaces to surround it

2007-04-27 Thread Will Glass-Husain (JIRA)
minus sign in #set requires spaces to surround it
-

 Key: VELOCITY-542
 URL: https://issues.apache.org/jira/browse/VELOCITY-542
 Project: Velocity
  Issue Type: Bug
  Components: Engine
Affects Versions: 1.5
Reporter: Will Glass-Husain
Priority: Minor


The following example:

#set($thisCampNumber = 10)
#set($nextCampNumber = $thisCampNumber+1)
#set($previousCampNumber = $thisCampNumber-1)
#set($previousCampNumberB = $thisCampNumber - 1)

1: $thisCampNumberbr
2: $nextCampNumberbr
3: $previousCampNumberbr
4: $previousCampNumberBbr

produces this result

1: 10
2: 11
3: $previousCampNumber
4: 9


Note that using a minus sign in a #set statement does not work if there are no 
spaces around it.  (however, the same is not true for +).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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



[jira] Commented: (VELOCITY-542) minus sign in #set requires spaces to surround it

2007-04-27 Thread Nathan Bubna (JIRA)

[ 
https://issues.apache.org/jira/browse/VELOCITY-542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492313
 ] 

Nathan Bubna commented on VELOCITY-542:
---

This is because '-' is a valid character in a reference.

Try  doing #set( $thisCampNumber-1 = hello world ) before running your test.

 minus sign in #set requires spaces to surround it
 -

 Key: VELOCITY-542
 URL: https://issues.apache.org/jira/browse/VELOCITY-542
 Project: Velocity
  Issue Type: Bug
  Components: Engine
Affects Versions: 1.5
Reporter: Will Glass-Husain
Priority: Minor

 The following example:
 #set($thisCampNumber = 10)
 #set($nextCampNumber = $thisCampNumber+1)
 #set($previousCampNumber = $thisCampNumber-1)
 #set($previousCampNumberB = $thisCampNumber - 1)
 1: $thisCampNumberbr
 2: $nextCampNumberbr
 3: $previousCampNumberbr
 4: $previousCampNumberBbr
 produces this result
 1: 10
 2: 11
 3: $previousCampNumber
 4: 9
 Note that using a minus sign in a #set statement does not work if there are 
 no spaces around it.  (however, the same is not true for +).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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



Need a clarifcation about some issues

2007-04-27 Thread Supun Kamburugamuva

Hi,
I have been playing with Velocity in the past few days. By doing so I
encountered couple of problems. I'm not sure weather these are the
documented behavior so I thought I should ask the list.

1.I couldn't set a property after I initialize the Velocity Engine
(After calling the init() method).  Here the particular property I was
trying to set was MAX_NUMBER_LOOPS property.

2.I couldn't call inner class methods. I put an inner class object in
to Velocity context and then tried to call its methods from the
template. But it didn't work. Velocity just outputs the calling method
name.

Thanks,
Supun.

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



Re: Need a clarifcation about some issues

2007-04-27 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Supun,

Supun Kamburugamuva wrote:
 2.I couldn't call inner class methods. I put an inner class object in
 to Velocity context and then tried to call its methods from the
 template. But it didn't work. Velocity just outputs the calling method
 name.

Can you verify that the inner class (and the property accessor) is
public? I think introspection is blocked when a private/protected inner
class is involved, so it's possible that Velocity actually can't read
the values from your object.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGMjgY9CaO5/Lv0PARAh2FAJ0QCbpS3iy7FnqGrPcAOwouUQzFIwCgpqqI
lJqH+n5Wc8/dFKXNTmRjKnM=
=yUfv
-END PGP SIGNATURE-

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



Re: Need a clarifcation about some issues

2007-04-27 Thread Nathan Bubna

On 4/27/07, Supun Kamburugamuva [EMAIL PROTECTED] wrote:

Hi,
I have been playing with Velocity in the past few days. By doing so I
encountered couple of problems. I'm not sure weather these are the
documented behavior so I thought I should ask the list.

1.I couldn't set a property after I initialize the Velocity Engine
(After calling the init() method).  Here the particular property I was
trying to set was MAX_NUMBER_LOOPS property.


Correct.  Properties must be set prior to initialization/use of the
runtime.  At this point, there is no support for changing properties
in a runtime instance that's already in use.


2.I couldn't call inner class methods. I put an inner class object in
to Velocity context and then tried to call its methods from the
template. But it didn't work. Velocity just outputs the calling method
name.


Christopher is right here.  Inner classes work just fine (i use them a
lot), but they must be declared public just like any other classes you
are trying access in a template.


Thanks,
Supun.

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



[veltools] status of 2.x branch

2007-04-27 Thread Nathan Bubna

hey folks,

so, i thought i'd give a heads up that VelocityTools 2.x has come
along quickly.  at this point, the new code can be used to build apps
with much less configuration and much greater flexibility and power
than the previous version.  it is also almost completely backwards
compatible.  if you checkout and build the 2.x branch, you can run the
simple and showcase examples with no changes and only two minor
problems (having an issue with the IteratorTool and RenderTool demos).
The VelocityStruts tools are not updated to work with the new system
yet, but i should get to those soon.

please feel free to check it out and give feedback.   once i get 100%
(or maybe 99.5%) backwards compatibility with the examples as they
are, i will convert them to get rid of the deprecated config and such,
in order to demonstrate the new configuration method(s).

then we (probably i) can move on to bringing Veltag in (as
VelocityViewTag) and perhaps creating a VelocityViewFilter and other
such new possibilities.

cheers,
nathan

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