FileDocCategorySizeDatePackage
URLPatternErrorCheck.javaAPI DocGlassfish v2 API3789Fri May 04 22:34:10 BST 2007com.sun.enterprise.tools.verifier.tests.web

URLPatternErrorCheck

public class URLPatternErrorCheck extends URLPattern
The content of the url-pattern element follows the rules specified in section 10 of the servlet spec. In this test, we only check for failure conditions. In URLPatternWarningCheck class we check for warnings.

Fields Summary
Constructors Summary
Methods Summary
protected voidcheckUrlPatternAndSetResult(java.lang.String urlPattern, Descriptor descriptor, Result result, ComponentNameConstructor compName)

     if (urlPattern != null && 
               (urlPattern.startsWith("/") || (urlPattern.startsWith("*.") && urlPattern.length()!=2))){
        result.passed(smh.getLocalString
                              ("tests.componentNameConstructor",
    	                       "For [ {0} ]",
    	                       new Object[] {compName.toString()}));
    	result.addGoodDetails (smh.getLocalString
    		                (getClass().getName() + ".passed",
    		                 "url-pattern [ {0} ] within [ {1} ] follows the rules specified in servlet specification",
    		                 new Object[] {urlPattern, descriptor.getName()}));
     } else {
	oneFailed=true;
    	result.failed(smh.getLocalString
    			       ("tests.componentNameConstructor",
    				"For [ {0} ]",
    				new Object[] {compName.toString()}));
    	result.addErrorDetails (smh.getLocalString
    				     (getClass().getName() + ".failed",
    				      "Error: Content of the url-pattern element [ {0} ] does not follow the rules specified in servlet specification within [ {1} ]",
    				      new Object[] {urlPattern, descriptor.getName()}));
     }