日期:2014-05-18  浏览次数:20921 次

下面程序为什么GET可以POST就不可以?
下面这个程序有点怪,   如果表单是这样的
<form   enctype= "multipart/form-data "   action= "submit.jsp "     method= "post "   name= "form1 ">
request收到的值全是NULL
而当改成
<form   enctype= "multipart/form-data "   action= "submit.jsp "     method= "get "   name= "form1 ">
时,   就能正确收到request值
这是为什么呢?


<%@   page   contentType= "text/html;   charset=gb2312 "   %>
<%@   page   language= "java "   import= "com.fredck.FCKeditor.* "   %>
<%@   page   import= "com.oa2007.tool.* "%>
<link   rel= "stylesheet "   type= "text/css "   href= "../../../../theme/1/style.css ">

<script   language= "javascript ">
function   highlight(obj){
var   hightlightBgColor   =   '#d6d6d6 ';
obj.onmouseover   =   function(){
var   o   =   event.srcElement;

if(o.tagName== "TD "){
with(o.parentElement){
style.backgroundColor   =   hightlightBgColor;
}
}
}

obj.onmouseout   =   function(){
var   o   =   event.srcElement;
if(o.tagName== "TD "){o.parentElement.style.backgroundColor   =   ' ';}
}
}

</script>


<html>
<head>
<title> 发布新闻 </title>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 ">

<script   Language= "JavaScript ">
function   CheckForm()
{
      if(document.form1.SUBJECT.value== " ")
      {   alert( "新闻的标题不能为空! ");
          return   (false);
      }


      return   (true);
}

function   sendForm()
{

    if(CheckForm())
      document.form1.submit();
}


</script>
</head>

<body   class= "bodycolor "   topmargin= "5 ">
<form   enctype= "multipart/form-data "   action= "submit.jsp "     method= "post "   name= "form1 ">
<table   border= "0 "   width= "100% "   cellspacing= "1 "   cellpadding= "0 "   class= "small ">
    <tr   class= "tablehead1 ">
        <td> <img   src= "../../../../images/notify_new.gif "   align= "absmiddle ">   新建新闻
        </td>
    </tr>
    <tr   class= "tablehead2 ">
    <td>
    <a   href= "# "   onclick= "sendForm(); "> <img   src= "../../../../images/button/issue.gif "   border= "0 "   title= "发布 "> </a>
    <a   href= "# "   onclick= "javascript:EDIT_HTML.location.reload() "> <img   src= "../../../../images/button/re