JavaWeb----thymeleaf小项目
《相关资源以及比我写的更加详细的博客》
资源:https://heavy_code_industry.gitee.io/code_heavy_industry/pro001-javaweb/lecture/
博客:https://blog.csdn.net/jsdoulaoula/article/details/124121517
《其中Serlvet让我恍然大悟的细节》
《在html页面中的路径问题》
《关于页面跳转以及访问的一些基本问题解释》
在IndexServlet中
表示处理路径为/index时找IndexServlet处理
表示进行动态渲染index.html页面(当然这是通过项目.xml文件配置才行的)
在index.html中
如果点击了这个连接则会跳到/editor.do路径中并且携带参数(这个是thymeleaf语法)
如:
在EditorServlet中:
我设置了如果访问了/editor.do,那么就会经过处理后通过
渲染editor.html页面
在editor.html中:
当我提交时,就会跳转到/update.do中,
在UpdateServlet中:
我设置了如果访问了/update.do那么就通过操作修改,并重定向,即再次访问/index
然后由于
这个设置,/index中的数据将更新