Search code examples
htmljspnestedliferayquoting

Fourthly nested quoting in JSP


How can I make Tomcat swallow this line?? I tried all quoting combinations!

 <liferay-ui:search-container-column-text name="howstheweather" 
   value="<liferay-ui:message key='<%=("Sun").equals(timeBean.today())?"sunny-day-msg":"take-umbrella-msg"%>'/>"
 />

Asking if there is any solution, not assessing changing to EL and JSLT


Solution

  • You cannot use jsp-tag in values of other jsp-tag. But the <liferay-ui:search-container-column-text .../>-Tag has a translate attribute. Hier the solution for you:

    <liferay-ui:search-container-column-text name="howstheweather" 
      value='<%=("Sun").equals(timeBean.today())?"sunny-day-msg":"take-umbrella-msg"%>'
      translate='true'
    />