Hi Mike,
You can also use the interface IModelProvider provided by
ModelProviderManager to obtain a model object representing web.xml. The returned
model object is an EMF object so modifying it is quite easy. Using the
IModelProvider you will be able to get model objects for both web 2.4 and web
2.5 projects.
Best Regards,
Kiril
ps:It is also a good idea to wrap modifications in
IDataModelOperation so that others can easily reuse
them.
Mike,
The best way to modify web.xml is to use the API provided by WTP
such as WebArtifactEdit. That way your facet will co-exist peacefully with
facets written by other people. If you must replace the file with canned
contents, make sure that you are using Eclipse IO (rather than Java IO)...
use IFile.setContents().
- Konstantin
 Konstantin
Komissarchik | Principal Member of Technical Staff Phone: +1 425 201 1795 |
Mobile: +1 206 898 0611 Oracle Eclipse
Tooling 411 108th Ave NE, Suite 2100 | Bellevue, WA 98004
Hi all --
I am working on a project facet
plugin (thanks to Konstantin!) that creates a default template project with a
bunch of assets in place. Part of what we need to do is overlay the
deployment descriptor with our own stock copy. I am finding that a file
copy does not work, I get a strange "(Access Denied)" IOException. Is this
because it is in the WEB-INF area? I also tried creating a IO file over
the default one, and calling delete() on it, which seems to have no
effect?
Am I missing some obvious Java IO thing here, or is this
something WTP specific about WEB-INF?
Thanks- Mike
Stay in touch when you're away with Windows Live Messenger. IM anytime you're online.
|