struts2标签做的页面无法显示
在MyEclipse9.1中使用struts2标签编写的页面,可是运行却报错,无法显示效果,求高手指教,源码及异常如下。
源码:<s:form action="Login">
<s:text name="userlogin" label="%{getText('user')}"></s:text>
<s:textfield name="username" label="%{getText('pass')}"></s:textfield>
<s:submit value="%{getText('login')}"></s:submit>
</s:form>
异常:严重:
Servlet.service() for servlet jsp threw exceptionorg.apache.jasper.JasperException: /loginPage.jsp(29,5) Attribute label invalid for tag text according to TLD
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:236)
at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1198)
at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:819)
at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1507)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:838)
at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1507)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2392)
at org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
at org.apache.jasper.compiler.Validator.validate(Validator.java:1737)
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:178)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
------解决方案--------------------struts2的s:text标签没有label属性,name就是显示的内容,一般国际化时用。
------解决方案----------------