Reputation: 143
I want to build a form using the Struts tag library.
web.xml file
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5">
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
index.jsp file
<%@taglib prefix="html" uri="http://struts.apache.org/tags-html"%>
<!DOCTYPE html>
<html:html>
<html:head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<html:title>JSP Page using Struts html tags</html:title>
</html:head>
<html:body>
<h1>Hello </h1>
</html:body>
</html:html>
Output page shows
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: /index.jsp(4,4) No tag "head" defined in tag library imported with prefix "html"
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:198)
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1182)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1415)
org.apache.jasper.compiler.Parser.parseBody(Parser.java:1623)
org.apache.jasper.compiler.Parser.parseOptionalBody(Parser.java:973)
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1241)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1415)
org.apache.jasper.compiler.Parser.parse(Parser.java:130)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:255)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:170)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:332)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.24 logs.
Upvotes: 0
Views: 252
Reputation: 160321
There's no <html:head>
tag.
More or less like the error states.
Next you'll find there's no <html:body>
tag either.
Upvotes: 2