首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Eclipse开发 >

郁闷了,关于eclipse+myeclipse+tomcat做JSF时的有关问题

2013-09-11 
郁闷了,关于eclipse+myeclipse+tomcat做JSF时的问题我的配置:eclipse:eclipse-SDK-3.2.1-win32myeclipse:M

郁闷了,关于eclipse+myeclipse+tomcat做JSF时的问题
我的配置:

eclipse:   eclipse-SDK-3.2.1-win32
myeclipse:   MyEclipseEnterpriseWorkbenchInstaller_5.1.0GA_E3.2.1
tomcat:   apache-tomcat-6.0.2

我有一条语句:
<h:inputText   required= "false "   value= "#{user.name} "/>
运行时报错:
According   to   TLD   or   attribute   directive   in   tag   file,   attribute   value   does   not   accept   any   expressions
我在另一个环境试过,没错(myeclipse5.0,tomcat版本记不清了)
请高手帮忙看看,别嫌分少哈,没分了。

内容:
User.java:
package   mypro;

public   class   User   {
private   String   name;
public   void   setName(String   name)
{
this.name=name;
}
public   String   getName()
{
return   this.name;
}
}
---------------------------------
userinfo.jsp:
<%@   page   language= "java "   pageEncoding= "GBK "%>
<%@   taglib   uri= "http://java.sun.com/jsf/html "   prefix= "h "   %>
<%@   taglib   uri= "http://java.sun.com/jsf/core "   prefix= "f "   %>

<%
String   path   =   request.getContextPath();
String   basePath   =   request.getScheme()+ ":// "+request.getServerName()+ ": "+request.getServerPort()+path+ "/ ";
%>

<!DOCTYPE   HTML   PUBLIC   "-//W3C//DTD   HTML   4.01   Transitional//EN ">
<html>
<head>
<base   href= " <%=basePath%> ">

<title> My   JSF   'userinfo.jsp '   starting   page </title>

<meta   http-equiv= "pragma "   content= "no-cache ">
<meta   http-equiv= "cache-control "   content= "no-cache ">
<meta   http-equiv= "expires "   content= "0 ">        
<meta   http-equiv= "keywords "   content= "keyword1,keyword2,keyword3 ">
<meta   http-equiv= "description "   content= "This   is   my   page ">
<!--
<link   rel= "stylesheet "   type= "text/css "   href= "styles.css ">
-->

</head>
   
<body>
<f:view>
<h:form   id= "a ">
    <h:inputText   required= "false "   value= "#{user.name} "> </h:inputText> <br>
                  <h:commandButton   action= "success "> </h:commandButton>
    </h:form>
</f:view>

    </body>
</html>
-----------------------
faces-config.xml:
<?xml   version= "1.0 "   encoding= "UTF-8 "?>
<!DOCTYPE   faces-config   PUBLIC   "-//Sun   Microsystems,   Inc.//DTD   JavaServer   Faces   Config   1.1//EN "   "http://java.sun.com/dtd/web-facesconfig_1_1.dtd ">

<faces-config   >
<managed-bean>
<managed-bean-name> user </managed-bean-name>


<managed-bean-class> mypro.User </managed-bean-class>
<managed-bean-scope> session </managed-bean-scope>
</managed-bean>
<navigation-rule>
<from-view-id> /userinfo.jsp </from-view-id>
<navigation-case>
<from-outcome> success </from-outcome>
<to-view-id> /print.jsp </to-view-id>
</navigation-case> </navigation-rule> </faces-config>
----------------------------------
错误信息:
HTTP   Status   500   -  

--------------------------------------------

type   Exception   report

message  

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

exception  

org.apache.jasper.JasperException:   org.apache.jasper.JasperException:   /userinfo.jsp(31,3)   According   to   TLD   or   attribute   directive   in   tag   file,   attribute   value   does   not   accept   any   expressions
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:565)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:354)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)


root   cause  

org.apache.jasper.JasperException:   /userinfo.jsp(31,3)   According   to   TLD   or   attribute   directive   in   tag   file,   attribute   value   does   not   accept   any   expressions
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:406)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:147)
org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1128)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:818)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1507)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:837)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1507)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:837)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1507)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2392)
org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)


org.apache.jasper.compiler.Validator.validate(Validator.java:1679)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:178)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:314)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)


note   The   full   stack   trace   of   the   root   cause   is   available   in   the   Apache   Tomcat/6.0.2   logs.


--------------------------------------------

Apache   Tomcat/6.0.2

[解决办法]
我来接分
[解决办法]
看来6.0.2的bug不少啊。。。
[解决办法]
没用过6.0.2
我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.myexception.cn/java-web/317.html

热点排行