首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

在tomcat中,执行jsp既不报错,也不显示,不是错误捕获的有关问题

2012-01-31 
在tomcat中,执行jsp既不报错,也不显示,不是异常捕获的问题下面是jsp代码%@pagecontentType text/htmlc

在tomcat中,执行jsp既不报错,也不显示,不是异常捕获的问题
下面是jsp代码

    <%@page   contentType= "text/html;   charset=GBK "   %>
<html>
  <head>
    <title> 呆呆 </title>

    <script>
          alert( "javascript ");
          function   show(){
      var   oForm   =   document.form1;
      var   oText   =   oForm.currentPage;
      var   oText1   =   oForm.rowNum;
      alert(oText.value);
      alert(oText1.value);
      oForm.submit();
  }
    </script>
  </head>
  <body   onload= "javascript:alert( '   enter   body ') ">
    <%

                int   currentPage   =   0;
      int   rowNum   =   0;
      int   page1   =   0;
    out.println( "currentPage   ===   "+currentPage);
    out.println( "rowNum   ===   "+rowNum);
            currentPage++;
    rowNum++;
            page1   ++;
    /*
    if(page1   =   null){

            page   =   1;
    }
    else{
          page   =   Integer.parseInt(page1);
    }
    out.print( "page   ===   "+page1);
    */
    %>
    <table>
          <form   name= "form1 ">
            <input   type= "text "   name   =   "currentPage "   value   =   " <%=   currentPage   %> "   />
                      <input   type= "text "   name   =   "rowNum "   value   =   " <%=   rowNum   %> "   />
              <input   type= "button "   name   =   "button1 "   value   =   "下一页 "   onclick= "show() "   />
    <a   href= "send.jsp?page= <%=   page1+1   %> ">   xia </a>
  </form>
    </table>
  </body>
</html>

这个是没错的,但是随便改错一个,就既不报错,也不显示
请问是怎么回事情??????????

[解决办法]
看tomcat的logs目录下的log日志错误记录找错误
[解决办法]
同意1楼的,看看log日志里的记录
[解决办法]
你应当这样

<html>
<head>
<title> 呆呆 </title>

<script>
alert( "javascript ");
function show(){
var oForm = document.form1;
var oText = oForm.currentPage;


var oText1 = oForm.rowNum;
alert(oText.value);
alert(oText1.value);
oForm.submit();
}
</script>
</head>
<body onload= "javascript:alert( ' enter body ') ">
<%

int currentPage = 0;
if(request.getParameter( "currentPage ") != null)
{
currentPage = Integer.parseInt(request.getParameter( "currentPage "));
}
int rowNum = 0;
int page1 = 0;
out.println( "currentPage === "+currentPage);
out.println( "rowNum === "+rowNum);
currentPage++;
rowNum++;
page1 ++;
/*
if(page1 = null){

page = 1;
}
else{
page = Integer.parseInt(page1);
}
out.print( "page === "+page1);
*/
%>

<form name= "form1 ">
<input type= "text " name = "currentPage " value = " <%= currentPage %> " />
<input type= "text " name = "rowNum " value = " <%= rowNum %> " />
<input type= "button " name = "button1 " value = "下一页 " onclick= "show() " />
<a href= "send.jsp?page= <%= page1+1 %> "> xia </a>

</table>
</body>
</html>

热点排行