You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Denny <dd...@magic.fr> on 2001/06/15 11:25:35 UTC

Re: problems with xsp date__cking java code?

Hi Jan

You mention cking the java code:

> You can always check the Java code generated by the xsp, this sometimes
> helps to understand the error.

Can you tell us how you do that? I'm a newbie as you might have guessed!

TIA
Denny

Uyttenhove Jan wrote:
> 
> Lisa,
> 
> first, java.util.Date is included, but java.util.Calendar isn't.
> Try to include it by adding :
>       <xsp:structure>
>        <xsp:include>java.util.Calendar</xsp:include>
>       </xsp:structure>
> 
> second, you should put your <xsp:logic> block inside your <time> block
> 
> So, try this:
> 
>       <xsp:structure>
>        <xsp:include>java.util.Calendar</xsp:include>
>       </xsp:structure>
>         <time>
>           <xsp:logic>
>           Calendar now = Calendar.getInstance();
>           now.setTime( new Date() );
>           float hourAngle = (float) now.get( Calendar.HOUR   ) / 12 * 360;
>           float minAngle  = (float) now.get( Calendar.MINUTE ) / 60 * 360;
>         </xsp:logic>
>           <hour><xsp:expr>hourAngle</xsp:expr></hour>
>         <minute><xsp:expr>minAngle</xsp:expr></minute>
>         </time>
> 
> You can always check the Java code generated by the xsp, this sometimes
> helps to understand the error.
> 
> Jan
> 
> Jan Uyttenhove
> - Software Engineer -
> The E-corporation
> http://www.the-ecorp.com
> 
> -----Original Message-----
> From: lisa.vangelder@digitalrum.com
> [mailto:lisa.vangelder@digitalrum.com]
> Sent: Wednesday, June 13, 2001 11:28
> To: cocoon-users@xml.apache.org
> Subject: problems with xsp date
> 
> Hi all
> 
> I'm trying to create a simple XSP page that gets the current hour and minute
> and passes it on to a stylesheet. The cocoon docs say XSP automatically
> generates import statements for the most commonly used Java libraries
> (including java.util.Date).
> 
> However when I try run the page I get an error: Type expected.
> now.setTime(new Date());
> 
> Has anybody got any ideas?
> 
> Here is the relevant part of the page:
> 
>         <xsp:logic>
>        Calendar now = Calendar.getInstance();
>         now.setTime( new Date() );
>         float hourAngle = (float) now.get( Calendar.HOUR   ) / 12 * 360;
>         float minAngle  = (float) now.get( Calendar.MINUTE ) / 60 * 360;
>       </xsp:logic>
> 
>         <time>
> 
>         <hour><xsp:expr>hourAngle</xsp:expr></hour>
>        <minute><xsp:expr>minAngle</xsp:expr></minute>
> 
>         </time>
> 
> thanks in advance!
> 
> Lisa
> 
> ---------------------------------------------------------------------
> 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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: problems with xsp date__cking java code?

Posted by Janesh Vasudeva <jv...@asapsolutions.com>.
There's a repository dirctory where all java codes generated by xsp are
foung and it is specified cocoon.properties

check it whether it is commented ?

Janesh
----- Original Message -----
From: Denny <dd...@magic.fr>
To: <co...@xml.apache.org>
Sent: Friday, June 15, 2001 2:55 PM
Subject: Re: problems with xsp date__cking java code?


> Hi Jan
>
> You mention cking the java code:
>
> > You can always check the Java code generated by the xsp, this sometimes
> > helps to understand the error.
>
> Can you tell us how you do that? I'm a newbie as you might have guessed!
>
> TIA
> Denny
>
> Uyttenhove Jan wrote:
> >
> > Lisa,
> >
> > first, java.util.Date is included, but java.util.Calendar isn't.
> > Try to include it by adding :
> >       <xsp:structure>
> >        <xsp:include>java.util.Calendar</xsp:include>
> >       </xsp:structure>
> >
> > second, you should put your <xsp:logic> block inside your <time> block
> >
> > So, try this:
> >
> >       <xsp:structure>
> >        <xsp:include>java.util.Calendar</xsp:include>
> >       </xsp:structure>
> >         <time>
> >           <xsp:logic>
> >           Calendar now = Calendar.getInstance();
> >           now.setTime( new Date() );
> >           float hourAngle = (float) now.get( Calendar.HOUR   ) / 12 *
360;
> >           float minAngle  = (float) now.get( Calendar.MINUTE ) / 60 *
360;
> >         </xsp:logic>
> >           <hour><xsp:expr>hourAngle</xsp:expr></hour>
> >         <minute><xsp:expr>minAngle</xsp:expr></minute>
> >         </time>
> >
> > You can always check the Java code generated by the xsp, this sometimes
> > helps to understand the error.
> >
> > Jan
> >
> > Jan Uyttenhove
> > - Software Engineer -
> > The E-corporation
> > http://www.the-ecorp.com
> >
> > -----Original Message-----
> > From: lisa.vangelder@digitalrum.com
> > [mailto:lisa.vangelder@digitalrum.com]
> > Sent: Wednesday, June 13, 2001 11:28
> > To: cocoon-users@xml.apache.org
> > Subject: problems with xsp date
> >
> > Hi all
> >
> > I'm trying to create a simple XSP page that gets the current hour and
minute
> > and passes it on to a stylesheet. The cocoon docs say XSP automatically
> > generates import statements for the most commonly used Java libraries
> > (including java.util.Date).
> >
> > However when I try run the page I get an error: Type expected.
> > now.setTime(new Date());
> >
> > Has anybody got any ideas?
> >
> > Here is the relevant part of the page:
> >
> >         <xsp:logic>
> >        Calendar now = Calendar.getInstance();
> >         now.setTime( new Date() );
> >         float hourAngle = (float) now.get( Calendar.HOUR   ) / 12 * 360;
> >         float minAngle  = (float) now.get( Calendar.MINUTE ) / 60 * 360;
> >       </xsp:logic>
> >
> >         <time>
> >
> >         <hour><xsp:expr>hourAngle</xsp:expr></hour>
> >        <minute><xsp:expr>minAngle</xsp:expr></minute>
> >
> >         </time>
> >
> > thanks in advance!
> >
> > Lisa
> >
> > ---------------------------------------------------------------------
> > 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: <co...@xml.apache.org>
> > For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
> > For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>