dynamic web module 2.5与2.4

 http://hi.baidu.com/yuanygb/blog/item/b7f89b54c1638045d0090642.html

Project facet Dynamic Web Module version 2.X is not supported

 

在Eclipse中用jboss部署项目时遇到了“jboss Project facet Dynamic Web Module version 2.5 is not supported”的问题。

在项目跟目录下的.setting文件夹找到org.eclipse.wst.common.project.facet.core.xml,打开:

Xml代码 
  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <faceted-project>  
  3.   <fixed facet="jst.web"/>  
  4.   <fixed facet="jst.java"/>  
  5.   <installed facet="jst.web" version="2.5"/>  
  6.   <installed facet="jst.java" version="6.0"/>  
  7. </faceted-project>  
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
  <fixed facet="jst.web"/>
  <fixed facet="jst.java"/>
  <installed facet="jst.web" version="2.5"/>
  <installed facet="jst.java" version="6.0"/>
</faceted-project>
 

将version="2.5"改成version="2.4"即可。因为web.xml版本是2.4的,需要两者一致,如下:

Java代码
  1. <web-app version="2.4"    
  2.     xmlns="http://java.sun.com/xml/ns/j2ee"    
  3.     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    
  4.     xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee   
  5.     http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">  
<web-app version="2.4" 
	xmlns="http://java.sun.com/xml/ns/j2ee" 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 

造成这样后果的原因是从SVN上到处eclipse项目时候,连带着将.setting文件下也导下来了。在上传代码到SVN上的时候,一般来说.setting无需上传的,都是在本地由eclipse自动生成的。

 

文章来源:http://asgab.iteye.com/blog/1028228

 

----------------------------------------------------------------------------------------------------------------------------------------------

类似问题:

 


 

 

==========================

http://publib.boulder.ibm.com/infocenter/radhelp/v6r0m1/index.jsp?topic=/com.ibm.etools.webtools.doc/topics/twcreprj.html

Creating a dynamic Web project

Show Me

You create and maintain the resources for your Web applications in Web projects. Unlike with static Web projects, dynamic Web projects enable you to create resources such as JavaServer Pages and servlets, and use technologies such as Struts and JavaServer Faces.

To create a new dynamic Web project, complete the following steps:

  1. Open the Web perspective and select File > New > Dynamic Web Project. The New Dynamic Web Project wizard starts.
  2. Type a name for your Web project.

  3. Accept the default value in the Project location field (this is where your project is stored in your file system), or click Browse to choose a location from the file system. Then click the Show Advanced button if the advanced options are not already displayed.

  4. Select the servlet version number. The servlet version determines the server level on which you can run your applications. For example, servlet version 2.4 is only supported on WebSphere Application Server V6 and not on V5. Any new servlets and JSP files that you expect to create should adhere to the latest servlet specification level available. (Previous specification levels are offered to accommodate any legacy dynamic elements that you expect to import into the project).
    Notes:
    • The servlet version determines the choice of target servers that appear in the drop-down list.
    • The following servlet versions correspond to the following J2EE levels:
      • version 2.2 - J2EE 1.2
      • version 2.3 - J2EE 1.3
      • version 2.4 - J2EE 1.4
    • Note that you can upgrade your servlet version using the J2EE Migration Wizard but you can't go revert to an earlier level. For example, if you choose version 2.4, you will only be able to deploy to servers that support version 2.4, such as WebSphere® Application Server V6
  5. Select a target server from the drop-down list or create a new target server by selecting the New button
  6. A new or existing Enterprise Application project (EAR Project) must be associated with your new Web project to facilitate deployment. If you want to override the default settings for the Enterprise Application project, click New, and make your changes. When your Web project is created at the end of the wizard, the new Enterprise Application project is also created with the name specified in the EAR project field. Note that the default is the name of the web project appended with EAR (unless the ear project was selected when you opened the wizard.) If you want to use an existing Enterprise Application project, select the project from the EAR project drop down list.

    If you want to add a Web project as a module to another Enterprise Application project in the future, you can open the application deployment descriptor editor for the Enterprise Application project and select the Add option in the Module page.

  7. Specify a context root. (The context root is the Web application root, which is the top-level directory of your application when it is deployed to the Web server). You can change the context root after you create a project using the project Properties dialog, which you access from the project's pop-up menu. The context root can also be used by the links builder to ensure that your links remain ready to publish as you move and rename files inside your project.
  8. To add support for annotated Java classes, select the appropriate check box.
  9. To specify or customize the project options, such as adding Struts or EGL or Tag library support, select the Next check box .
  10. Select one or more of the Web Project features. The box on the right displays a description of each feature as you select it on the left. The default features are, Default style sheet (CSS file) and web diagram. Accepting the default style sheet creates a default CSS file called Master.css, which is used for any HTML and JSP files included in the project.
    • If you want to create a project that uses Struts technology, select Struts and click Next. Later in the wizard, the Struts Settings page appears in which you can specify the version of Struts technology you want to use in your project, the package prefix, and whether or not you want to bundle the resources.

    Note that although you can select WDO Relational database run-time and other options, you are not required to select these features when you create your Web project. If you add any Faces resources to your Web project, the Faces tools will automatically be enabled.

  11. Click Next.
  12. Select Use a default Page Template for the Web Site if you want your entire Web site to share a common page template. If you want to use one of the sample templates provided, select Sample Template and then choose one of the templates shown in the Thumbnail box. If you want to use a template of your own, select User-defined Template and then click Browse to select the template from the file system. The selected template is copied into your project for use when creating web pages.
  13. Click Finish (or click Next to adjust your Struts settings). The wizard creates a new project that reflects the J2EE folder structure that specifies the location of web content files, class files, class paths, the deployment descriptor, and supporting metadata.

You can now begin creating or importing content for your Web project using Web Site Designer, Web resource editors (such as Page Designer), the New File wizards, or the Import wizards available from the File menu.

Terms of use | Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 可能是因为您的项目不是一个动态Web项目,或者您的Eclipse版本不支持动态Web模块。请确保您的项目类型正确,并检查您的Eclipse版本是否支持动态Web模块。如果问题仍然存在,请尝试重新安装Eclipse或使用其他IDE。 ### 回答2: 当我们在Eclipse或其他集成开发环境中创建Web项目时,经常会遇到需要设置Dynamic Web Module版本号的情况。Dynamic Web Module是JavaEE规范中定义的一种Web应用程序规范,它定义了一些Web项目的基本结构和特性。 在Eclipse中,我们可以通过右键单击项目,选择“Properties”来打开项目属性窗口。然后在该窗口中,我们可以找到“Project Facets”选项。在这个选项卡中,我们可以勾选或取消勾选Dynamic Web Module。 但是有时候我们可能会遇到无法勾选Dynamic Web Module的情况。这可以是由于几个原因导致的: 1. 该项目可能不是一个Web项目:Dynamic Web Module只能应用于Web项目,因此如果当前项目不是一个Web项目,我们就无法勾选这个选项。 2. 项目可能已经被设置为其他类型的模块:有时候我们可能已经将项目设置为其他类型的项目模块,如EAR或JAR模块,这就导致无法再设置为Dynamic Web Module。 3. 缺少必需的插件或软件:在一些特殊情况下,我们可能需要安装或更新一些插件或软件,以确保我们能够正常使用Dynamic Web Module的功能。 解决这个问题的方法通常是确保我们满足了上述的要求。首先,我们需要确保当前项目是一个Web项目,如果不是,我们需要创建一个新的Web项目。其次,我们需要确保没有将项目设置为其他类型的模块。最后,我们可能需要更新一些插件或软件,以确保我们能够正确使用Dynamic Web Module的功能。 总之,无法勾选Dynamic Web Module可能是由于项目不是Web项目,被设置为其他类型的模块或者缺少必需的插件等原因所致。我们需要确保满足上述条件,以便能够正常地使用Dynamic Web Module的功能。 ### 回答3: dynamic web module 是一个用于开发 Web 应用程序的模块,它是 Java EE 规范的一部分。动态 Web 模块提供了许多功能,例如 Servlet、JSP 和动态资源等,这些可以让我们构建灵活而且具有交互性的 Web 应用程序。 动态 Web 模块无法勾选的原因可能有几种可能性,以下是可能的解决方法: 1. 检查项目是否已经被定义为动态 Web 项目。可以右键单击项目,选择 Properties(属性),然后选择 Project Facets(项目结构)选项卡。在这里,确保 Dynamic Web Module(动态 Web 模块)选项已被勾选,并且设置了正确的版本号。 2. 检查项目是否已经被关联到正确的服务器。在 Project Facets(项目结构)选项卡中,确保已选中正确的运行时(服务器)和目标运行时。如果没有可用的运行时,请点击 New Runtime...(新建运行时)按钮来添加。 3. 如果项目使用了 Maven 或其他构建工具,请检查项目的配置文件中是否正确配置了动态 Web 模块和相关依赖。您可以参考相应的文档或构建工具的指南来进行配置。 4. 确保项目的构建路径正确配置了所有必需的 JAR 文件和资源。在 Eclipse 中,您可以通过右键单击项目,选择 Build Path(构建路径)-> Configure Build Path(配置构建路径)来检查和配置构建路径。 如果尝试了以上方法仍然无法勾选 dynamic web module,可能是由于其他原因导致的问题。此时建议您在开发工具的相关论坛或官方文档中寻求更详细的帮助。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值