2011-12-14 67 views

回答

1

訪問HTTP請求可以用這樣的代碼來完成as

HttpServletRequest request = ServletActionContext.getRequest(); 
    if (request == null) { 
    log.warn("Unable to find a request while creating an issue"); 
    return; 
    } 

    String[] values = request.getParameterValues("mykey"); 
    if (values == null || values.length != 1) { 
    log.debug("Unable to find parameters in the request while creating an issue"); 
    return; 
    } 

    String valueString = values[0]; 
    if (valueString == null || valueString.equals("")) { 
    // Valid if no value was entered 
    log.debug("Unable to find a value for mykey while creating an issue"); 
    return; 
    } 

在我的書O'Reilly的書「Practical JIRA Plugins」中也可以看到這一章。