MAVEN Create WebApp Project Unable to modify web version issues

Source: Internet
Author: User

Maven created the Web app, the default version of the servlet used is 2.3, the default does not support JSTL, in order to support the default JSTL expression, you need to upgrade servlet to 3.0

Ext.: http://blog.sina.com.cn/s/blog_b03dd8950102wi05.html

When the Maven plugin is loaded in eclipse, sometimes a new WebApp project is created, and the project version is the old version of 2.3.

To modify this version, the first method: Select the item, right-click, then click Properties, Pop Up the following dialog box

? Click Project Facets,

Click the downward triangular arrow next to Java, select 1.7, click the down triangle arrow next to the Dynamic Web module, select 2.5 or 3.0, and then click Apply.

The appeal method sometimes does not work, if not, the following method should be used:

Method Two: Click on the menu above Windows--show View-->navagator

This allows the project to be displayed through Navagator,

In SRC--main->webapp

-Web-inf directory created below

The Web. xml file, if it already exists, does not need to be created,

1, in the Web. xml file, add the following code:

<?xml version= "1.0"

encoding= "UTF-8"?>

<web-app

Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance" xmlns= "Http://java.sun.com/xml/ns/javaee" xsi: Schemalocation= "Http://java.sun.com/xml/ns/javaee

Http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd "id=" Schedule-console "

version= "3.0" ></web-app>

2, open Org.eclipse.jdt.core.prefs

File, change the code to:? eclipse.preferences.version=1org.eclipse.jdt.core.compiler.codegen.inlinejsrbytecode= Enabledorg.eclipse.jdt.core.compiler.codegen.targetplatform=1.7org.eclipse.jdt.core.compiler.compliance= 1.7org.eclipse.jdt.core.compiler.problem.assertidentifier= Errororg.eclipse.jdt.core.compiler.problem.enumidentifier= errororg.eclipse.jdt.core.compiler.problem.forbiddenreference=warningorg.eclipse.jdt.core.compiler.source=1.7?

3, open the Org.eclipse.wst.common.project.facet.core.xml file, and change the code to:

? <?xml version= "1.0"

encoding= "UTF-8"?><faceted-project>

<fixed facet= "Wst.jsdt.web"/>

<installed facet= "Java"

version= "1.7"/> <installed

facet= "Jst.web" version= "3.0"/>

<installed facet= "Wst.jsdt.web"

Version= "1.0"/></faceted-project>

When you go back to method one, the version of the web is found to be modified

(GO) Maven Create WebApp project cannot modify the web version of the problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.