[prev in list] [next in list] [prev in thread] [next in thread] 

List:       velocity-user
Subject:    RE: 'Black magic' (woman) in Velocity for Struts
From:       "Ed Yu" <ekyu () asgnet ! psc ! sc ! edu>
Date:       2002-12-25 2:08:24
[Download RAW message or body]

[Attachment #2 (text/plain)]

In the velocity-tools project, it will automagically perform scope lookup all referenced objects.

	-----Original Message----- 
	From: Robert Nicholson [mailto:robert@elastica.com] 
	Sent: Tue 12/24/2002 20:36 
	To: Velocity Users List 
	Cc: 
	Subject: Re: 'Black magic' (woman) in Velocity for Struts
	
	

	Doesn't "user" have to be available in the VelocityContext to refer to 
	$user in the template liike that?
	
	On Wednesday, December 25, 2002, at 02:13  AM, otisg wrote:
	
	> No black magic, after all, just slow brain
	> cells.LogonAction in the Velocity-Struts
	> examples is the key.  The setAttribute call
	> is what sets the 'user', except the actual
	> String 'user' is defined in Constants.java,
	> which is why I didn't spot it right away.
	>
	> Mmmm, Velocity + Struts looks yummier and
	> yummier.
	>
	> Otis
	>
	>
	> ---- On Tue, 24 Dec 2002, otisg
	> (otisg@ureach.com) wrote:
	>
	>> Hello,
	>>
	>> I' working with the HEAD Struts and HEAD
	>> Velocity.  I have them mostly working
	>> together, but I have a question about some
	>> 'black magic' that I can't track down.
	>>
	>> If I go log in with any username/password
	>>
	> http://www.teamup.com:8080/velstrutsdemo/logon_vm.do
	>>
	>> I will end up on a page that knows which
	>> username I entered.
	>> The source of that page is this:
	>>
	> http://www.teamup.com:8080/velstrutsdemo/examples/struts_app3/
	> index_vm.txt
	>>
	>> The 'black magic' part that is not clear to
	>> me is this:
	>>
	>>         #if( $user )
	>>         <h3>Welcome $user.username!
	>> (Velocity Version)</h3>
	>>         #else
	>>         <h3>Welcome World! (Velocity
	>> Version)</h3>
	>>         #end
	>>
	>> What I don't understand is where '$user'
	>> comes from.  This is obviously set somewhere
	>> and by something.
	>> I cannot find where this is set, nor what
	>> piece sets it.
	>>
	>> In my copy of this application $user is
	>> null, so I need to figure out where to set
	> this.
	>>
	>> My first thought was that this is somehow
	>> pulled out of the form defined in
	>> struts-config.xml, but I didn't see any
	>> mention of 'user' there.
	>>
	>> Any help would be great.
	>>
	>> Merci,
	>> Otis
	>>
	>>
	>>
	> ________________________________________________
	>> Get your own "800" number
	>> Voicemail, fax, email, and a lot more
	>> http://www.ureach.com/reg/tag
	>>
	>> --
	>> To unsubscribe, e-mail:
	> <mailto:velocity-user-unsubscribe@jakarta.apache.org>
	>> For additional commands, e-mail:
	> <mailto:velocity-user-help@jakarta.apache.org>
	>>
	>>
	>>
	>
	>
	> ________________________________________________
	> Get your own "800" number
	> Voicemail, fax, email, and a lot more
	> http://www.ureach.com/reg/tag
	>
	> --
	> To unsubscribe, e-mail:   
	> <mailto:velocity-user-unsubscribe@jakarta.apache.org>
	> For additional commands, e-mail: 
	> <mailto:velocity-user-help@jakarta.apache.org>
	
	
	--
	To unsubscribe, e-mail:   <mailto:velocity-user-unsubscribe@jakarta.apache.org>
	For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>
	
	


["winmail.dat" (application/ms-tnef)]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic