1、<A href="/YourServletName( with webpath)?param1=XXX¶m2=XXX">click to call Servlet</A>
2<FORM method="post" action=""/YourServletName( with webpath)">
<TABLE>
<TR><TD><Input type="text" name="param1"></TD></TR>
<TR><TD><Input type="text" name="param2></TD></TR>
<TR><TD><Input type="submit"></TD></TR>
</TABLE>
</form>
2<FORM method="post" action=""/YourServletName( with webpath)">
<TABLE>
<TR><TD><Input type="text" name="param1"></TD></TR>
<TR><TD><Input type="text" name="param2></TD></TR>
<TR><TD><Input type="submit"></TD></TR>
</TABLE>
</form>
解决方案 »
- 在线等高手帮忙!表单提交到数据库,但是前台无法显示数据库里的内容
- 关于SSH2 多条件查询后并分页的问题 防注入
- 在tomcat里添加虚拟目录,之后不能启动tomcat
- 如何调试struts2源码
- 如何当用户选择了Select中的一项,根据其值从数据库读取相应的数据到另外一个Select下拉列表中?
- 测试连接SQL Server 2000出现HTTP Status 500
- 求hibenate jdo o/r映射代码
- 报错..
- *****如何学好JSP的问题******
- 调查:各位用什么编辑JSP?
- 有关ServletContext......
- 诸位大瞎:jsp中不能写方法,可能是因为这个页面里的所有语句都在某个方法中。 我想问一下,怎么复用某个页面里的程序呢? 不用 bean,因为程序要显示很多 html,用 include 也不行,因为 页面有传入参数。
The method I need is method 1. But when servlet gets the request and try to getContentType, return value is null. I do not know why. Do u have any suggestion?
{
String param1 = req.getParameter("param1");
String param2 = req.getParameter("param2");
// your code here
}