Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [wtp-dev] Change Context Root

Hi Carl,

sorry for using this mailing list.

But your answer still does not help me.

I tried already EarArtifactEdit.setServerContextRoot(IProject earProject, String contextRoot), but I always got a NPE. Probably I did it the wrong way to obtain a reference to EarArtifactEdit. But how can I do it correctly? Where can I find an example or documentation? Is the API public?

The first version you mentioned does not exist. I cannot find the class J2EEProjectUtilities in the public APIs. I found it later in an internal package! Should I use that?

For me there is still the question how to solve my problem. :(

With regards,


Carl Anderson wrote:

      Let me address these points out of order.  First, both WTP 3.0 RC1
and RC2 have been released.  Please see .  Second, this is not the
right mailing list to ask questions about coding on top of wtp... this
mailing list is for wtp development (the actual coding of wtp).
      Now, to quickly answer your question, there are two places where the
context root can be kept- if it is a standalone WAR, in 2.0.2 you could
useJ2EEProjectUtilities.setServerContextRoot(IProject project, String
contextRoot), and if it is the context root within an EAR, you use
WebArtifactEdit.setServerContextRoot(IProject earProject, String
contextRoot) or EarArtifactEdit.setWebContextRoot(IProject webProject,
String contextRoot), whichever is easier.  The only case that isn't easily
covered in WTP 2.0.2 is if you happen to have an EAR 5.0 - we discovered
this and added IEARModelProvider.setWebContextRoot(IProject webProject,
String aContextRoot) during 3.0 development.


- Carl Anderson
WTP programmer

Udo Walker <udo.walker@abas. de> To Sent by: wtp-dev@xxxxxxxxxxx wtp-dev-bounces@e cc Subject [wtp-dev] Change Context Root 05/29/2008 06:05 AM Please respond to "General discussion of project-wide or architectural issues." <wtp-dev@eclipse. org>


how can I change the context root of a web project with an API call? I
can change the context root by editing the properties tab "Web Project
Settings". How can I do this from my program?

I use WTP 2.0.2. If it is not possible with version 2.0.2 how can I do
it with version 3? When will be version 3.0rc1 or 3.0 rc2 released? (I
suggest that the final version 3.0 will be released with the Eclipse
Ganymede version, right?)

With regards

wtp-dev mailing list

wtp-dev mailing list

Back to the top