qrlozte

举个例子,你在web-root文件夹有个a.html需要向/web-root/jsp/b.jsp提交form,怎么做

网上看到了一个解决方案,但是要求a是jsp页面而不是html页面

<%!String basePath=request.getContextPath();%>
<form action="<%=basePath%>\sub\submit.jsp" method="post"> 
</form>

我搜到的一个解决方案如下,可用:

<form action=".\jsp\input_bean.jsp" method="post">
    姓名:<input type="text" name="name"><br>
    年龄:<input type="text" name="age"><br>
    <input type="submit" value="提交">
    <input type="reset" value="重置">
</form>

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-02-10
  • 2022-02-25
  • 2021-09-29
  • 2021-08-06
  • 2021-09-29
猜你喜欢
  • 2021-08-06
  • 2021-08-06
  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
  • 2021-08-06
相关资源
相似解决方案