According to TLD or attribute directive in tag file, attribute name does not accept any expressions

后端 未结 1 880
滥情空心
滥情空心 2020-12-19 18:34

I write the following code in JSP.

<%
String p_loginPassword = OpeCommon.LOGIN_PASSWORD;
String p_encryptCode = OpeCommon.encriptPassword(OpeCommon.KEY_US         


        
1条回答
  •  我在风中等你
    2020-12-19 19:02

    Don't use scriptlets in the struts tags, don't use it at all in JSP, if you can't you may try

    <%=OpeCommon.LOGIN_PASSWORD %>
    <%=OpeCommon.encriptPassword(OpeCommon.KEY_USER_ID, OpeCommon.KEY_USER_PASSCODE)%>
    

    Note, that constants could be accessed through the OGNL expression, and that expression is allowed in the struts tags. But, it applies to the OGNL syntax and you should supply FQCN to the static content. Constants don't require enabling static access in the configuration, but calling a static method is required. If you allow static access then everything could be done via OGNL expressions, if not only constants could be accessed like

    
    

    0 讨论(0)
提交回复
热议问题