日期:2014-05-19  浏览次数:20640 次

url中的参数用了ognl表达式${},就出错!!!
Java code

            <s:a href="selectinfo.action?username=${username}&type=users">
                <s:text name="查看用户信息"></s:text>
            </s:a>



报错:
org.apache.jasper.JasperException: /main.jsp(40,3) According to TLD or attribute directive in tag file, attribute href does not accept any expressions

错就错在 ${username}这个地方,不知道怎么解决~~

------解决方案--------------------
用#{username},强制解析成ognl表达式。或者用<s:property value='username'/>代替
------解决方案--------------------
把el表达式改为#{requestScope.username}
------解决方案--------------------
别用s标签就行了
干嘛非要用s标签呢