Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » CompilationUnit for JSP
CompilationUnit for JSP [message #206409] Fri, 04 January 2008 10:13 Go to next message
Eclipse User
Originally posted by: Tanyu.Krasimirov.Trifonov.sap.com

Hi,

Is there a CompilationUnit for compiled JSP and how can I get it? How can
I add some code (scriplet) to existing JSP file?

Best regards,
Tanyu
Re: CompilationUnit for JSP [message #206424 is a reply to message #206409] Sat, 05 January 2008 09:40 Go to previous message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2237
Registered: July 2009
Senior Member
Tanyu Trifonov wrote:
> Is there a CompilationUnit for compiled JSP and how can I get it? How
> can I add some code (scriplet) to existing JSP file?

You'll want to examine the
org.eclipse.jst.jsp.core.internal.validation.JSPJavaValidato r.performValidation(IFile,
IReporter, IStructuredModel) method and (its caller in the same
class) to see how the IJSPTranslation object is created. The
compilation unit mapping from JSP to/from Java sources is very
internal, so your best bet is to add the scriptlet to the JSP using
either the DOM interfaces (available on the IDOMDocument) or through
the text IDocument itself.

--
---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational


---
Nitin Dahyabhai
Eclipse WTP, IBM
Previous Topic:How Can I get the specified source code?
Next Topic:Dynamic Web Project nature disappears
Goto Forum:
  


Current Time: Wed Jul 30 07:09:02 EDT 2014

Powered by FUDForum. Page generated in 0.02834 seconds