The following are the current files and the error from
tomcat that I received in trying my first custom tag.
The following is the java class for the custom tag.
package com.braggonline.portal;
import java.io.*;
import javax.servlet.jsp.tagext.*;
import javax.servlet.jsp.*;
public class bannerTag extends TagSupport {
public int doEndTag() throws JspException {
StringBuffer out = new StringBuffer();
out.append("<table width="100%"
cellspacing="0" class="HeadBg"
border="0">");
out.append("<tr valign="top">");
out.append("<td colspan="3"
class="SiteLink"
background="images/bars.gif"
align="right">");
out.append("<span
id="Banner_WelcomeMessage"
style="color:#EEEEEE;"></span>");
out.append("<a href="index.html"
class="SiteLink">Braggonline Home</a>");
out.append("<span
class="Accent">|</span>");
out.append("<a href="index.html"
target="_blank"
class="SiteLink">Site Map</a>");
out.append("<span
class="Accent">|</span>");
out.append("<a href="index.html"
target="_blank"class="SiteLink">Logoff</a>");
out.append(" </td></tr>");
out.append("<tr><td width="10"
rowspan="2"> </td>");
out.append("<td height="40">");
out.append("<span id="Banner_siteName"
class="SiteTitle">BraggOnline
Portal</span></td>");
out.append("<td align="center"
rowspan="2"> </td></tr>");
out.append("<tr><td>");
out.append("<table id="Banner_tabs"
class="OtherTabsBg"
cellspacing="0" border="0"
style="border-collapse:collapse;"><tr>");
out.append("<td class="TabBg"
style="border-width:1px;border-style:solid;height:25px;">");
out.append(" <span
class="SelectedTab">Home</span> </td>");
out.append("<td
style="border-width:1px;border-style:solid;height:25px;"> <a
href="http://www.ibuyspyportal.com/DesktopDefault.aspx?tabindex=1&tabid=2"
class="OtherTabs">JSP</a></td>");
out.append("<td
style="border-width:1px;border-style:solid;height:25px;"> <a
href="http://www.ibuyspyportal.com/DesktopDefault.aspx?tabindex=2&tabid=3"
class="OtherTabs">JavaBeans</a></td>");
out.append("<td
style="border-width:1px;border-style:solid;height:25px;"> <a
href="http://www.ibuyspyportal.com/DesktopDefault.aspx?tabindex=3&tabid=4"
class="OtherTabs">Discussions</a></td>");
out.append("<td
style="border-width:1px;border-style:solid;height:25px;"> <a
href="http://www.ibuyspyportal.com/DesktopDefault.aspx?tabindex=4&tabid=5"
class="OtherTabs">About the
Portal</a></td>");
out.append("</tr></table>");
try {
pageContext.getOut().print("Got Here");
} catch (Exception e) {
throw new JspException(e.toString());
}
return EVAL_PAGE;
}
}
The following is the TLD file.
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE taglib PUBLIC
"-//Sun
Microsystems, Inc.//DTD JSP Tag
Library 1.2//EN"
"http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
<taglib>
<tlib-version>1.0</tlib-version>
<jsp-version>1.2</jsp-version>
<short-name>PortalTags</short-name>
<description>Tags for dynamic creation of portal
pages.</description>
<tag>
<name>banner</name>
<tag-class>com.braggonline.portal.bannerTag</tag-class>
</tag>
</taglib>
The following is the JSP file
<%@ taglib uri="WEB-INF/portalTags.tld"
prefix="portal" %>
<%
/* The DesktopDefault.jsp page is used to load and
populate each Portal View. It accomplishes
this by reading the layout configuration of the
portal from the Portal Configuration
system, and then using this information to
dynamically instantiate portal modules
(each implemented as a custom tag), and then inject
them into the page. */
/* This scriplet capture the request parameters
passed and uses them to
determine how to process the page. */
String tabIndex = request.getParameter("tabIndex");
String tabId = request.getParameter("tabId");
if (tabIndex == null){
session.setAttribute("tabIndex", "0");
}else{
session.setAttribute("tabIndex", tabIndex);
}
if (tabId == null){
session.setAttribute("tabId", "0");
}else{
session.setAttribute("tabId", tabId);
}
%>
<html>
<head>
<title>BraggOnline Portal</title>
<link href="braggonline.css" type="text/css"
rel="stylesheet" />
</head>
<body leftmargin="0" bottommargin="0"
rightmargin="0" topmargin="0" marginheight="0"
marginwidth="0">
<form>
<table width="100%" cellspacing="0"
cellpadding="0" border="0">
<tr valign="top">
<td colspan="2">
<portal:banner/>
</td>
</tr>
<tr>
<td>
<br>
<table width="100%"
cellspacing="0" cellpadding="4" border="0">
<tr height="*"
valign="top">
<td width="5">
</td>
<td id="LeftPane"
Visible="false" Width="170">
</td>
<td width="1">
</td>
<td id="ContentPane"
Visible="false" Width="*">
</td>
<td id="RightPane"
Visible="false" Width="230">
</td>
<td width="10">
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
and the follwing is the error log.
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:
/braggonline/DesktopDefault.jsp(39,24) Unable to load
class banner
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:219)
at
org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:717)
at
org.apache.jasper.compiler.Parser.parseElements(Parser.java:809)
at
org.apache.jasper.compiler.Parser.parse(Parser.java:122)
at
org.apache.jasper.compiler.ParserController.parse(ParserController.java:199)
at
org.apache.jasper.compiler.ParserController.parse(ParserController.java:153)
at
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:223)
at
org.apache.jasper.compiler.Compiler.compile(Compiler.java:351)
at
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:474)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:184)
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
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
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:2415)
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:170)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
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:223)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
at java.lang.Thread.run(Thread.java:536)
--------------------------------------------------------------------------------
Apache Tomcat/4.1.18
The url for invoking the JSP page:
http://localhost/braggonline/DesktopDefault.jsp
braggonline is a web application under
ROOT/braggonline.
The class is in
ROOT/braggonline/WEB-INF/classes/com/braggonline/portal
the TLD file is in ROOT/braggonline/WEB-INF
when the JSP is invoked tomcat gives the error
message.
The path to servlet.jar is defined in the CLASSPATH
variable.
Any help would be appreciated.
__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]