}
@Override
public void execute(HttpServletRequest request, HttpServletResponse response) throws TransformerException {
BeanEntityRequest beanParseRequest = new BeanEntityRequest(request);
if (beanParseRequest.getBeanref() == null)
throw new TransformerException("Bean not found.");
Object bean = factory.getBean(beanParseRequest.getBeanref());
List<ISetProperty> lst = new ArrayList<ISetProperty>();
Iterator<Map.Entry<String,String>> iter = beanParseRequest.getParameterIterator();
while (iter.hasNext()) {
final Map.Entry<String,String> element = (Map.Entry<String,String>) iter.next();
lst.add(new ISetProperty() {
public String getProperty() {
return element.getKey();
}
public String getValue() {
return element.getValue();
}
});
}
try {
PrintWriter out = response.getWriter();
Result result = new StreamResult(out);
XmlBindingFactory xbf = new XmlBindingFactory(lst);
xbf.setSAXTransformer(this);
AbstractXmlBinding<?> axb = xbf.create(beanParseRequest.getProtocol(), bean);
axb.transform(result);
} catch (Exception e) {
throw new TransformerException(e);
};
}