cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Piroumian, Konstantin" <KPiroum...@flagship.ru>
Subject Re: Reading a JSP file
Date Tue, 18 Dec 2001 09:05:56 GMT
> Thank you for sending the source.  However, after much struggling,
> I find I'm still not able to use it in a mounted directory.  I'm
> using Cocoon-2.0 and have done the following:
>
> * placed you source file in
> webapps/cocoon/WEB-INF/classes/org/apache/cocoon/reading
> * compiled the code so there is a JSPReader.class file
> * modified the sitemap.xmap in the mounted directory to
>   include
>
>   <map:readers default="resource">
>     <map:reader name="resource"
> src="org.apache.cocoon.reading.ResourceReader"/>
>     <map:reader name="jsp"
> src="org.apache.cocoon.reading.JSPReader"/>
>   </map:readers>
>
> and
>
>   <map:pipeline>
>     <map:match pattern="**.jsp">
>       <map:read type="jsp" src="{1}.jsp" mime-type="text/html"/>
>     </map:match>
>   </map>
>
> When I attempt to go to a JSP page, I get a 404 error.  Any idea
> what I might be doing wrong?  I'm tailing all the log files and
> it just gives

There can be problem with path to your JSP source file. JSPReader works
correctly only with paths starting with / and pointing to a destination from
the webapp context, so it won't work from sub- or mounted sitemaps. I hadn't
time to find the correct way of path resolving from a reader.
Try to add your sitemap directory like this:

   <map:pipeline>
     <map:match pattern="**.jsp">
       <map:read type="jsp" src="/mounted-dir/{1}.jsp"
mime-type="text/html"/>
     </map:match>
   </map>

This way it must work, but of course it's not the best way. Hope I'll have
time at the end of this week to look at this issue and try solve it. Also,
I'm going to add sample of usage and documentation for JSPReader.
Unfortunately, the project switched to using Struts and I have not much time
to deal with Cocoon now.

Regards,
    Konstantin

>
> 127.0.0.1 - - [15/Dec/2001:10:53:03 -0800] "GET
> /cocoon/intranet/apptracker.jsp HTTP/1.1" 404 645
>
> Which is not very helpful.
>
> Any help would be appreciated!
>
> Thanks!
>
> --
> Matt Ho
> Principal
> Indigo Egg, Inc.
> Providing VoiceXML Professional Services
>
>
>
> > -----Original Message-----
> > From: Piroumian, Konstantin [mailto:KPiroumian@flagship.ru]
> > Sent: Monday, December 10, 2001 12:51 AM
> > To: cocoon-users@xml.apache.org
> > Subject: Re: Reading a JSP file
> >
> >
> > Hi!
> >
> > JSPReader were added only to the C2.1-dev branch, cause it
> > seemed to me that nobobdy is interested in it and I didn't
> > post a patch for C2.0. The attached is the src of JSPReader
> > that I used with Cocoon 2.0 (a few weeks old version), hope
> > it will work with the release too.
> >
> > P.S. If anybody else is interested in JSPReader I'll improve
> > it and send a patch to C2.0 with samples and docs.
> >
> > Regards,
> >     Konstantin Piroumian
> >
> > ----- Original Message -----
> > From: "Matt Ho" <matt@indigoegg.com>
> > To: <cocoon-users@xml.apache.org>
> > Cc: "Rachel McConnell" <rachel@indigoegg.com>
> > Sent: Monday, December 10, 2001 12:12 AM
> > Subject: Reading a JSP file
> >
> >
> > > Ugh.  I've read through all the documentation I can find,
> > but I can't
> > > figure out how to get my submap to serve up JSP pages
> > natively (i.e.
> > > they don't output XML).
> > >
> > > I have the following configuration:
> > >
> > > * Redhat 7.2
> > > * Tomcat 4.0.1
> > > * Sun JDK 1.3.1
> > >
> > > When I place JSP files in the webapps/cocoon directory,
> > they work just
> > > fine.  When I create a submap
> > >
> > >   <map:pipeline>
> > >    <map:match pattern="intranet/**">
> > >     <map:mount uri-prefix="intranet" src="file:/home/intranet/"
> > > check-reload="yes"/>
> > >    </map:match>
> > >   </map:pipeline>
> > >
> > > The submap works and does every other mapping that it
> > should, but it
> > > will not display a plain JSP page.  The error that I get
> > back is 'The
> > > request resource is not available'.  The log files are not
> > providing
> > > me a clue either.
> > >
> > > I've tried a workaround without success.  I downloaded the
> > top of tree
> > > version which I noted had JSPReader.  I then JSPReader with the
> > > cocoon2 binary release and tried configuring it by hand via:
> > >
> > >    <map:reader name="jsp"
> > src="org.apache.cocoon.reading.JSPReader"/>
> > >
> > > No joy.
> > >
> > > Any help would be appreciated.
> > >
> > > Thanks!
> > >
> > > --
> > > Matt Ho
> > > Principal
> > > Indigo Egg, Inc.
> > > Providing VoiceXML Professional Services
> > >
> > >
> > >
> > >
> > ---------------------------------------------------------------------
> > > Please check that your question has not already been
> > answered in the
> > > FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> > >
> > > To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
> > > For additional commands, e-mail: <cocoon-users-help@xml.apache.org>
> > >
> >
> >
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail: <cocoon-users-help@xml.apache.org>
>

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message