正如标题所说,如何从我的 servlet 中检索隐藏输入 [type=submit] 的值?
我试过这条线,但它对我不起作用,ModifPost servlet:
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String type = (String) request.getAttribute("type");
}
知道我的 JSP 中有这个:
<form method="post" action="<c:url value="/modifpost"/>" class="sansRetourLigne">
<input type="text" disabled style="visibility: hidden;" class="sansRetourLigne" name="type" value="p" />
</form>
网页.xml:
<servlet>
<servlet-name>ModifPost</servlet-name>
<servlet-class>com.forum.servlets.ModifPost</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>ModifPost</servlet-name>
<url-pattern>/modifpost</url-pattern>
</servlet-mapping>