velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlo Torniai <carlo.torn...@hp.com>
Subject Re: Keep vectors value in context
Date Wed, 30 Aug 2006 10:25:50 GMT
The servlet extends the  VelocityServlet
And the handleRequest( method is the following.

public Template handleRequest( HttpServletRequest request,
    HttpServletResponse response, Context ctx )
....


I don't think that the request response and servlet context are put in 
the velocity context though.
Carlo




Felix Satyaputra wrote:
> Hi Carlo,
>
> Is this servlet extended from VelocityServlet in
> velocity tools project?
>
> http://jakarta.apache.org/velocity/tools/javadoc/org/apache/velocity/tools/view/servlet/VelocityViewServlet.html
>
> This servlet puts request, session, & servlet context
> (I think) inside velocity context for every request.
>
> Your servlet (if it's custom build) can do the same
> thing - put request & session in velocity context.
> Then store the vector in session.
>
> Assuming session is stored under the key 'session' in
> velocity context, to use from velocity,
>
> #set ($myVector =
> $session.getAttribute('myVectorAttribute'))
>
> A little work around, I guess...
>
> Cheers,
>
> Felix
>
>
> --- Carlo Torniai <carlo.torniai@hp.com> wrote:
>
>   
>> Hi there.
>> I'm using a servlet to build some vectors that are
>> used by a velocity 
>> template.
>> I call the same servlet with different parameters
>> and I would like to 
>> keep the value of vectors stored in the context
>> according to some 
>> parameters value.
>> But i found that every time i call the servlet the
>> vectors has to be 
>> populated and added to the context.
>> The question is: how can I add vectors to the
>> context so that they can 
>> be persistent (i.e. no need to populate them and to
>> add them to the 
>> context every time the servlet is called) during a
>> user session?
>> Thanks
>> Carlo
>>
>>
>>
>>
>>
>>
>>     
> ---------------------------------------------------------------------
>   
>> To unsubscribe, e-mail:
>> velocity-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail:
>> velocity-user-help@jakarta.apache.org
>>
>>
>>     
>
>
>
> 	
> 	
> 		
> ___________________________________________________________ 
> All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease of use."
- PC Magazine 
> http://uk.docs.yahoo.com/nowyoucan.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
>
>   



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


Mime
View raw message