|Re: JSP Editor [message #205152 is a reply to message #205144]
||Fri, 30 November 2007 04:37
Originally posted by: alexandre.vanbelle.3ds.com|
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 ?
|Re: JSP Editor [message #205160 is a reply to message #205144]
||Fri, 30 November 2007 05:23
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
|Re: JSP Editor [message #205214 is a reply to message #205152]
||Fri, 30 November 2007 14:47
| Bradley Childs
Registered: July 2009
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
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.
"Alexandre" <email@example.com> wrote in message
> 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 ?
Powered by FUDForum
. Page generated in 0.01726 seconds