解答例 - 実習課題1 - 4.ディレクティブ
(実習課題1)
以下のJSPページを作成し、どのようなエラーが出るか確かめなさい。
- 「autoFlush」属性で「false」を指定し、「buffer」属性で「none」を指定する。
解答例
<!-- flush.jsp --> <!-- TECHSCORE Java JSP 4章 実習課題1 --> <!-- Copyright (c) 2004 Four-Dimensional Data, Inc. --> <%@page contentType="text/html; charset=Windows-31J" autoFlush="false" buffer="none"%> <html> <head><title>JSP 4章 実習課題 1</title></head> <body> <h3>JSP 4章 実習課題 1</h3> </body> </html>
▼error.txt
出力される例外 ----------------ここから---------------- 2004-10-19 20:17:04 StandardWrapperValve[jsp]: サーブレット jsp のServlet.service()が例外を投げました org.apache.jasper.JasperException: /com/techscore/jsp/chapter4/exercise1/flush.jsp(0,0) jsp.error.page.badCombo at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:94) at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:428) at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:140) at org.apache.jasper.compiler.Validator$PageDirectiveVisitor.visit(Validator.java:242) at org.apache.jasper.compiler.Node$PageDirective.accept(Node.java:280) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:1028) at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:1070) at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:1076) at org.apache.jasper.compiler.Node$Root.accept(Node.java:232) at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:1028) at org.apache.jasper.compiler.Validator.validate(Validator.java:581) at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:230) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:369) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at EncodingFilter.doFilter(EncodingFilter.java:23) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) at java.lang.Thread.run(Thread.java:534) ----------------ここまで----------------