title: Trim whitespace in JSPs with Struts conditionals
body: <p>I currently have a multi-language site based on Struts 2. Unfortunately, JSP leaves traces of white spaces everywhere in between struts tags. This is perfectly fine if the site is in English language (where there are spaces in between words) but not so if it's in say, Traditional Chinese.</p>
  
  <p>I'd like to trim all the whitespaces in the JSP page <strong>only if</strong> the user has selected Traditional Chinese as his/her preferred language.</p>
  
  <p>I've tried the following code, but it trims the whitespaces even when the page is in English.</p>
  
  <pre><code>&lt;s:if test="#session.languageId == 2"&gt; // languageId = 2 (Chinese), 1 (English)
      &lt;fmt:setLocale value="zh" /&gt;
      &lt;%@ page trimDirectiveWhitespaces="true" %&gt;
  &lt;/s:if&gt;
  </code></pre>
  
  <p>I'm guessing the above code breaks because of something to do with request time versus runtime code.</p>
  
  <p>Is there any way to achieve the above objective?</p>