JSP Editor [message #205096] |
Thu, 29 November 2007 08:13  |
Eclipse User |
|
|
|
Originally posted by: alexandre.vanbelle.3ds.com
Hello,
Does anybody knows whether the JSP editor uses the JDT project for the
java partitions of a JSP ?
Thanks,
Alexandre
|
|
|
|
|
|
Re: JSP Editor [message #205160 is a reply to message #205144] |
Fri, 30 November 2007 05:23   |
Eclipse User |
|
|
|
Originally posted by: mauro.molinari.cardinis.com
Nitin Dahyabhai ha scritto:
> While it does not use the same partitioner or even product the same
> partition types, much of the functionality is provided through the JDT
> project. That said, the editing experience for Java code within JSP
> files is not 100% identical to that of the Java editor, nor do I ever
> expect it to be--the JDT team would have to take a year or two off to do
> nothing new, and none of us wants that.
I perfectly understand your point of view, but I also think this is
sad... As of now, the editing experience of Java code within JSP in WTP
is far, far away from the the one in JDT Java editor. Many features are
missing, some do not work perfectly and the feeling is that others have
to be duplicated to be made available in JSPs. This could of course be a
maintenability problem in the long term, while JSP editing gives always
the feeling to be some steps behind standard Java files editing in
Eclipse... :-(
Mauro.
|
|
|
Re: JSP Editor [message #205214 is a reply to message #205152] |
Fri, 30 November 2007 14:47  |
Eclipse User |
|
|
|
Hi Alexandre,
The JSP editor has a translation that parses Java pieces out of the JSP
documents. It takes the parsed out Java pieces, assembles them into a Java
class(es) and passes it to the JSP editor by creating a CompilationUnit (CU)
and setting its buffer contents to the parsed results. The JSP translator
performs some manipulation of the JSP pieces to make valid Java. A fairly
complex map is kept of the real JSP regions, the inserted pieces and the
Java classes passed to the JDT.
Once the CU is achieved, it acts as the primary bridge between JSP and the
JDT. The JSP maintains a map between the JSP regions and their
corresponding part in the Java CU. All java like functions in JSP are
performed on the CU and results mapped back to the JSP page.
This virtual CU is the bridge between JSP and JDT. Most JSP functions rely
on the translated CU. If you look in the jsp.core plugin under the
org.eclipse.jst.jsp.core.internal.java package you will find the meat of the
JSP translation.
The Java AST parser comes into play when the buffer contents of the CU are
set. At this point the code is parsed into the AST. Sine the CU created
from the translation is virtual in most regards, I've found it difficult to
manipulate via the JDT core pieces.
I hope this helps in your investigations.
-Brad
"Alexandre" <alexandre.vanbelle@3ds.com> wrote in message
news:b127a2de07d9365c0fca4824cfff7b71$1@www.eclipse.org...
> First, thank you for your answers ! Really quick :-).
>
> Does someone know which functionalities are provided through the JDT
> project. Currently, I have a plug-in that analyse java source code using
> an ASTParser of JDT. Can I get the same feature with a JSP file ?
>
> Thanks,
> Alexandre
>
|
|
|
Powered by
FUDForum. Page generated in 9.44747 seconds