You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Luke Renn <lu...@imapmail.org> on 2003/11/11 04:00:57 UTC

Tapestry And AspectJ

Hello All,

First, thanks to the contributors of this list for the great reading, 
and thanks to the developers of  Tapestry for a great framework.

Now, does anyone know the specifics of how tapestry creates subclasses 
of pages (and engines?).  If i setup an aspect to do a 
System.out.println() in Home.getUserName(), the aspect never gets 
called.  Oddly enough, if I make Home.getUserName() call Home.test() and 
setup an aspect for test(), that aspect does get called.  Anyone got any 
ideas?

Thanks.



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Tapestry And AspectJ

Posted by Luke Renn <lu...@imapmail.org>.
Ahhh.  Interesting.  I was just checking out the java assist page.  
Looks like getting aspectj to work with javassist might be impossible 
:)  It might not be though.  If I had a page called Home, how would 
tapestry name the subclass it creates at runtime?  Is it a true subclass 
(would <javasssist created class> instanceof Home return true?) or is it 
some new class copied from the original?

Thanks (for the quick response and tapesty),

Luke

Howard M. Lewis Ship wrote:

>I haven't used AspectJ yet.
>
>Tapestry uses Javassist to create enhanced subclasses at runtime.  I suspect AspectJ (which does it
>own bit of bytecode weaving magic) expects to be last on the chain, and doesn't like it that classes
>are being created at runtime ... after the point where it gets a chance to rework the code to slip
>in the aspect implementations.
>
>--
>Howard M. Lewis Ship
>Creator, Tapestry: Java Web Components
>http://jakarta.apache.org/tapestry
>http://jakarta.apache.org/commons/sandbox/hivemind/
>http://javatapestry.blogspot.com
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


DateField exception with format

Posted by Eric Schneider <er...@centralparksoftware.com>.
Hi,

I can't seem to get the DateField component to work when I bind a format.
The following exception is thrown.

Illegal pattern character 'j'
java.text.SimpleDateFormat.compile(SimpleDateFormat.java:675)
java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:494)
java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:443)
java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:424)
org.apache.tapestry.form.DatePicker.renderComponent(DatePicker.java:143)
org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:880)
org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:657)
org.apache.tapestry.form.Form.renderComponent(Form.java:396)
org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:880)
org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:657)
org.apache.tapestry.components.RenderBody.renderComponent(RenderBody.java:86
)
org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:880)
org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:657)
org.apache.tapestry.html.Body.renderComponent(Body.java:310)
org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:880)
org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:657)
org.apache.tapestry.html.Shell.renderComponent(Shell.java:173)

The SimpleFormat seems to work fine in Inserts......

public static final SimpleDateFormat DATE_FORMAT_WITH_SLASHES =
     new SimpleDateFormat("MM/dd/yyyy");

Anyone know why this is happening?

Thanks,
Eric



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Tapestry And AspectJ

Posted by Luke Renn <lu...@imapmail.org>.
It works fine with Tapestry.  I'm ashamed to say my pointcut was at 
"call" not "execution".  Since my code never explicitly called anything 
in Home, the aspect never ran. :(  Just make sure you use Classname+ 
(all classes that extend Classname) when writing tapestry aspects.

Thanks,

Luke

Adam Greene wrote:

>AspectJ is actually a Java Compiler and marks up the classes.
>
>-----Original Message-----
>From: Howard M. Lewis Ship [mailto:hlship@comcast.net]
>Sent: Monday, November 10, 2003 11:11 PM
>To: 'Tapestry users'
>Subject: RE: Tapestry And AspectJ
>
>
>I haven't used AspectJ yet.
>
>Tapestry uses Javassist to create enhanced subclasses at runtime.  I suspect
>AspectJ (which does it
>own bit of bytecode weaving magic) expects to be last on the chain, and
>doesn't like it that classes
>are being created at runtime ... after the point where it gets a chance to
>rework the code to slip
>in the aspect implementations.
>
>--
>Howard M. Lewis Ship
>Creator, Tapestry: Java Web Components
>http://jakarta.apache.org/tapestry
>http://jakarta.apache.org/commons/sandbox/hivemind/
>http://javatapestry.blogspot.com
>
>  
>
>>-----Original Message-----
>>From: Luke Renn [mailto:lukerenn@imapmail.org]
>>Sent: Monday, November 10, 2003 10:01 PM
>>To: Tapestry users
>>Subject: Tapestry And AspectJ
>>
>>
>>Hello All,
>>
>>First, thanks to the contributors of this list for the great reading,
>>and thanks to the developers of  Tapestry for a great framework.
>>
>>Now, does anyone know the specifics of how tapestry creates
>>subclasses
>>of pages (and engines?).  If i setup an aspect to do a
>>System.out.println() in Home.getUserName(), the aspect never gets
>>called.  Oddly enough, if I make Home.getUserName() call
>>Home.test() and
>>setup an aspect for test(), that aspect does get called.
>>Anyone got any
>>ideas?
>>
>>Thanks.
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: Tapestry And AspectJ

Posted by Adam Greene <ag...@romulin.com>.
AspectJ is actually a Java Compiler and marks up the classes.

-----Original Message-----
From: Howard M. Lewis Ship [mailto:hlship@comcast.net]
Sent: Monday, November 10, 2003 11:11 PM
To: 'Tapestry users'
Subject: RE: Tapestry And AspectJ


I haven't used AspectJ yet.

Tapestry uses Javassist to create enhanced subclasses at runtime.  I suspect
AspectJ (which does it
own bit of bytecode weaving magic) expects to be last on the chain, and
doesn't like it that classes
are being created at runtime ... after the point where it gets a chance to
rework the code to slip
in the aspect implementations.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com

> -----Original Message-----
> From: Luke Renn [mailto:lukerenn@imapmail.org]
> Sent: Monday, November 10, 2003 10:01 PM
> To: Tapestry users
> Subject: Tapestry And AspectJ
>
>
> Hello All,
>
> First, thanks to the contributors of this list for the great reading,
> and thanks to the developers of  Tapestry for a great framework.
>
> Now, does anyone know the specifics of how tapestry creates
> subclasses
> of pages (and engines?).  If i setup an aspect to do a
> System.out.println() in Home.getUserName(), the aspect never gets
> called.  Oddly enough, if I make Home.getUserName() call
> Home.test() and
> setup an aspect for test(), that aspect does get called.
> Anyone got any
> ideas?
>
> Thanks.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: Tapestry And AspectJ

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
I haven't used AspectJ yet.

Tapestry uses Javassist to create enhanced subclasses at runtime.  I suspect AspectJ (which does it
own bit of bytecode weaving magic) expects to be last on the chain, and doesn't like it that classes
are being created at runtime ... after the point where it gets a chance to rework the code to slip
in the aspect implementations.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com

> -----Original Message-----
> From: Luke Renn [mailto:lukerenn@imapmail.org] 
> Sent: Monday, November 10, 2003 10:01 PM
> To: Tapestry users
> Subject: Tapestry And AspectJ
> 
> 
> Hello All,
> 
> First, thanks to the contributors of this list for the great reading, 
> and thanks to the developers of  Tapestry for a great framework.
> 
> Now, does anyone know the specifics of how tapestry creates 
> subclasses 
> of pages (and engines?).  If i setup an aspect to do a 
> System.out.println() in Home.getUserName(), the aspect never gets 
> called.  Oddly enough, if I make Home.getUserName() call 
> Home.test() and 
> setup an aspect for test(), that aspect does get called.  
> Anyone got any 
> ideas?
> 
> Thanks.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org