1 24 package org.riotfamily.website.generic.model.hibernate; 25 26 import javax.servlet.http.HttpServletRequest ; 27 28 34 public class DefaultParameterResolver extends AbstractParameterResolver { 35 36 private String attribute; 37 38 public void setAttribute(String attribute) { 39 this.attribute = attribute; 40 } 41 42 public String getAttribute() { 43 return attribute != null ? attribute : getName(); 44 } 45 46 public Object getValueInternal(HttpServletRequest request) { 47 Object value = request.getAttribute(getAttribute()); 48 if (value != null) { 49 return value; 50 } 51 String s = (String ) request.getParameter(getName()); 52 return (s == null || s.length() == 0) ? null : s; 53 } 54 55 } 56 | Popular Tags |