All web modules in the application must have unique context-root.
Applicable for j2ee 1.3 or below. For 1.4 and above xml schema takes care of this.
Result result = getInitializedResult();
Set webs=descriptor.getWebBundleDescriptors();
if(webs.size()<=1){
result.notApplicable(smh.getLocalString
(getClass().getName() + ".notApplicable",
"There is one or less web component in application [ {0} ]",
new Object[] {descriptor.getName()}));
return result;
}
Set<String> contexts=new HashSet<String>();
Iterator itr=webs.iterator();
boolean oneFailed=false;
while (itr.hasNext()) {
WebBundleDescriptor wbd = (WebBundleDescriptor) itr.next();
String ctx=wbd.getContextRoot();
if(!contexts.add(ctx)){
oneFailed=true;
result.failed(
(smh.getLocalString
(getClass().getName() + ".failed",
"Error: There is already a web module with context-root [ {0} ] within application [ {1} ]",
new Object[] {ctx, descriptor.getName()})));
}
}
if(!oneFailed){
result.passed(
(smh.getLocalString
(getClass().getName() + ".passed",
"All the context-root values are unique within application [ {0} ]",
new Object[] {descriptor.getName()})));
}
return result;