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

JSP与javasctipt
<%@   page   contentType= "text/html;   charset=GBK "   language= "java "   import= "xiangmu2.Jsp3Bean "%>
<%@page   pageEncoding= "GB2312 "%>
<%   request.setCharacterEncoding( "GB2312 ");%>
<html>
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 "   />
<title>
检索
</title>

<script   language= "javascript ">
<!--
function   sumitfunction()
{

    if(document.form1.text_content.value!= " "){
    //     String   aa=document.form1.text_content.value;

          alert(this.document.form1.text_content.value);


      <%
        Jsp3Bean   jsp3BeanId   =   new   Jsp3Bean();
        jsp3BeanId.setTitleUrl(request.getParameter( "text_content "));
        %>
//           window.location= "11.htm ";
            document.form1.submit();
    }
}
-->
</script>

</head>
<body>
<form   name= "form1 "   method= "post "   action= "11.htm ">
    <input   type= "text "   name= "text_content ">
    <input   type= "submit "   name= "Submit "   value= "提交 "   onclick= "sumitfunction() "   >
</form>
<%/*
String   textcontent=request.getParameter( "text_content ");

if(textcontent== " "   ||   textcontent==null)
{
      out.println( " ");
}   else   {
      Jsp3Bean   jsp3BeanId   =   new   Jsp3Bean();
      jsp3BeanId.setTitleUrl(textcontent);
      out.println(jsp3BeanId.getTitleUrl());
}   */
%>

</body>
</html>

------解决方案--------------------
我曰
------解决方案--------------------
楼主到底想问什么?
我测试了以上程序,是可以运行,不过不知道
<%
Jsp3Bean jsp3BeanId = new Jsp3Bean();
jsp3BeanId.setTitleUrl(request.getParameter( "text_content "));
%>
这一段有什么意义,虽然你对jsp3BeanId进行了赋值,但后面你并没有使用啊!
------解决方案--------------------
没有问题??