Author: scabanovich
Date: 2011-02-16 16:26:58 -0500 (Wed, 16 Feb 2011)
New Revision: 29185
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/helpers/NewWebProjectContext.java
trunk/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:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/helpers/NewWebProjectContext.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/helpers/NewWebProjectContext.java 2011-02-16
21:25:32 UTC (rev 29184)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/helpers/NewWebProjectContext.java 2011-02-16
21:26:58 UTC (rev 29185)
@@ -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:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/version/ProjectVersion.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/version/ProjectVersion.java 2011-02-16
21:25:32 UTC (rev 29184)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/project/version/ProjectVersion.java 2011-02-16
21:26:58 UTC (rev 29185)
@@ -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++) {