permaculture playing cards*
The moose likes Servlets and the fly likes exception handling in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "exception handling in jsp" Watch "exception handling in jsp" New topic
Author

exception handling in jsp

shwetha raghavachar
Greenhorn

Joined: Aug 01, 2011
Posts: 14
Hi,

I checked here all but still i dint get idea why am getting error...
can anyone tell me the reason why am getting error...
Here is the code for which am not able to resolve...

<%@page
import="java.util.*,com.serv.FaqCategories" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Java FAQ Welcome Page</title>
</head>
<body>

<h1>Java FAQ Welcome Page</h1>
Welcome to the Java FAQ

<%! FaqCategories faq=new FaqCategories();%>
Click link below for answers to the given topic.
<%
Iterator categories=faq.getAllCategories();
while(categories.hasNext())
{
String category=(String)categories.next();
%>
<p><a href="<%=replaceUnderscore(category) %>.jsp"><%=category %></a></p>
<%} %>
<%@include file="/WEB-INF/footer.jspf" %>


</body>
</html>
<%!
public String replaceUnderscore(String s)
{
return s.replace(' ','_');
}
%>[/code]





<%@page isErrorPage="true" %>
<html>
<head>
<title>Error Page.</title>
</head>
<body bgcolor="blue">
<font size="16" color="white">Your page generated an error:"<br/>
Exception:<br/></font>
<%= exception.toString() %>
</body></html>[/code]

Error message is

17:59:33,599 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/SampleJSP].[jsp]] Servlet.service() for servlet jsp threw exception: org.apache.jasper.JasperException: /errorpage.jsp(12,1) Unterminated <%@ include tag
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) [:6.0.0.Final]
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) [:6.0.0.Final]
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:132) [:6.0.0.Final]
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:476) [:6.0.0.Final]
at org.apache.jasper.compiler.Parser.parseFileDirectives(Parser.java:1748) [:6.0.0.Final]
at org.apache.jasper.compiler.Parser.parse(Parser.java:127) [:6.0.0.Final]
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:255) [:6.0.0.Final]
at org.apache.jasper.compiler.ParserController.parseDirectives(ParserController.java:120) [:6.0.0.Final]
at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:191) [:6.0.0.Final]
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:358) [:6.0.0.Final]
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:338) [:6.0.0.Final]
at org.apache.jasper.compiler.Compiler.compile(Compiler.java:325) [:6.0.0.Final]
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:607) [:6.0.0.Final]
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:312) [:6.0.0.Final]
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326) [:6.0.0.Final]
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253) [:6.0.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [:1.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:734) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:541) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:479) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:407) [:6.0.0.Final]
at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:706) [:6.0.0.Final]
at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:677) [:6.0.0.Final]
at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:818) [:6.0.0.Final]
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791) [:6.0.0.Final]
at org.apache.jsp.Threading_jsp._jspService(Threading_jsp.java:76)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) [:6.0.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [:1.0.0.Final]
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369) [:6.0.0.Final]
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326) [:6.0.0.Final]
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253) [:6.0.0.Final]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [:1.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.0.0.Final]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [:6.0.0.Final]
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.0.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.0.0.Final]
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.0.0.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [:6.0.0.Final]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.0.0.Final]
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.0.0.Final]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.0.0.Final]
at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.0.0.Final]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.0.0.Final]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:6.0.0.Final]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) [:6.0.0.Final]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.0.0.Final]
at java.lang.Thread.run(Unknown Source) [:1.6.0_20]


Thanks,
shwetha
Sujata Samal
Greenhorn

Joined: Jan 29, 2008
Posts: 20
Try <%@ page isErrorPage="true" %> (space between @ and page)

-Sujata
shwetha raghavachar
Greenhorn

Joined: Aug 01, 2011
Posts: 14
oh ok thanks for reply its working now.

Thanks,
shwetha
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: exception handling in jsp
 
Similar Threads
Servlet.service() for servlet jsp threw exception: java.lang.NullPointerException
No collection Found
Struts Validation problem
HTTP Status 404 - /Ch03/
exception handling