*/
private void configureCookieProperties(CookieProperties bean) {
if (bean != null) {
WebProperty[] props = bean.getWebProperty();
if (props != null) {
SessionCookieConfig cookieConfig = new SessionCookieConfig();
for(WebProperty prop : props) {
String name = prop.getAttributeValue(WebProperty.NAME);
String value = prop.getAttributeValue(WebProperty.VALUE);
if(name == null || value == null) {
throw new IllegalArgumentException(
rb.getString("webcontainer.nullWebProperty"));
}
if("cookieName".equalsIgnoreCase(name)) {
cookieConfig.setName(value);
} else if("cookiePath".equalsIgnoreCase(name)) {
cookieConfig.setPath(value);
} else if("cookieMaxAgeSeconds".equalsIgnoreCase(name)) {
try {
cookieConfig.setMaxAge(Integer.parseInt(value));
} catch(NumberFormatException e) {
// XXX need error message
}
} else if("cookieDomain".equalsIgnoreCase(name)) {
cookieConfig.setDomain(value);
} else if("cookieComment".equalsIgnoreCase(name)) {
cookieConfig.setComment(value);
} else if("cookieSecure".equalsIgnoreCase(name)) {
cookieConfig.setSecure(value);
} else if("cookieHttpOnly".equalsIgnoreCase(name)) {
cookieConfig.setHttpOnly(Boolean.valueOf(value));
} else {
Object[] params = {name, value};
logger.log(Level.WARNING,
"webcontainer.invalidProperty",
params);