struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "j alex" <strutstwou...@gmail.com>
Subject Re: S2 : Checking constants within JSP
Date Sun, 03 Feb 2008 03:10:05 GMT
Thanks Dave, with just scriptlets we could do it with a single page import
on top
<%@ page
language="java"
contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"
import="com.abc.utils.AffinityConstants"

and in scriptlet as:

  <%   if(((AppConstants.APPLICATION_CODE.equals(appCode))  {%>

In S2, we are avoiding scriptlets as much as possible, and using S2 tags and
the @ format seemed a little repetitive when there are a bunch of checks in
the JSP . I assume it won't have any performance impact . Please confirm?



On Feb 2, 2008 9:57 PM, Dave Newton <newton.dave@yahoo.com> wrote:

> --- j alex <strutstwouser@gmail.com> wrote:
> > <s:if test="myapp.appCode == @com.abc.util.AppConstants@APPLICATION
> _CODE">
> >
> > but this doesn't look clean ; is there a way to get rid of the @
> > com.abc.util.AppConstants [import?]
>
> No; that's how OGNL accesses static data (and it's much cleaner than the
> way
> we have to do it with JSP 2.0, IIRC).
>
> Another option is to expose a static property by setting an action
> property
> to the static value, but IMO that's more trouble than it's worth.
>
> Dave
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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