/*
* Created on 2006-3-23
* TODO
* author:gf
*/
package com.gc.action;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;
public class HelloWorldAction implements Controller {
private String helloWorld;
private String viewPage;
public ModelAndView handleRequest(HttpServletRequest req,
HttpServletResponse res) throws ServletException, IOException {
Map model = new HashMap();
model.put("helloWorld", getHelloWorld());
return new ModelAndView(getViewPage(), model);
}
public void setViewPage(String viewPage) {
this.viewPage = viewPage;
}
public String getViewPage() {
return viewPage;
}
public void setHelloWorld(String helloWorld) {
this.helloWorld = helloWorld;
}
public String getHelloWorld() {
return helloWorld;
}
}
评论6
最新资源