[opencms-dev] exception
Nicole Wollgast
nicole.wollgast at sourcepark.de
Fri Dec 19 13:41:02 CET 2003
Hey,
what does this mean?
Can you tell me what i have to look for if I want to put my written jsp
- file (with normal jsp tags) in opencms! Do I need to extend some classes?
My jsp file is a template and looks like this:
<%@ page session="false" %>
<%@page contentType="text/html"%>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
<cms:template element="head">
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title><cms:property name="title" escapeHtml="true" /></title>
<meta HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html;
CHARSET=<cms:property name="content-encoding" default="ISO-8859-1" />">
<link type="text/css" rel="stylesheet"
href="<cms:link>/sourcepark_projekt/modules/resources/style.css</cms:link>">
<%--Importieren von Java-Klassenbibliotheken--%>
<%@ page import="java.util.*,com.opencms.flex.jsp.*" %>
<%@ page import="java.io.*,com.opencms.flex.jsp.*"%>
<%@ page import="java.text.*,com.opencms.flex.jsp.*"%>
<%--Importieren der Java - Klassen--%>
<%@ page import="de.sourcepark.ObjektDatei,com.opencms.flex.jsp.*"%>
<%@ page import="de.sourcepark.FirmenEintrag,com.opencms.flex.jsp.*"%>
<%@ page import="de.sourcepark.Referenzen,com.opencms.flex.jsp.*"%>
<%@ page import="de.sourcepark.Stream,com.opencms.flex.jsp.*"%>
<%!
//Java-Klasse zur Serialisierung und Derialisierung
final int MAX_ROWS = 5;
final int MAX_COLUMNS = 3;
final String[] COLUMN_WIDTH = {"407","63","422"};
%>
</head>
<body>
<table border="1" cellspacing="0" cellpadding="0"
style="border-collapse: collapse; mso-padding-alt: 0cm 3.5pt 0cm 3.5pt"
width="800">
<tr>
<td width="407" valign="top" style="padding-left: 3.5pt;
padding-right: 3.5pt; padding-top: 0cm; padding-bottom: 0cm">
<p class="headline"><b>KUNDEN
UND REFERENZPROJEKTE</b></p>
<p class="MsoBodyText"> </td>
<td width="63" valign="top" style="padding-left: 3.5pt;
padding-right: 3.5pt; padding-top: 0cm; padding-bottom: 0cm">
<p class="MsoBodyText"></td>
<td width="422" valign="top" style="padding-left: 3.5pt;
padding-right: 3.5pt; padding-top: 0cm; padding-bottom: 0cm">
<p class="MsoBodyText" align="right"><a
href="referenzen_02_seite.htm">weiter
>></a>
</td>
</tr>
<%
//Referendatei lesen
//Auslesen des HTML - Formulars
Referenzen eineReferenz = Stream.leseObjekt();
String firmenName = request.getParameter("firmenname");
String eintrag = request.getParameter("eintrag");
String button = request.getParameter("submit");
String comboNameFirma = request.getParameter("comboFirma");
String comboNameEintrag = request.getParameter("comboEintrag");
out.println("Firmenname:"+firmenName);
out.println("Eintrag: "+eintrag);
//*****Abfragen*******************************************************************
//Nachträglich mit switch realisieren!!!!!!!!!!!!!!!!!!!!!!
if(button.equals("Hinzufügen")){
//Prüfen, ob Daten eingegeben wurden
if(firmenName !=null && firmenName.length()> 0 &&
eintrag.length() > 0){
FirmenEintrag einEintrag = new FirmenEintrag(firmenName,eintrag);
eineReferenz.anfuegen(einEintrag);
//Speichern der Referenz
}
//out.println(eineReferenz.getAnzahlEintraege());
// eineReferenz.sortiere();
}
else if(button.equals("Ändern")){
if(firmenName!=null&&comboNameFirma!=null)
for(int i=0;i<eineReferenz.getAnzahlEintraege();i++)
if(comboNameFirma.equals(eineReferenz.getEintrag(i).getFirmenName()))
eineReferenz.getEintrag(i).setFirmenName(firmenName);
}
else if(button.equals("Löschen")){
if(comboNameFirma!=null&&(!(comboNameFirma.equals("default"))))
eineReferenz.getEintrag(Integer.parseInt(comboNameFirma)).firmenNameLoeschen();
if(comboNameEintrag!=null&&(!(comboNameEintrag.equals("default"))))
eineReferenz.getEintrag(Integer.parseInt(comboNameEintrag)).eintragLoeschen();
//LÖSCHEN VON BEIDEN FELDERN ->BLANK IN DER TABELLE -->ZU ÄNDERN
//
//eineReferenz.vectorEintragLoeschen(Integer.parseInt(comboNameFirma));
}
Stream.schreibeObjekt(eineReferenz);
//************Tabelle
generieren****************************************************************
String idHead="";
String idContent="";
String idLinks="";
out.println("<table border='1' cellspacing='0' cellpadding='0'
style='border-collapse: collapse; mso-padding-alt: 0cm 3.5pt 0cm 3.5pt'
width='800'>");
String blank=" ";
for(int zeile = 0; zeile < MAX_ROWS; zeile++)
{
idHead = ""+zeile;
idContent = ""+zeile;
out.println("<tr>");
for(int spalte = 0; spalte < MAX_COLUMNS; spalte++)
{
idHead+=""+spalte;
idContent+=""+spalte+"1";
out.println("<td width="+COLUMN_WIDTH[spalte]+" valign='top'
style='padding-left: 3.5pt; padding-right: 3.5pt; padding-top: 0cm;
padding-bottom: 0cm'><p><b id="+idHead+"> </b></p><p
id="+idContent+"> </p></td>");
idHead = ""+zeile;
idContent = ""+zeile;
}
out.println("</tr>");
}
out.println("</table>");
int zeile = 0;
int spalte =0;
for(int i=0;i<eineReferenz.getAnzahlEintraege();i++){
FirmenEintrag einEintrag = eineReferenz.getEintrag(i);
if(zeile==MAX_ROWS){
zeile=0;
spalte+=2;
}
idHead = ""+zeile;
idContent = ""+zeile;
idHead+=""+spalte;
idContent+=""+spalte+"1";
out.println("<script type='text/javascript'>");
out.println("var head =
document.createTextNode(\""+einEintrag.getFirmenName()+"\");");
out.println("var inhalt =
document.createTextNode(\""+einEintrag.getEintrag()+"\");");
out.println("document.getElementById(\""+idHead+"\").firstChild.appendData(head.nodeValue);");
out.println("document.getElementById(\""+idContent+"\").firstChild.appendData(inhalt.nodeValue);");
out.println("</script>");
zeile++;
idHead = ""+zeile;
idContent = ""+zeile;
}
//**************************************************************************************************************
%>
<!-- Main page body starts here -->
</cms:template>
<cms:template element="body">
<cms:include element="body" />
</cms:template>
<cms:template element="foot">
<!-- Main page body ends here -->
</body>
</html>
</cms:template>
[jsptemplate] ??? com.opencms.core.CmsException: 0 Unknown exception.
Detailed error: [CmsJspTemplate] Error while reading JSP
/system/modules/com.alkacon.documentation.howto-template/jsptemplates/tabelle2
com.opencms.core.CmsException: 28 Error while launching template class.
Detailed error: Error in CmsJspLoader.loadTemplate() while loading
/system/modules/com.alkacon.documentation.howto-template/jsptemplates/tabelle2
javax.servlet.ServletException: Resource loader error in file
'/system/modules/com.alkacon.documentation.howto-template/jsptemplates/tabelle2'
Root cause: org.apache.jasper.JasperException at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at
More information about the opencms-dev
mailing list