package test.dwr;
import javax.servlet.http.HttpServletRequest;
import uk.ltd.getahead.dwr.WebContext;
import uk.ltd.getahead.dwr.WebContextFactory;
public class MessageDao {
public Message save(Message message) {
WebContext ctx = WebContextFactory.get();
HttpServletRequest req = ctx.getHttpServletRequest();
System.out.println("========HttpServletRequest Begin=======");
System.out.println("req:" + req.getRemoteHost());
System.out.println("req-session:" + req.getSession().getAttribute("dwr"));
System.out.println("text:" + req.getParameter("text"));
System.out.println("from:" + req.getParameter("from"));
System.out.println("=========HttpServletRequest End========");
System.out.println("========Lucky DWR Begin=======");
System.out.println("text:" + message.getText());
System.out.println("from:" + message.getFrom());
System.out.println("=========Lucky DWR End========");
return message;
}
public Message get() {
return new Message("This is the first dwr demo!", "test");
}
}
|