2011-12-14 241 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”中也可以看到这一章。