You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Laurent Eskenazi <le...@mail.inforama.fr> on 2000/08/03 18:01:48 UTC

Custom taglib problem

Hi !

I'm trying to make a very simple custom taglib, but I'm getting an error
with cocoon 1.7.4 :

Java.lang.NullPointerException
                          at
org.apache.cocoon.processor.xsp.XSPProcessor.process(Compiled Code)
                          at org.apache.cocoon.Engine.handle(Compiled Code)
                          at org.apache.cocoon.Cocoon.service(Compiled Code)
                          at javax.servlet.http.HttpServlet.service(Compiled
Code)
                          at
org.apache.jserv.JServConnection.processRequest(Compiled Code)
                          at org.apache.jserv.JServConnection.run(Compiled
Code)
                          at java.lang.Thread.run(Compiled Code)



* Here is my XSP File:
<?xml version="1.0" encoding="ISO-8859-1"?>

<?cocoon-process type="xsp"?>

<xsp:page
  language="java"
  xmlns:atl="http://www.apache.org/1999/ATL"
  xmlns:xsp="http://www.apache.org/1999/XSP/Core"
>

  <page>
    <title>Welcome to AntiStatic.org's Taglib test page !</title>
    <p>Il est maintenant <atl:heure/>.</p>
  </page>

</xsp:page>



* Here is my Taglib file:
<?xml version="1.0" encoding="iso-8859-1"?>

<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:xsp="http://www.apache.org/1999/XSP/Core"
 xmlns:atl="http://www.apache.org/1999/ATL"
>

  <xsl:template match="atl:heure">
    <xsp:logic>
      Date date = new Date();
    </xsp:logic>

<xsp:expr>date.getHours()</xsp:expr>:<xsp:expr>date.getMinutes()</xsp:expr>
  </xsl:template>

</xsl:stylesheet>



* And in cocoon.properties:
processor.xsp.logicsheet.context.java  =
resource://org/apache/cocoon/processor/xsp/library/java/context.xsl
processor.xsp.logicsheet.cookie.java   =
resource://org/apache/cocoon/processor/xsp/library/java/cookie.xsl
processor.xsp.logicsheet.global.java   =
resource://org/apache/cocoon/processor/xsp/library/java/global.xsl
processor.xsp.logicsheet.request.java  =
resource://org/apache/cocoon/processor/xsp/library/java/request.xsl
processor.xsp.logicsheet.response.java =
resource://org/apache/cocoon/processor/xsp/library/java/response.xsl
processor.xsp.logicsheet.session.java  =
resource://org/apache/cocoon/processor/xsp/library/java/session.xsl
processor.xsp.logicsheet.util.java     =
resource://org/apache/cocoon/processor/xsp/library/java/util.xsl
processor.xsp.logicsheet.sql.java      =
resource://org/apache/cocoon/processor/xsp/library/java/sql.xsl

processor.xsp.logicsheet.atl.java      =
file://home/laurent/atl-test-lib.xsl


How can I manage to make this work ?

Thanks

Laurent


Re: Custom taglib problem

Posted by Jeremy Quinn <je...@media.demon.co.uk>.
At 09:24 +0200 04/08/00, Laurent Eskenazi wrote:
>
>Thanks, I worked.
>
>But I still have a small problem:
>
>When I update my XSP pages, they are recompiled as soon as I reload the
>page. But when I update my taglib, I have to delete my repository directory
>and restart my webserver to have the new version used by my pages. It's
>isn't very practical when developping.
>
>Is there a better / faster way to see the result of these updates ?

If you have your logicsheet referenced from cocoon.properties, a recompile
of your XSP does not appear to happen when the logicsheet is changed. This
is fine for fully debugged logicsheets, but not a lot of fun when you are
still developing it!

Instead, put a <?xml-logicsheet href="path/to/your/logicsheet.xsl"?> PI
with the other PIs in your XSP Page to refer to the logicsheet. This way
recompilation occurs properly when your logicsheet changes.

Hope this helps

regards Jeremy

-- 
   ___________________________________________________________________

   Jeremy Quinn                                           Karma Divers
                                                       webSpace Design
                                            HyperMedia Research Centre

   <ma...@mac.com>     		 <http://www.media.demon.co.uk>
    <phone:+44.[0].20.7737.6831>        <pa...@sms.genie.co.uk>

Re: Custom taglib problem

Posted by Laurent Eskenazi <le...@mail.inforama.fr>.
Thanks, I worked.

But I still have a small problem:

When I update my XSP pages, they are recompiled as soon as I reload the
page. But when I update my taglib, I have to delete my repository directory
and restart my webserver to have the new version used by my pages. It's
isn't very practical when developping.

Is there a better / faster way to see the result of these updates ?

Thanks Laurent

----- Original Message -----
From: sudhi <su...@insage.com>
To: <co...@xml.apache.org>
Sent: Thursday, August 03, 2000 6:20 PM
Subject: Re: Custom taglib problem


> Hi,
>
> change the line in ur cocoon.properties from
>  file://home/laurent/atl-test-lib.xsl
>
> to
>
> file:///home/laurent/atl-test-lib.xsl
>
> That might do the trick
> HTH
> Sudhi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Custom taglib problem

Posted by sudhi <su...@insage.com>.
Hi,

change the line in ur cocoon.properties from
 file://home/laurent/atl-test-lib.xsl

to

file:///home/laurent/atl-test-lib.xsl

That might do the trick
HTH
Sudhi