Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can data be passed into an <s:> tag within a Struts tag file via attributes?
    primarykey
    data
    text
    <p>I have a form with two halves, one for attaching a wide thumbnail to an asset and one for a standard-size thumbnail. The jsp file generating the page calls thumbnail.tag, which calls thumb.tag twice:</p> <pre><code>&lt;thumbnail:thumb label="75px Thumbnail" /&gt; &lt;thumbnail:thumb label="Wide Thumbnail" /&gt; </code></pre> <p>thumb.tag in turn has the following:</p> <pre><code>&lt;s:if test="#attr.label == '75px Thumbnail'"&gt; &lt;thumbnail:standardThumb /&gt; &lt;/s:if&gt; &lt;s:elseif test="#attr.label == 'Wide Thumbnail'"&gt; &lt;thumbnail:wideThumb /&gt; &lt;/s:elseif&gt; </code></pre> <p>The sole difference between standardThumb.tag and wideThumb.tag is the variable names, e.g. stdThumbUrl and wideThumbUrl. I have been assigned to refactor this into a single file and pass in the "std" or "wide" string. I have found this works just fine with regular HTML tags. For example, added to thumb.tag:</p> <pre><code>&lt;thumbnail:standardThumb tst="standard" /&gt; </code></pre> <p>and to standardThumb.tag:</p> <pre><code>&lt;%@ attribute name="tst" required="true"%&gt; ... &lt;iframe id="${tst}ThumbImage" ... &gt; </code></pre> <p>and this works as expected. I can't seem to find a way to get "standard" into </p> <pre><code>&lt;s:if test="content.standardThumbUrl != null"&gt; </code></pre> <p>in the same file. I've tried every combination of % and $ and # and {} that I can think of, but nothing has worked. Is there some proper syntax that will help me achieve the effect I'm looking for?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload