Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » JSP Editor
JSP Editor [message #205096] Thu, 29 November 2007 13:13 Go to next message
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 #205113 is a reply to message #205096] Thu, 29 November 2007 16:37 Go to previous messageGo to next message
Bradley Childs is currently offline Bradley Childs
Messages: 14
Registered: July 2009
Junior Member
No. The JSP editor uses its own document partitioner and does not
sub-partition the JSP regions into the JDT/JavaEditor's equivalent
partitions.

-Brad
"Alexandre" <alexandre.vanbelle@3ds.com> wrote in message
news:f0bab99bf976da0082c00afb2502200b$1@www.eclipse.org...
> 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 #205144 is a reply to message #205113] Fri, 30 November 2007 03:08 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2254
Registered: July 2009
Senior Member
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.

---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational


---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: JSP Editor [message #205152 is a reply to message #205144] Fri, 30 November 2007 09:37 Go to previous messageGo to next message
Eclipse User
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 ?

Thanks,
Alexandre
Re: JSP Editor [message #205160 is a reply to message #205144] Fri, 30 November 2007 10:23 Go to previous messageGo to next message
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 19:47 Go to previous message
Bradley Childs is currently offline Bradley Childs
Messages: 14
Registered: July 2009
Junior Member
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
>
Previous Topic:xml binding for structured document
Next Topic:Tomcat/shared/lib and WTP
Goto Forum:
  


Current Time: Wed Sep 03 02:33:23 GMT 2014

Powered by FUDForum. Page generated in 0.06680 seconds