public void doPost(HttpServletRequest req, HttpServletResponse resp)
{
redraw(getColor(req));
}
private void redraw(Color newBackgroundColor) {
getWindow().setBackground(newBackgroundColor);
}
private Color getColor(HttpServletRequest req) {
String color = req.getParameter(ATTRIB_NAME);
Color result = (color == null) ? Color.black : Color.getColor(color);
return result;
}
private Window getWindow() {
return null;
}
private static final String ATTRIB_NAME = "color";
|
|