初学getProperty 求解答~
getProperty标签是不是按顺序在各种scope里找Bean的属性?
为何我这么写不对呢?MyZQB是一个Bean类。s是MyZQB的一个属性。
HTML code
省略。。。
<body>
<%
pageContext.setAttribute("MyBean", new MyZQB("yy"));
%>
<jsp:getProperty property="s" name="MyBean" />
</body>
省略。。。
异常:
严重: Servlet.service() for servlet [jsp] in context with path [/Beer] threw exception [file:/Test.jsp(22,1) jsp:getProperty for bean with name 'MyBean'. Name was not previously introduced as per JSP.5.3] with root cause
org.apache.jasper.JasperException: file:/Test.jsp(22,1) jsp:getProperty for bean with name 'MyBean'. Name was not previously introduced as per JSP.5.3
------解决方案--------------------
http://baike.baidu.com/view/1002654.htm 你看下。