Author: scabanovich
Date: 2011-02-24 13:10:53 -0500 (Thu, 24 Feb 2011)
New Revision: 29320
Modified:
branches/jbosstools-3.2.x/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/helpers/NewWebProjectContext.java
branches/jbosstools-3.2.x/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/version/ProjectVersion.java
Log:
JBIDE-8433
https://issues.jboss.org/browse/JBIDE-8433
Modified:
branches/jbosstools-3.2.x/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/helpers/NewWebProjectContext.java
===================================================================
---
branches/jbosstools-3.2.x/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/helpers/NewWebProjectContext.java 2011-02-24
18:10:13 UTC (rev 29319)
+++
branches/jbosstools-3.2.x/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/helpers/NewWebProjectContext.java 2011-02-24
18:10:53 UTC (rev 29320)
@@ -146,12 +146,13 @@
if(projectTemplateEdit == null) return null;
ProjectVersion v = projectTemplateEdit.getProjectVersion();
if(v == null) return null;
- String pref = v.getPreferredServletVersion();
- if(pref == null) return null;
- int c = compareServletVersions(pref, servletVersion);
+ String min = v.getMinimalServletVersion();
+ if(min == null) min = v.getPreferredServletVersion();
+ if(min == null) return null;
+ int c = compareServletVersions(min, servletVersion);
if(c > 0) {
return
MessageFormat.format(WebUIMessages.NewWebProjectContext_ServletVersionMustBeAtLeast,
- pref);
+ min);
}
return null;
}
Modified:
branches/jbosstools-3.2.x/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/version/ProjectVersion.java
===================================================================
---
branches/jbosstools-3.2.x/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/version/ProjectVersion.java 2011-02-24
18:10:13 UTC (rev 29319)
+++
branches/jbosstools-3.2.x/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/version/ProjectVersion.java 2011-02-24
18:10:53 UTC (rev 29320)
@@ -37,6 +37,7 @@
String[] order = new String[0];
String preferredServletVersion = null;
+ String minimalServletVersion = null;
ProjectVersion(ProjectVersions versions) {
this.versions = versions;
@@ -66,6 +67,10 @@
return preferredServletVersion;
}
+ public String getMinimalServletVersion() {
+ return minimalServletVersion;
+ }
+
public String getErrorMessage() {
LibraryReference core = null;
LibraryReference common = null;
@@ -104,6 +109,10 @@
if(sv != null && sv.trim().length() > 0) {
preferredServletVersion = sv.trim();
}
+ sv = e.getAttribute("min-servlet-version"); //$NON-NLS-1$
+ if(sv != null && sv.trim().length() > 0) {
+ minimalServletVersion = sv.trim();
+ }
ArrayList<LibraryReference> ls = new ArrayList<LibraryReference>();
NodeList nl = e.getChildNodes();
for (int i = 0; i < nl.getLength(); i++) {