What is $text?  Are you trying to use VelocityTools with Struts2?  If
so (and it very much looks like it), what version?  What does your
toolbox.xml look like?  Are you using the VelocityViewServlet to
process templates or is that something that Struts2 is handling?

VelocityTools currently only explicitly supports Struts 1.x.   We're
not involved in developing the Velocity directives for Struts2.  I
believe those are being handled entirely by the Struts2 project.  I
haven't used Struts2 yet, so i'm not very familiar with their Velocity
integration.  If no one else on this lists chimes in with more info,
you might try asking [EMAIL PROTECTED] about this.

On 5/14/07, Jordi Rubio Moreno <[EMAIL PROTECTED]> wrote:
Hi,

I'm trying to use Velocity with Struts 2. At this moment, I have two
view files: one with taglibs and one with Velocity tags. The first dumps
texts with <s:text name="foo"> (where foo var is stores in a
package.properties file), and works fine. The Velocity template looks
like:

     <tr align="right">
      #stext (name="Results.counter1")<br>
      $text.get('Results.counter1', [$result.getTotalRowsNumber()])<br>
      $text.exists("Results.counter1")
     </tr>
     <tr>
      <table id="results">
       #foreach($offer in $offers)
        <tr>
         <td>
                <a
href="$link.setAction('/Redirect.action').param('url',
$offer.url)">$offer.title</a>
         </td>
        </tr>
       #end
      </table>
     </tr>

The $link, #foreach, etc work fine, but the text tags works wrong. This
is the output for this code:

#stext (name="Results.counter1")
$text.get('Results.counter1', [$result.getTotalRowsNumber()])
false

What am I  doing wrong? Taglibs and Velocity works with the same
package.properties. I have tried to put this resource file replicated in
a lot of directories, allways in the classpath, but the result is
allways the same...

Please, help! :P

Thanks a lot for your time!

Cheers!


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

Reply via email to