日期:2014-05-20  浏览次数:20817 次

jsp访问javaBean是出错帮帮忙谢谢!
package   ss;
public   class   ssbean
{
String   Mm= "xxx ";
public   String   getMm()
{
        return   (this.Mm);
}
public   void   setMm(String   Mm)
{
        this.Mm   =   Mm;
}
}
---------------------------------
<%@   page   contentType= "text/html;charset=GBK "   language= "java "   %>
<html>
<head>
<title> Reusing   javaBeans   in   JSP </title>
</head>
<body>
<%@   page   import= "ss.ssbean "   %>      
<center>
<table   border= "1 ">
<tr>
<td>
<jsp:useBean   id= "ss "   scope= "application "   class= "ss.ssbean "   />
    <jsp:setProperty   name= "ss "   property= "Mm "   value= "Hello "   />
<h1> 通过属性值:
<i> <jsp:getProperty   name= "ss "   property= "Mm "   /> </i>
</h1>
<jsp:setProperty   name= "ss "   property= "Mm "   value= "Hello   www "   />
<h1> 通过显现方式获取属性值:
<i> ${ss.Mm} </i> <br/>
</h1>
</td>
</tr>
</table>
</center>
</body>
</html>

ssbean.java文件我是在\WEB-INF\classes\ss编译的怎么还是出错
朋友们帮帮忙!!!!!错误信息为
message  

description   The   server   encountered   an   internal   error   ()   that   prevented   it   from   fulfilling   this   request.

exception  

org.apache.jasper.JasperException:   Cannot   find   any   information   on   property   'Mm '   in   a   bean   of   type   'ss.ssbean '
org.apache.jasper.runtime.JspRuntimeLibrary.getReadMethod(JspRuntimeLibrary.java:837)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1015)
org.apache.jasper.compiler.Node$GetProperty.accept(Node.java:1062)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Generator.generate(Generator.java:3272)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:244)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:495)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:476)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:464)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

------解决方案--------------------
java编码规范:类名首字母大写,其它的首字母均小写。
虽然在一般的java程序中可以随意写,但是很多java组件都遵循这个规范,所以养成良好的编码习惯是很有必要的。

我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.myexception.cn/java-web/317.html