如何从我的servlet中检索隐藏输入[type = submit]的值

时间:2013-08-19 17:03:23

标签: html jsp servlets

正如标题所说,我如何从我的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>

web.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>

0 个答案:

没有答案