jsp页面向servlet传值

来源:互联网 发布:nginx不支持pathinfo 编辑:程序博客网 时间:2024/05/18 21:43
方法一
<form action="此处填写xml中配置的url-pattern,不要写成servlet的类名!" method="post">
<input type="submit">  
</form>

方法二
 首先使用jQuery之前一定记得导包!
<head>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js"></script>
<script  type="text/javascript">
        $(document).ready(function(){
    $("button").click(function(){
$.post("此处填写xml中配置的url-pattern,不要写成servlet的类名!",{
                             "figure":$(#figure).val() 
  
 });
});
});

</head>

<html>
<input id="figure">  要用id 或 class 标记 ,便于在js里面使用
<button id="transform"></button>  用button不用submit
</html>
原创粉丝点击