我已经开始学习GWT了,我想知道是否有可能在GWT中为用户注册等过程创建表单,然后处理注册逻辑(额外验证,将数据添加到数据库等)在一个弹簧控制器。到目前为止,我一直无法在网上找到资源来做到这一点,所以我猜测我后来可能无法做到。这只能使用扩展RemoteServiceServlet
的类来完成,如this视频教程中所示?访问来自Spring控制器的GWT表格值
我试图从我的弹簧控制器使用request.getParameter()
方法调用来访问数据,我注意到当我使用Post方法时,我无法访问表单参数,但是当我使用Get时,我可以访问它们。这是一些我使用的代码:
GWT:
HorizontalPanel hrzPnlname = new HorizontalPanel();
hrzPnlname.add(new Label("User Name: "));
final TextBox txtUserName = new TextBox();
txtUserName.setName("userName");
hrzPnlname.add(txtUserName);...
春:
@RequestMapping(method = RequestMethod.POST)
public ModelAndView helloWorldFromForm(HttpServletRequest request)
{
Map<String, Object> model = new HashMap<String, Object>();
System.out.println("------>\n\n\n\n\n\n" + request.getParameter("userName") + "\n\n\n\n\n<-------");...
我使用GWT 2.4。任何有关此信息将不胜感激。
谢谢!
谢谢,我现在正在测试它。 – npinti 2012-01-17 08:41:51