1

是否可以在没有名称或 ID 的情况下读取 servlet 中的表单数据?提交表单时浏览器是否会自动为输入字段分配默认名称/ID?

4

1 回答 1

0

It´s possible.

In a jsp you can write a param like this:

<html:hidden property="action" styleId="action"/>
<input type="hidden" name="validate"/>

the first param it written in struts and the second in a Web proyect.

From a servlet, you have access to the current HttpServletRequest request. In this request you can invoke the method request.getParameter("action") and request.getParameter("validate") and it returns a String.

I hope this help you. Marcos.

于 2012-12-12T07:57:49.603 回答