On Mon, 11 Jun 2001, Ryan Cornia wrote:

> I'm trying to figure out how to pass a constant name/page to the example checkLogon 
>tag. I created a Constants class, with -
>    public final static String STAFF_LOGIN_KEY = "test:staffloggedin";
> 
> in my jsp I put -
> <app:checkLogon name="<% Contants.STAFF_LOGIN_KEY %>" />"
> 

You need to use a runtime expression instead:

  <app:checkLogon name="<%= Constants.STAFF_LOGIN_KEY %>" />
                          ^
                          |
                          |

> The issue is that it sets name in the checkLogon tag to the string " <% 
>Contants.STAFF_LOGIN_KEY %>" not the value of that scriptlet ("stafflogon.jsp"). Any 
>ideas?
> 
> Also, I am trying to do substitution on an action error with the following -
> 
> errors.add(ActionErrors.GLOBAL_ERROR,
>                      new ActionError("error.login", "test"));
> 
> When this runs, the error message is -
> "Login Error: [Ljava.lang.Object;@158bf9 " 
> 
> Instead of 
> "Login Error: test"
> 
> This is with Struts 1.0B3.
> 

What does the message format string named "error.login" look like?

> Thanks,
> Ryan "Newbie"
> 
> Ryan Cornia
> Programmer Analyst
> Department of Community and Economic Development
> State of Utah
> 
> 

Craig McClanahan


Reply via email to