首页 > 解决方案 > How to resolve this issue? Failed to Compile JSP: This attribute is not recognized

问题描述

Im trying to pass a boolean value using request.setattribute in my Struts Action Class and in my JSP I am trying to disable a field based on that value. Here is my code:

if("update".equals(pRequest.getParameter(Request_type))){
            pRequest.setAttribute("checker", false);
        }
        else{
            pRequest.setAttribute("checker", true);
        }

My JSP element

         <tr id="startDateRow"   >

                    <td class="Fieldname" style="text-align: left"><bean:message
                            key="3888.key" /></td>
                    <td id="startDate" style="display:none" width="20%" ><html:text property="StartDate" maxlength="10"
            size="20" disabled = "<%request.getAttribute("checker"); %>" styleClass="Fieldcontent" /></td>

        </tr>

But when Im running my code console error is: Failed to compile JSP: This attribute is not recognized disabled = "<%request.getAttribute("checker"); %>" styleClass="Fieldcontent" />

标签: jspstruts-1scriptlet

解决方案


推荐阅读