commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dion Gillard <dion.gill...@gmail.com>
Subject Re: [Jelly/Jexl] How to add two int values?
Date Sun, 01 Aug 2004 13:27:35 GMT
This works for me:

  result is '${1 + 2}'
  <set var="x" value="3"/>
  <set var="y" value="4"/>
  result is '${x + y}'

Can you simplify your example?

On Sun, 01 Aug 2004 15:13:10 +0200, Peter Nabbefeld
<peter.nabbefeld@gmx.de> wrote:
> I've asked to add two int values. Here's some of the code (I've tried
> different versions - without success):
> 
> <j:forEach var="line" items="${pluginIncludeTags}">
>    <echo>line = ${line}</echo>
>    <j:set var="_cpos" value="${line.indexOf(':')}"/>
>    <!-- j:invokeStatic var="_cpos" className="java.lang.Integer"
> method="parseInt">
>      <j:arg type="java.lang.String" value="${line.indexOf(':')}"/>
>    </j:invokeStatic -->
>    <!-- j:set var="_pos"
> value="${java.lang.Integer.parseInt(line.substring(0, _cpos))}"/ -->
>    <j:invokeStatic var="_pos" className="java.lang.Integer"
> method="parseInt">
>      <j:arg type="java.lang.String" value="${line.substring(0, _cpos)}"/>
>    </j:invokeStatic>
>    <j:set var="_lineDir" value="${line.substring(_cpos, _cpos + _pos)}"/>
>    <!-- j:invoke var="_lineDir" method="substring" on="${line}">
>      <j:arg type="int" value="${_cpos)}"/>
>      <j:arg type="int"><j:expr value="_cpos + _pos"/></j:arg>
>    </j:invoke -->
> 
> Peter
> 
> Dion Gillard schrieb:
> 
> 
> 
> > What types are x and y?
> >
> > On Sun, 01 Aug 2004 14:27:08 +0200, Peter Nabbefeld
> > <peter.nabbefeld@gmx.de> wrote:
> >
> >>Hi,
> >>
> >>I'm trying to write a Jelly script for Maven. I've tried "${x + y}" and
> >>"${x} + ${y}" as the value argument, both don't work for me. I don't
> >>know, if this is a problem with the archaic versions, Maven uses (e.g.
> >>ant 1.5.3), or if it is a problem with Jelly/Jexl. If it is a solved
> >>problem, please give me the right syntax, so I can file a bug for Maven.
> >>
> >>Kind regards
> >>
> >>Peter Nabbefeld
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>
> >>
> >
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 


-- 
http://www.multitask.com.au/people/dion/

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


Mime
View raw message