当前位置:K88软件开发文章中心编程语言JavaSpring → 文章内容

Spring MVC 表单处理例子

减小字体 增大字体 作者:佚名  来源:网上搜集  发布时间:2019-1-15 16:21:12

ad><body><h2>Submitted Student Information</h2> <table> <tr> <td>Name</td> <td>${name}</td> </tr> <tr> <td>Age</td> <td>${age}</td> </tr> <tr> <td>ID</td> <td>${id}</td> </tr></table> </body></html>最后,下面是包含在你的 web 应用程序中的 Spring 和其他库的列表。你仅仅需要将这些文件拖拽到 WebContent/WEB-INF/lib 文件夹中。commons-logging-x.y.z.jarorg.springframework.asm-x.y.z.jarorg.springframework.beans-x.y.z.jarorg.springframework.context-x.y.z.jarorg.springframework.core-x.y.z.jarorg.springframework.expression-x.y.z.jarorg.springframework.web.servlet-x.y.z.jarorg.springframework.web-x.y.z.jarspring-web.jar一旦你完成了创建源代码和配置文件后,导出你的应用程序。右键单击你的应用程序,并且使用 Export > WAR File 选项,并且在 Tomcat 的 webapps 文件夹中保存你的 HelloWeb.war 文件。现在启动你的 Tomcat 服务器,并且确保你能够使用标准的浏览器访问 webapps 文件夹中的其他 web 页面。现在尝试访问该 URL http://localhost:8080/HelloWeb/student。如果你的 Spring Web 应用程序一切都正常,你应该看到下面的结果:在提交必需的信息之后,单击提交按钮来提交这个表单。如果你的 Spring Web 应用程序一切都正常,你应该看到下面的结果:

上一页  [1] [2] 


Spring MVC 表单处理例子