TagSupport doStartTag() print fmt:message

Viewed 26

Hi everyone I have this problem, when I look for this result, the jsp page where I insert the result prints it correctly, but the <fmt:message key="roleFood1" /> and <fmt:message key="roleFood2" /> tag remains empty. How can I solve the problem? Do you have any idea? thank you

public class RoleTag extends TagSupport {
    
    public int doStartTag() throws JspException {       
        try {
                        
            JspWriter out = pageContext.getOut();

            String outPrint = "<div><span><fmt:message key='roleFood1' /></span><span><fmt:message key='roleFood2' /></span></div>";

            out.print(outPrint);
        } catch (java.io.IOException e) {
            throw new JspTagException(e.getMessage());
        }
        return SKIP_BODY;
    }
    
}

<fmt:message key ='....' /> It works fine as I use it in the JSP page.

0 Answers
Related