package com.atomikos.tomcat.web;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.view.AbstractView;

public class ViewBuilder extends AbstractView {

	public ViewBuilder() {
		setContentType("text/plain");
	}

	@Override
	protected void renderMergedOutputModel(Map<String, Object> model,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		Account account = (Account) model.get("account");
		String message = "balance is " + account.getAmount() + " for account "
				+ account.getAccount();
		response.getWriter().write(message);
	}

}
