take a look at this example

<[EMAIL PROTECTED] prefix="s" uri="/struts-tags" %>
<div style="background-color:yellow;">
<p>
JSP Custom Template -
parameter 'paramName' - <s:property value="%{paramName}" />
</p>
</div>
reference any parameter using OGNL ..this will help..
http://struts.apache.org/2.x/docs/ognl.html
you can cast off # if you are referencing Action properties

to prevent <mis>interpretations by JSP EL use this directive
<jsp-config>
    <jsp-property-group>
      <url-pattern>*.jsp</url-pattern>
      <el-ignored>true</el-ignored>
    </jsp-property-group>
  </jsp-config>Does this help?
M--
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[email protected]>
Sent: Tuesday, December 18, 2007 4:39 PM
Subject: Re: Is there a way to store a bean property value in a variable in
view (JSP)?


> Hi everyone,
>
> Is it legal to define a EL variable to hold ${lei}<s:property value="lang"
> />?
>
> Thanks.
>
>
> On Dec 18, 2007 4:23 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
> >
> > I need to build a path to an image file in a JSP based on the value
passed
> > to the JSP's action, either using an English button from <context
path>/*
> > en*/closeBtn.gif or using a French button from <context path>/
*fr*/closeBtn.gif.
> > Suppose the parameter is called lang so the URL is
like*.../login.action?lang=<en or fr>
> > *
> > **
> > There are two approaches, each of which has a problem which I need to
> > figure out.
> >
> > *1. If the path is built in JSP*
> > In this case, I need to store the lang value in a variable and use it to
> > build the path like this:
> >
> > <
> > s:url value="/" includeParams ="none" id="contextPath" />
> >
> > <
> > img src="${contextPath}*???*/closeBtn.gif" />
> >
> > where ??? is either en or fr. How can I do it? I know lang can be
streamed
> > out like <s:property value="lang"/> but it doesn't work if ??? is
> > substitued with < s:property value="lang"/>. Is there a way to read lang
> > to a variable?
> >
> > *2. If the path is built in the action class*
> >
> > In this case, I need to get context path and use it to build the path.
The
> > path can be stored as a bean property so its value can be accessed in
view
> > using <s:property .../> tag.
> >
> > The problem is how to get the context path from an action class?
> >
> > Are there other ways to solve the problem?
> >
> > Thanks a lot for any comments and help.
> >
> >
> >
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to