一个jsp中向servlet中传递数据的问题 <td><a href="showone?id= <%=user.getId() %>">修改</a></td> 20
展开全部
JSP页面有3种方法向 servlet传值: form表单、URL 、其他<pre t="code" l="html"><!-- JSP page -->
<%
session.setAttribute("testSession","Hello session");
reqeust.setAttribute("testRequest","Hello request");
%>
<a href="JspServlet?action=toServlet">click me</a>
<form action="JspServlet?action=toServlet" method="post" name="form">
<input name="username" type="test" />
<input type="submit" value="submit">
</form>
<%
session.setAttribute("testSession","Hello session");
reqeust.setAttribute("testRequest","Hello request");
%>
<a href="JspServlet?action=toServlet">click me</a>
<form action="JspServlet?action=toServlet" method="post" name="form">
<input name="username" type="test" />
<input type="submit" value="submit">
</form>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询