4
回答
新手 javabean案例运行不出结果 求帮忙
利用AWS快速构建适用于生产的无服务器应用程序,免费试用12个月>>>   

严重: Exception starting filter struts2
java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
 at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:249)
 at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
 at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
 at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4363)
 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
 at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)
 at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889)
 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
 at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
 at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
 at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
 at org.apache.catalina.core.StandardService.start(StandardService.java:516)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
2011-10-23 17:46:36 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2011-10-23 17:46:36 org.apache.catalina.core.StandardContext start
严重: Context [/struts2] startup failed due to previous errors
2011-10-23 17:46:37 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2011-10-23 17:46:37 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2011-10-23 17:46:37 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/47  config=null
2011-10-23 17:46:37 org.apache.catalina.startup.Catalina start
信息: Server startup in 2015 ms
2011-10-23 17:46:45 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /beantext.jsp(16,6) Invalid standard action
 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:88)
 at org.apache.jasper.compiler.Parser.parseStandardAction(Parser.java:1174)
 at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1466)
 at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1675)
 at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1022)
 at org.apache.jasper.compiler.Parser.parseUseBean(Parser.java:978)
 at org.apache.jasper.compiler.Parser.parseStandardAction(Parser.java:1156)
 at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1466)
 at org.apache.jasper.compiler.Parser.parse(Parser.java:138)
 at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:216)
 at org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
 at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:154)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:315)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
 at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
 at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 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:233)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
 at java.lang.Thread.run(Thread.java:619)
2011-10-23 17:46:53 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /beantext.jsp(16,6) Invalid standard action
 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:88)
 at org.apache.jasper.compiler.Parser.parseStandardAction(Parser.java:1174)
 at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1466)
 at org.apache.jasper.compiler.Parser.parseBody(Parser.java:1675)
 at org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:1022)
 at org.apache.jasper.compiler.Parser.parseUseBean(Parser.java:978)
 at org.apache.jasper.compiler.Parser.parseStandardAction(Parser.java:1156)
 at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1466)
 at org.apache.jasper.compiler.Parser.parse(Parser.java:138)
 at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:216)
 at org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
 at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:154)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:315)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
 at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
 at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 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:233)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
 at java.lang.Thread.run(Thread.java:619)

 

 

代码:

bean代码:

package ch01;

public class simplebean {
 private String message="no message";
 public simplebean(){
  
 }
 public String getMessage() {
  return message;
 }
 public void setMessage(String message) {
  this.message = message;
 }
 
}

jsp代码:

<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
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>
    <title>text bean </title>

  </head>
  
  <body>
 <jsp:useBean id="text" class="ch01.simplebean" >
 <jsp:setproperty   name=" text" property="message" value="nihao"/>
 <h1>message:<I>
<jsp:getproperty name="text" property="message"/></I>
 </h1>
 </jsp:useBean>
  </body>
</html>
举报
小鸡快跑
发帖于6年前 4回/553阅
顶部