Antw: Re: AW: [opencms-dev] Sitemap Module

Stephan Löffler stephanloeffler at gmx.de
Thu Sep 4 10:26:01 CEST 2003


Hi Björn,

This only looks like syntax errors. They probably occured because you
used copy and paste for the whole jsp.
For the first 3 errors the following should do the trick:

Just move the     \n");    part up one line, so that it is in one line. The
problem
seems to be that this linefeed is not appropriate for the servlet engine. So
just
remove it. 
out.write("<a href=\"" + target + "\">" + nav.getNavText() + "</a>
\n");

Should look like this then:
out.write("<a href ..... + nav.getNavText() + "</a>\n");

This should solve the first three errors for sure like I just said. It will
most likely also solve the fourth error, because this seems like a follow
up.

So actually just move that   \n">;   up and your problem should be solved.
If I didn't express myself clear enough, feel free to email me in German 
and I will reply to you in German.

Cheers 

Stephan

As for the fourth error 

> Hello,
> 
> I not a programmer but I would like to use a sitemap at my site.
> 
> I tried to enter the code below into a new jsp-page. Unfortunately I 
> receive a error message like this:
> 
> javax.servlet.ServletException: Resource loader error in file
> '/sitemap.jsp
> '
> 
> Root cause:
> org.apache.jasper.JasperException: Unable to compile class for JSP
> 
> An error occurred at line: -1 in the jsp file: null
> 
> Generated servlet error:
>     [javac] Since fork is true, ignoring compiler setting.
>     [javac] Compiling 1 source file
>     [javac] Since fork is true, ignoring compiler setting.
>     [javac]
> /var/jakarta-tomcat-4.1.24/work/Standalone/localhost/intra/WEB-
> INF/jsp/offline/sitemap_jsp_jsp.java:40: unclosed string literal
>     [javac]         out.write("<a href=\"" + target + "\">" + nav.getNavT
> ext() + "</a>
>     [javac]                                                               
>       ^
>     [javac]
> /var/jakarta-tomcat-4.1.24/work/Standalone/localhost/intra/WEB-
> INF/jsp/offline/sitemap_jsp_jsp.java:41: illegal character: \92
>     [javac] \n");
>     [javac] ^
>     [javac]
> /var/jakarta-tomcat-4.1.24/work/Standalone/localhost/intra/WEB-
> INF/jsp/offline/sitemap_jsp_jsp.java:41: unclosed string literal
>     [javac] \n");
>     [javac]   ^
>     [javac]
> /var/jakarta-tomcat-4.1.24/work/Standalone/localhost/intra/WEB-
> INF/jsp/offline/sitemap_jsp_jsp.java:43: ')' expected
>     [javac]         desc = nav.getDescription();
>     [javac]                                    ^
>     [javac] 4 errors
> 
> 
> 
> 	at org.apache.jasper.compiler.DefaultErrorHandler.javacError(Defaul
> tErrorHandler.java:130)
> 	at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispa
> tcher.java:293)
> 	at org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:
> 353)
> 	at org.apache.jasper.compiler.Compiler.compile(Compiler.java:370)
> 	at org.apache.jasper.JspCompilationContext.compile(JspCompilationCo
> ntext.java:473)
> 	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWr
> apper.java:190)
> 	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.j
> ava: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.ApplicationDispatcher.invoke(Applicatio
> nDispatcher.java:684)
> 	at org.apache.catalina.core.ApplicationDispatcher.doInclude(Applica
> tionDispatcher.java:575)
> 	at org.apache.catalina.core.ApplicationDispatcher.include(Applicati
> onDispatcher.java:498)
> 	at com.opencms.flex.cache.CmsFlexRequestDispatcher.include(CmsFlexR
> equestDispatcher.java:180)
> 	at com.opencms.flex.CmsJspLoader.service(CmsJspLoader.java:955)
> 	at com.opencms.flex.cache.CmsFlexRequestDispatcher.include(CmsFlexR
> equestDispatcher.java:268)
> 	at com.opencms.flex.CmsJspLoader.load(CmsJspLoader.java:567)
> 	at com.opencms.flex.CmsJspLoader.initlaunch(CmsJspLoader.java:235)
> 	at com.opencms.core.OpenCms.showResource(OpenCms.java:956)
> 	at com.opencms.core.OpenCmsHttpServlet.doGet(OpenCmsHttpServlet.jav
> a:310)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> 	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(Applica
> tionFilterChain.java:193)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWra
> pperValve.java:256)
> 	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveC
> ontext.invokeNext(StandardPipeline.java:643)
> 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipelin
> e.java:480)
> 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java
> :995)
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardCon
> textValve.java:191)
> 	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveC
> ontext.invokeNext(StandardPipeline.java:643)
> 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipelin
> e.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(StandardHostVa
> lve.java:180)
> 	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveC
> ontext.invokeNext(StandardPipeline.java:643)
> 	at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDisp
> atcherValve.java:171)
> 	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveC
> ontext.invokeNext(StandardPipeline.java:641)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportVa
> lve.java:172)
> 	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveC
> ontext.invokeNext(StandardPipeline.java:641)
> 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipelin
> e.java:480)
> 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java
> :995)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngi
> neValve.java:174)
> 	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveC
> ontext.invokeNext(StandardPipeline.java:643)
> 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipelin
> e.java:480)
> 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java
> :995)
> 	at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.ja
> va:223)
> 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor
> .java:594)
> 	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.
> processConnection(Http11Protocol.java:392)
> 	at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint
> .java:565)
> 	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(Th
> readPool.java:619)
> 	at java.lang.Thread.run(Thread.java:536)
> 
> --------------- End of root cause.
> 
> 	at com.opencms.flex.CmsJspLoader.service(CmsJspLoader.java:962)
> 	at com.opencms.flex.cache.CmsFlexRequestDispatcher.include(CmsFlexR
> equestDispatcher.java:268)
> 	at com.opencms.flex.CmsJspLoader.load(CmsJspLoader.java:567)
> 	at com.opencms.flex.CmsJspLoader.initlaunch(CmsJspLoader.java:235)
> 	at com.opencms.core.OpenCms.showResource(OpenCms.java:956)
> 	at com.opencms.core.OpenCmsHttpServlet.doGet(OpenCmsHttpServlet.jav
> a:310)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> 	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(Applica
> tionFilterChain.java:193)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWra
> pperValve.java:256)
> 	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveC
> ontext.invokeNext(StandardPipeline.java:643)
> 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipelin
> e.java:480)
> 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java
> :995)
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardCon
> textValve.java:191)
> 	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveC
> ontext.invokeNext(StandardPipeline.java:643)
> 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipelin
> e.java:480)
> 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java
> :995)tardPipeline.java:643)
> 	at 
> 	at org.apache.catalina.core.StandardContext.invoke(StandardContext.
> java:2415)
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostVa
> lve.java:180)
> 	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveC
> ontext.invokeNext(StandardPipeline.java:643)
> 	at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDisp
> atcherValve.java:171)
> 	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveC
> ontext.invokeNext(StandardPipeline.java:641)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportVa
> lve.java:172)
> 	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveC
> ontext.invokeNext(StandardPipeline.java:641)
> 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipelin
> e.java:480)
> 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java
> :995)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngi
> neValve.java:174)
> 	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveC
> ontext.invokeNext(StandardPipeline.java:643)
> 	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipelin
> e.java:480)
> 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java
> :995)
> 	at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.ja
> va:223)
> 	at org.apache.coyote.http11.Http11Processor.process(Http11Processor
> .java:594)
> 	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.
> processConnection(Http11Protocol.java:392)
> 	at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint
> .java:565)
> 	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(Th
> readPool.java:619)
> 	at java.lang.Thread.run(Thread.java:536)
> 
> Does anyone know what to do?
> 
> Thanks in advance
> Björn
> 
> >>> mmihaili at csc.com.au 25.08.2003 03:48:36 >>>
> Give the following element a go (obviously the presentation can be
> improved) ...
> 
> <%@ page session="false" %>
> <%@ page import="com.opencms.flex.jsp.*,com.opencms.file.*,java.util.*" 
> %>
> <%!
> public void buildSiteMap(com.opencms.flex.jsp.CmsJspActionElement cms,
> String uri, java.io.Writer out) throws Exception {
> 
>   String desc;
>   ArrayList navList = cms.getNavigation().getNavigationForFolder(uri);
> 
>   if (navList.size() > 0) {
> 
>     out.write("<ul>\n");
> 
>     Iterator navItem = navList.iterator();
>     CmsJspNavElement nav;
>     String target;
>     while (navItem.hasNext()) {
>       nav = (CmsJspNavElement) navItem.next();
>       if (nav != null) {
>         target = nav.getResourceName();
> 
>         out.write("<li>");
> 
>         if (nav.isFolderLink()) {
>            target = cms.link(target + "index.html");
>         } else {
>           target = cms.link(target);
>         }
> 
>         out.write("<a href=\"" + target + "\">" + nav.getNavText() + 
> "</a>
> \n");
> 
>         desc = nav.getDescription();
>         if (desc != null) out.write("  " + desc);
> 
>         if (nav.isFolderLink()) {
>           buildSiteMap(cms, nav.getResourceName(), out);
>         }
> 
>       }
>     }
> 
>     out.write("</ul>\n");
> 
>   }
> }
> %>
> 
> <%
>   com.opencms.flex.jsp.CmsJspActionElement cms =
>       new com.opencms.flex.jsp.CmsJspActionElement(pageContext, request,
> response);
> 
>   String uri = "index.html";
> 
>   buildSiteMap(cms, uri, out);
> %>
> 
> Later,
> Moris Mihailidis
> __________________________________________________
> CSC
> EBS-BSS Web Services e-Business South
> 58 Queensbridge St, Southbank, VIC 3006, Australia
> Ph: +61-3-8695-1527    Fax:+61-3-8695-1540
> Email: mmihaili at csc.com.au 
>
---------------------------------------------------------------------------
> -------------
> 
> This is a PRIVATE message. If you are not the intended recipient, please
> delete without copying and kindly advise us by e-mail of the mistake in
> delivery. NOTE: Regardless of content, this e-mail shall not operate to
> bind CSC to any order or other contract unless pursuant to explicit 
> written
> agreement or government initiative expressly permitting the use of e-mail
> for such purpose.
>
---------------------------------------------------------------------------
> -------------
> 
> 
> 
> 
>                                                                           
>                                                                
>                       "Joachim Arrasz"                                    
>                                                                
>                       <info at arrasz.de>           To:     
> <opencms-dev at open
> cms.org>                                                       
>                       Sent by:                   cc:                      
>                                                                
>                       opencms-dev-admin@         Subject: Re: AW: 
> [opencms-dev] Sitemap Module                                            
>                       opencms.org                                         
>                                                                
>                                                                           
>                                                                
>                                                                           
>                                                                
>                       24/08/2003 01:17                                    
>                                                                
>                       AM                                                  
>                                                                
>                       Please respond to                                   
>                                                                
>                       opencms-dev                                         
>                                                                
>                                                                           
>                                                                
>                                                                           
>                                                                
> 
> 
> 
> 
> Hehe Mario,
> 
> this is the code, which creates the sitemap :-)
> 
> Kind Regards
> 
> Achim
> --
> Questions about OpenCMS?
> --> www.opencms-forum.de 
> 
> 
> > Mario Wallnöfer>
> > Hi Achim,
> >
> > thanks a lot for your help. but i think your example is more a
> > breadcrumb navigation.
> >
> > what i need is a page, where automatically the whole website is
> > displayed(with links)
> > like the content in your Sitemap page.
> >
> > mario
> >
> > -----Ursprüngliche Nachricht-----
> > Von: opencms-dev-admin at opencms.org 
> > [mailto:opencms-dev-admin at opencms.org]Im Auftrag von Joachim Arrasz
> > Gesendet: Samstag, 23. August 2003 12:41
> > An: opencms-dev at opencms.org 
> > Betreff: Re: [opencms-dev] Sitemap Module
> >
> >
> > Hi Mario,
> >
> > i did this with just one jsp. I`m not sure if this works for you but
> > have a look:
> > <%@ page import="java.util.*,com.opencms.flex.jsp.*" %>
> > <%@ page import="com.opencms.file.*" %>
> > <%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
> >
> > <%
> >
> > // Create a JSP action element
> > CmsJspActionElement cms = new CmsJspActionElement(pageContext, 
> request,
> > response);CmsObject oCms = cms.getCmsObject();
> > String filename = oCms.getRequestContext().getUri();
> >
> > String sMainNavPath = null;
> > String sAbsolutePath = null;
> > final String sServletPath =
> > oCms.getRequestContext().getRequest().getServletUrl();out.print("<a
> > href=\"" + cms.link("/synyx/sitemap.jsp") +"\"
> > class=\"Kategorie\">Sitemap:</a>  ");out.print("<a href=\""
>  +
> > cms.link("/synyx/index.jsp") +"\">Home</a> ");
> > String sCurrentFolderName =
> > oCms.getRequestContext().currentFolder().getName();out.print(">
>  <a
> > href=\"" +
> > cms.link(cms.getRequestContext().currentFolder().getAbsolutePath())
> > +"\">" + oCms.getRequestContext().currentFolder().getName() +
> >          "</a> ");%>
> >
> > The output you can see on
> >
> > www.synyx.de/opencms/opencms/synyx/ 
> >
> > then just click on sitemap ...
> >
> > Hope this helps
> >
> > --
> > Questions about OpenCMS?
> > --> www.opencms-forum.de 
> >
> >
> >> Mario Wallnofer>
> >> Did anyone develop something like a Sitemap Module ??
> >>
> >>
> >> Mario
> >> _______________________________________________
> >> This mail is send to you from the opencms-dev mailing list
> >> To change your list options, or to unsubscribe from the list, please
> >> visit http://mail.opencms.org/mailman/listinfo/opencms-dev 
> >
> >
> >
> > _______________________________________________
> > This mail is send to you from the opencms-dev mailing list
> > To change your list options, or to unsubscribe from the list, please
> > visit http://mail.opencms.org/mailman/listinfo/opencms-dev 
> >
> > _______________________________________________
> > This mail is send to you from the opencms-dev mailing list
> > To change your list options, or to unsubscribe from the list, please
> > visit http://mail.opencms.org/mailman/listinfo/opencms-dev 
> 
> 
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev 
> 
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev
> 

-- 
--------------------------------
Stephan Loeffler
Heinrich v. Kleist Str. 38
95447 Bayreuth 
Tel.: 0921-5072665
Cell.:0179-6994085
-------------------------------

COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
--------------------------------------------------
1. GMX TopMail - Platz 1 und Testsieger!
2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
3. Arcor - 4. web.de - 5. T-Online - 6. freenet.de - 7. daybyday - 8. e-Post




More information about the opencms-dev mailing list