You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Philip Posgate <ph...@tantalus.com> on 2001/08/03 20:22:00 UTC

RE: redirects, Velocity and Java

Use $!error in your template.  This will prevent "$error" from appearing in
the web page when the context-hashtable value is null.

-----Original Message-----
From: Byron Poos [mailto:byron_poos@palazzoinc.com]
Sent: Friday, August 03, 2001 11:23 AM
To: turbine-user@jakarta.apache.org
Subject: redirects, Velocity and Java


I am having problems getting some java code behind a velocity template to
execute.

I have set up my SecureScreen.java to do a re-direct to my login form as
follows:

data.getTemplateInfo().setScreenTemplate( "LoginForm.vm" );

The login form (LoginForm.vm) contains the following chunk:

<p>$error</p>

I set error like this in my code(LoginForm.java):

        context.put ("error", loginError);

where loginError is some string containing a message.

My problem is this:

When I first attempt to hit a secure screen, I am redirected to the login
form and I see
$error
instead of a message or a blank. When I hit the loging form directly, I
don't see any message in the $error space because it has been defaulted to
blank.
I placed debug code in LoginForm.java. It doesn't get executed when
redirected by the SecureScreen but does get executed when I call
LoginForm.vm directly.

Does anyone have any idea why the code doesn't get executed when I hit the
form via a redirect?

I apologies for being long winded, but I figured too much info is better
then too little.
Thanks for your time.
Byron


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



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


RE: redirects, Velocity and Java

Posted by Byron Poos <by...@palazzoinc.com>.
Philip,
Thanks for the suggestion. I completely changed the tag in the velocity form
and the java code. The java code is still not getting executed when
SecureScreen does the redirect. Any ideas? Thanks again.
Byron

-----Original Message-----
From: Philip Posgate [mailto:philip@tantalus.com]
Sent: Friday, August 03, 2001 12:22 PM
To: turbine-user@jakarta.apache.org
Subject: RE: redirects, Velocity and Java


Use $!error in your template.  This will prevent "$error" from appearing in
the web page when the context-hashtable value is null.

-----Original Message-----
From: Byron Poos [mailto:byron_poos@palazzoinc.com]
Sent: Friday, August 03, 2001 11:23 AM
To: turbine-user@jakarta.apache.org
Subject: redirects, Velocity and Java


I am having problems getting some java code behind a velocity template to
execute.

I have set up my SecureScreen.java to do a re-direct to my login form as
follows:

data.getTemplateInfo().setScreenTemplate( "LoginForm.vm" );

The login form (LoginForm.vm) contains the following chunk:

<p>$error</p>

I set error like this in my code(LoginForm.java):

        context.put ("error", loginError);

where loginError is some string containing a message.

My problem is this:

When I first attempt to hit a secure screen, I am redirected to the login
form and I see
$error
instead of a message or a blank. When I hit the loging form directly, I
don't see any message in the $error space because it has been defaulted to
blank.
I placed debug code in LoginForm.java. It doesn't get executed when
redirected by the SecureScreen but does get executed when I call
LoginForm.vm directly.

Does anyone have any idea why the code doesn't get executed when I hit the
form via a redirect?

I apologies for being long winded, but I figured too much info is better
then too little.
Thanks for your time.
Byron


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



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


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