Search code examples
javajspjstl

Is there any way to use a ftm message tag as title?


I'm trying to use text as a title but getting it from fmt dynamically.

This is what I tried
1. <forms:button name="btnUploadSuccess" text=<fmt:message key="SUCCESS_BUTTON_TEXT"/>/>
2. <forms:button name="btnUploadSuccess" text="<fmt:message key="SUCCESS_BUTTON_TEXT"/>"/>
3. <forms:button name="btnUploadSuccess" text=${<fmt:message key="SUCCESS_BUTTON_TEXT"/>}/>

If there is any way to do so. Please help.

When I tried these methods I got javax.servlet.jsp.JspException: ServletException exception.


Solution

  • You can try this by creating var for fmt:message before.

        <fmt:message key="SUCCESS_BUTTON_TEXT" var="SUCCESSBUTTONTEXT"/>
        <forms:button name="btnUploadSuccess" text="${SUCCESSBUTTONTEXT}"/>