您的位置:首页 > 编程语言 > Java开发

web项目发布相关

2016-07-22 09:36 381 查看
IDE环境:myEclipse

1

.mymetadata

<?xml version="1.0" encoding="UTF-8"?>

<project-module

  type="WEB"

  name="yun"

  id="myeclipse.1430891497046"

  context-root="/yun"(发布文件夹名称)

  j2ee-spec="5.0"

  archive="yun.war">(war包名称)

  <attributes>

    <attribute name="webrootdir" value="WebRoot" />

  </attributes>

</project-module>

2

.project(web项目特有)

<natures> </natures>代码段,在代码段中加入如下内容并保存: 
      <nature>org.eclipse.wst.common.project.facet.core.nature</nature> 
      <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature> 
      <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> 

刷新项目

右键→ properties→Project
Facets→在右侧选择“Dynamic Web Module”和"Java"

(如果要修改eclipse默认的WebContent为WebRoot,点击Further
Configuration available...,把默认的Content redirectory修改为WebRoot点击ok即可。)1

在勾选Dynamic Web Module的时候,如果报错→ Failed while installingDynamic
Web Module x.x

Detailes:Path
must include project and resource name:your project name

解决方案:

.classpath中删除<classpathentry
excluding="src/" kind="src" path=""/>(java build path→ sourse保留projectname/src即可)

然后开始报空指针

解决方案:1
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息