Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

JDT creating dynamic web project

I want to develop a plug-in in eclipse that create new dynamic web project. I create Java project and add project facet to convert it to dynamic web project, but it creates a static web project.

any help is appreciated

IJavaProject javaProject = createProject(projectName +"-web",new String[] {JavaCore.NATURE_ID});
       
        IFacetedProject facetedProject =
            ProjectFacetsManager.create(javaProject.getProject(), true, null);
       
        IProjectDescription description1 = javaProject.getProject().getDescription();
        description1.setNatureIds(new String[] {"org.eclipse.jem.workbench.JavaEMFNature",
                   "org.eclipse.wst.common.modulecore.ModuleCoreNature",
                   "org.eclipse.wst.common.project.facet.core.nature",
                   "org.eclipse.wst.jsdt.core.jsNature"});
       
        javaProject.getProject().setDescription(description1, null);

        IProjectFacet wstWebFacet = ProjectFacetsManager.getProjectFacet
        (IModuleConstants.WST_WEB_MODULE);

    facetedProject.installProjectFacet(wstWebFacet.getDefaultVersion(), null, null);

0 votes


Accepted answer

Permanent link
You should probably ask this kind of questions at http://www.eclipse.org/ as they have noting to do with Jazz.
Ralph Schoon selected this answer as the correct answer

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 127
× 70
× 24
× 10
× 4

Question asked: Jun 23 '13, 7:51 a.m.

Question was seen: 5,313 times

Last updated: Jul 31 '13, 11:27 a.m.

Confirmation Cancel Confirm