Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

eror in the jsp custom tags  RSS feed

 
naresh govindaswmay
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I have error in my program please anybody can solve that one.I have attached that code also..

********Jsp file********
<%@ taglib prefix="C" tagdir="/WEB-INF/tags"%>
<%@ tag body-content="tagdependent" %>
<C:Header subTitle="this is the content of tag attribute"/>

<html>
<body>
<strong>This is the example of custom tag</strong>
</body>
</html>

********This is the .tag file *********

<html>
<body>
<strong>This is the first Program for CustomTagDevelopment </Strong>
<%@ taglib name="subTitle" required="true",rtexprvalue="true"%>
<strong > ${subTitle} </strong>
</body>
</html>

**** This is the error message i have got in the browser *********

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: /HeaderTag.jsp(2,7) <%@ tag directive can only be used in a tag file
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:134)
org.apache.jasper.compiler.Parser.parseDirective(Parser.java:487)
org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539)
org.apache.jasper.compiler.Parser.parse(Parser.java:126)
org.apache.jasper.compiler.ParserController.doParse(ParserController.java:220)
org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)

note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.
Apache Tomcat/5.0.28
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
/HeaderTag.jsp(2,7) <%@ tag directive can only be used in a tag file

I think it says it all. Why are you using the tag directive in your jsp file ?
 
naresh govindaswmay
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I am checking the tagdir in my jsp page.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am checking the tagdir in my jsp page

?? Sorry, I don't understand. You don't need (and can't use) the tag directive in your jsp file. Leaving the taglib directive is good enough.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!