tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Percival Bragg <percivalbr...@yahoo.com>
Subject More info on custom tag problem
Date Sun, 23 Feb 2003 20:56:34 GMT
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=&quot;100%&quot;
cellspacing=&quot;0&quot; class=&quot;HeadBg&quot;
border=&quot;0&quot;>");
    out.append("<tr valign=&quot;top&quot;>");
    out.append("<td colspan=&quot;3&quot;
class=&quot;SiteLink&quot;
background=&quot;images/bars.gif&quot;
align=&quot;right&quot;>");
    out.append("<span
id=&quot;Banner_WelcomeMessage&quot;
style=&quot;color:#EEEEEE;&quot;></span>");
    out.append("<a href=&quot;index.html&quot;
class=&quot;SiteLink&quot;>Braggonline Home</a>");
    out.append("<span
class=&quot;Accent&quot;>|</span>");
    out.append("<a href=&quot;index.html&quot;
target=&quot;_blank&quot;
class=&quot;SiteLink&quot;>Site Map</a>");
		out.append("<span
class=&quot;Accent&quot;>|</span>");
		out.append("<a href=&quot;index.html&quot;
target=&quot;_blank&quot;class=&quot;SiteLink&quot;>Logoff</a>");
		out.append("&nbsp;&nbsp;</td></tr>");
    out.append("<tr><td width=&quot;10&quot;
rowspan=&quot;2&quot;>&nbsp;</td>");
    out.append("<td height=&quot;40&quot;>");
    out.append("<span id=&quot;Banner_siteName&quot;
class=&quot;SiteTitle&quot;>BraggOnline
Portal</span></td>");
    out.append("<td align=&quot;center&quot;
rowspan=&quot;2&quot;>&nbsp;</td></tr>");
    out.append("<tr><td>");
    out.append("<table id=&quot;Banner_tabs&quot;
class=&quot;OtherTabsBg&quot;
cellspacing=&quot;0&quot; border=&quot;0&quot;
style=&quot;border-collapse:collapse;&quot;><tr>");
		out.append("<td class=&quot;TabBg&quot;
style=&quot;border-width:1px;border-style:solid;height:25px;&quot;>");
    out.append("&nbsp;<span
class=&quot;SelectedTab&quot;>Home</span>&nbsp;</td>");
    out.append("<td
style=&quot;border-width:1px;border-style:solid;height:25px;&quot;>&nbsp;<a
href=&quot;http://www.ibuyspyportal.com/DesktopDefault.aspx?tabindex=1&tabid=2&quot;
class=&quot;OtherTabs&quot;>JSP</a></td>");
    out.append("<td
style=&quot;border-width:1px;border-style:solid;height:25px;&quot;>&nbsp;<a
href=&quot;http://www.ibuyspyportal.com/DesktopDefault.aspx?tabindex=2&tabid=3&quot;
class=&quot;OtherTabs&quot;>JavaBeans</a></td>");
    out.append("<td
style=&quot;border-width:1px;border-style:solid;height:25px;&quot;>&nbsp;<a
href=&quot;http://www.ibuyspyportal.com/DesktopDefault.aspx?tabindex=3&tabid=4&quot;
class=&quot;OtherTabs&quot;>Discussions</a></td>");
    out.append("<td
style=&quot;border-width:1px;border-style:solid;height:25px;&quot;>&nbsp;<a
href=&quot;http://www.ibuyspyportal.com/DesktopDefault.aspx?tabindex=4&tabid=5&quot;
class=&quot;OtherTabs&quot;>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">
                                    &nbsp;
                                </td>
                                <td id="LeftPane"
Visible="false" Width="170">&nbsp;
                                </td>
                                <td width="1">&nbsp;
                                </td>
                                <td id="ContentPane"
Visible="false" Width="*">&nbsp;
                                </td>
                                <td id="RightPane"
Visible="false" Width="230">&nbsp;
                                </td>
                                <td width="10">
                                    &nbsp;
                                </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: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message