velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin.Rademac...@prg.co.nz
Subject Re: How to handle data in request object with space?
Date Mon, 21 Jun 2004 05:37:20 GMT
Hmm,

$bookmarkdtl should be an array in IMO. In order to access the single 
elements you could do a
#foreach loop.

Context data:

        VelocityContext context = new VelocityContext();
        Map map = new Hashtable();
        map.put("arr", new Object[] {"Abc", "die Katze","liegt im Schnee"
});
        context.put("map", map);
        ...

Template:

        #set( $fooBar = $map.get('arr') )
        #foreach( $name in $fooBar )
         $name
        #end

mano





"Saraswati Sivasankar \(sasivasa\)" <sasivasa@cisco.com> 
21/06/2004 17:15
Please respond to
"Velocity Users List" <velocity-user@jakarta.apache.org>


To
"'Velocity Users List'" <velocity-user@jakarta.apache.org>
cc

Subject
How to handle data in request object with space?






Hi,

I am trying to get data from 'request' object in my VM file through code
below. 
#set($bookmarkdtl = $data.Request.getAttribute('bkmrkdtl'))

However, I notice that the data after any space character is not 
retrieved.
Eg. If data in the request object is an arraylist of values as below, 
request.setAttribute("bkmrkdtl",alDetails);

The data retrieved through #set($bookmarkdtl =
$data.Request.getAttribute('bkmrkdtl')) does not retrieve complete data. 
If
anyone has any solution, pls do share with me.

Regards,
Saraswati


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



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message