Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] RE: how to integrate aspectj with JSPs?

To add to what's been said...

For an Ant script that precompiles Tomact JSP's, see
the sample code
"Precompile JSP's for Tomcat 4.x using AspectJ":

http://dev.eclipse.org/viewcvs/indextech.cgi/~checkout~/aspectj-home/sample-code.html#j2ee-tomcat4-precompileJsp


For in-process Ant-based builds, you can set the ${build.compiler}
property to use ajc; the trick is finding a way to add the requisite
aspects and libraries.  See the sample code
"Running AspectJ JSP's in Tomcat 4.x"

http://dev.eclipse.org/viewcvs/indextech.cgi/~checkout~/aspectj-home/sample-code.html#j2ee-tomcat4-jsp


btw, there's a general FAQ entry on J2EE,
"Can I use AspectJ with J2EE?"

http://dev.eclipse.org/viewcvs/indextech.cgi/~checkout~/aspectj-home/doc/faq.html#q:aspectjandj2ee

i.e.,: when deploying AspectJ in any environment, the docs
often help.  If you figure out the steps necessary to deploy
AspectJ in an environment not documented, it would help
everyone if you email the list with the steps, so we can
include them in the documentation.

Thanks -
Wes

Jules Gosnell wrote:
Gilman, Jason A. (JGILMAN) wrote:

I think this is because you are trying to use a class on the jsp that has
been modified by an aspect.  I had the same problem.  You can't do this
unless your jsp compiler supports aspects and weaves the aspects in.  You
can still use aspects in your J2EE applications but the aspects can't add
any new members to those classes being used in the jsps.  I don't know of
any jsp compilers right now that support aspects but they're coming. I would be good to hear of any solutions to this problem if any one else
knows any.


??

I've never tried this, but don't see why it should be a problem.

Jsp compilation is a two stage step.

(1) compile Jsp to Java (Jasper uses a class called JspC)
(2) compile Java to Class using javac

I don't see a reason why you shouldn't just replace javac in (2) with the AspectJ compiler...

How exactly you do this will depend on whether you are precompiling or compiling on the fly, and the JSP engine you are using.

Of course, it's possible that your vendor does a direct Jsp->class compilation, in which case I am talking rubbish - but I haven't seen one yet...

Whether you are using 'call' or 'execution' will also impact you (I think) if you are trying to call across mixed compilation modules....


Hope that helps,




Jules


-----Original Message-----
From: Hinna Javaid
To: aspectj-users@xxxxxxxxxxx
Sent: 1/9/04 8:55 AM
Subject: how to integrate aspectj with JSPs?

Hi
I have defined an aspect for logging all method calls. However, when I
integrate my application with JSPs i get an error saying that aspect
signature class not found. Can anybody help me with thay? How can I
resolve this error?
thanks
Hinna
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users






Back to the top