Hi,
(I did read your message, but thought that "remove arguments" meant remove
the "args" that was in main(String[] args)" :  I've got the point now it
must be absolutly identical -empty- to the call)

The code did compile in javac, but not in cocoon2.0b2 : it said:
"Exception java.io.IOException must be caught, or it must be declared in the
throws clause of this method"

I spent the day in exceptions tutorials and ended up with:


class make_xsl {
   public void main() {
 try {
 FileReader entree = new FileReader("a1.html");
  FileWriter sortie = new FileWriter("output.txt");
 int c;
 while ( (c = entree.read()) != -1 )
sortie.write(c);
sortie.close();
entree.close();
       } catch (FileNotFoundException e) {
           System.err.println("CheckedIODemo: " + e);
           System.exit(-1);
       } catch (java.io.IOException e) {
           System.err.println("CheckedIODemo: " + e);
           System.exit(-1);
 } catch (NoSuchMethodError e) {
           System.err.println("CheckedIODemo: " + e);
           System.exit(-1);
 } catch (Exception e) {
           System.err.println("CheckedIODemo: " + e);
           System.exit(-1);
       }
     }
}


PROBLEM:
-it only works if a1.html (the input file) is in Tomcat/bin
-it makes cocoon and tomcat go down (404 for all pages in localhost, even
Tomcat welcome page) if there is no a1.html in Tomcat/bin or if I try a url
http://localhost/cocoon/a1.html to get a1.html from an xsp generation.

I guess I'm not a java master yet.
Thanks for your help.

Cib

France, Bordeaux, xml and gay pride.

----- Original Message -----
From: "Christian Haul" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "cib" <[EMAIL PROTECTED]>
Sent: Saturday, September 22, 2001 10:03 AM
Subject: Re: abstract class


> Cib,
>
> I'd really appreciate it if you'd care to read me responses and don't
> post the same question over and over.
>
> If you change your code the code as indicated it compiles OK.
>
> On 22.Sep.2001 -- 04:42 AM, cib wrote:
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> >
> > <xsp:page
> >           language="java"
> >           xmlns:xsp="http://apache.org/xsp";
> >           xmlns:esql="http://apache.org/cocoon/SQL/v2";>
> >
> > <xsp:structure>
> >   <xsp:include>java.io.*</xsp:include>
> > </xsp:structure>
> >
> > <xsp:logic>
> > class make_xsl {
>               public void main(        ) throws IOException {
> // before:    public void main(String[]) throws IOException {
>
> >  FileReader entree = new
> > FileReader(("http//:localhost/cocoon/test/make.xsl"));
> >   FileWriter sortie = new FileWriter("output.txt");
> >  int c;
> >  while ( (c = entree.read()) != -1 )
> > sortie.write(c);
> > sortie.close();
> > entree.close();
> >      }
> > }
> > </xsp:logic>
> >
> >   <page>
> >
> > <xsp:logic>
> >     make_xsl anObject = new make_xsl();
> >     anObject.main();
> > </xsp:logic>
> >
> >
> > If you see this, it works.
> >
> >   </page>
> > </xsp:page>
>
> Chris.
>
> --
> C h r i s t i a n       H a u l
> [EMAIL PROTECTED]
>     fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08
>
> ---------------------------------------------------------------------
> 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: <[EMAIL PROTECTED]>
> For additional commands, e-mail: <[EMAIL PROTECTED]>
>


---------------------------------------------------------------------
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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to