Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » HELP: Does WTP have a way to extend the TLD loading(Can TldManager load TLD file from memory?)
icon14.gif  HELP: Does WTP have a way to extend the TLD loading [message #549202] Mon, 26 July 2010 05:48 Go to next message
Jack, Liu is currently offline Jack, LiuFriend
Messages: 8
Registered: July 2010
Location: China
Junior Member
I am trying to extend the JSP editor.

One feature is that:
User can define tag library in java class, and jsp editor enable user referencing tld files in memory.

I am looking into the current logic, the org.eclipse.jst.jsp.core.taglib.ProjectDescription is not a public class, and only loads tld files from class path.

Can anyone give me suggestions on how to extend it?
The requirement is that.
Jsp editor can recognize the tld files which are out of current project's class path. And the tld files are only visible for their related project.

Hope that I have describe my issue clearly.

thanks Smile


Cheers

Jack
Re: HELP: Does WTP have a way to extend the TLD loading [message #549297 is a reply to message #549202] Mon, 26 July 2010 12:09 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

On 7/26/2010 1:48 AM, Jack wrote:
> I am trying to extend the JSP editor.
>
> One feature is that:
> User can define tag library in java class, and jsp editor enable user
> referencing tld files in memory.
> I am looking into the current logic, the
> org.eclipse.jst.jsp.core.taglib.ProjectDescription is not a public
> class, and only loads tld files from class path.
>
> Can anyone give me suggestions on how to extend it?
> The requirement is that.
> Jsp editor can recognize the tld files which are out of current
> project's class path. And the tld files are only visible for their
> related project.
>
> Hope that I have describe my issue clearly.

Not entirely. The taglib index allows for files in the current project
as well as locations in the project's Java Build Path (including those
exported from dependent projects), which is everything that's deployed
by the Server Tools framework. How does this work at runtime?

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


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: HELP: Does WTP have a way to extend the TLD loading [message #549514 is a reply to message #549297] Tue, 27 July 2010 02:16 Go to previous messageGo to next message
Jack, Liu is currently offline Jack, LiuFriend
Messages: 8
Registered: July 2010
Location: China
Junior Member
Actually, maybe sounds strange, we do not depend on the tld file.
The tag lib instance will be generated in memory at runtime, then the tags in jsp can be resolved correctly.
Runtime will get tag info from classes instead of from tld file.

But for editor tool, we need tld to support validation and code completion.



Cheers

Jack
Re: HELP: Does WTP have a way to extend the TLD loading [message #550043 is a reply to message #549514] Wed, 28 July 2010 20:29 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

On 7/26/2010 10:16 PM, Jack wrote:
> Actually, maybe sounds strange, we do not depend on the tld file.
> The tag lib instance will be generated in memory at runtime, then the
> tags in jsp can be resolved correctly. Runtime will get tag info from
> classes instead of from tld file.
>
> But for editor tool, we need tld to support validation and code completion.

I'm not sure this is going to be possible. In addition to resolving the
taglib URI in the JSP, we actually need to read the .tld or .tag/.tagx
file to know about the tags inside of it, and that information's
expected to be expressed in classes and interfaces that aren't API (the
org.eclipse.jst.jsp.core.internal.contentmodel.tld package).
TaglibIndex and ProjectDescription are locked down and inaccessible as
much as possible because of potential threading issues and for
performance. While it's possible to inject awareness of the tags
themselves in a similar way as is done for JSF Facelets, using the
provisional org.eclipse.wst.xml.core.modelQueryExtensions extension
point, it still wouldn't remove the validation messages in the taglib
directives themselves.

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


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: HELP: Does WTP have a way to extend the TLD loading [message #550059 is a reply to message #550043] Thu, 29 July 2010 01:09 Go to previous messageGo to next message
Jack, Liu is currently offline Jack, LiuFriend
Messages: 8
Registered: July 2010
Location: China
Junior Member
Oh, thanks, it is very helpful.
There is another way, I can generate tld dynamically, but I can not place it in the project's class path.
So if we had a way to enable user extend or register there own tld, it will be great.


Cheers

Jack
Re: HELP: Does WTP have a way to extend the TLD loading [message #550316 is a reply to message #550059] Thu, 29 July 2010 21:00 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

On 7/28/2010 9:09 PM, Jack wrote:
> Oh, thanks, it is very helpful.
> There is another way, I can generate tld dynamically, but I can not
> place it in the project's class path.
> So if we had a way to enable user extend or register there own tld, it
> will be great.

The XML Catalog will also be searched, and if your JSPs are using the
URI value from a generated TLD, as long as the .tld is under the same
web content folder it will still be found.

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


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: HELP: Does WTP have a way to extend the TLD loading [message #550516 is a reply to message #550316] Fri, 30 July 2010 15:47 Go to previous message
Jack, Liu is currently offline Jack, LiuFriend
Messages: 8
Registered: July 2010
Location: China
Junior Member
OH, see.
My project is only a pure java project, I will try the XML Catalog.

Thanks a lot, you gave me a great help.


Cheers

Jack
Previous Topic:java-output-path in org.eclipse.wst.common.component file
Next Topic:Eclipse to Use Dojo
Goto Forum:
  


Current Time: Fri Apr 26 12:55:09 GMT 2024

Powered by FUDForum. Page generated in 0.02457 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top