<%@ page contentType="text/html;charset=GB2312"%> <html> <body> <form action="e_4.jsp" method=get name=form> <p>输入出生日期: <input type="text" name="csn" size="4" maxlength="4"> 年 <input type="text" name="csy" size="2" maxlength="2"> 月 <br> <br> 性别: <input type="radio" name="xb" value="1">男 <input type="radio" name="xb" value="2">女 <br><br> <input type="submit" value="送出" name="submit"> </form> <% String getcsn=request.getParameter("csn"); String getcsy=request.getParameter("csy"); String getxb=request.getParameter("xb"); double jfn,jfy; double txn,txy; if((getcsn!=null)||(getcsy!=null)){ double valuecsn,valuecsy,valuexb; valuecsn=Double.valueOf(getcsn).doubleValue(); valuecsy=Double.valueOf(getcsy).doubleValue(); valuexb=Double.valueOf(getxb).doubleValue(); if(valuexb==1.0){ jfn=valuecsn+45; jfy=valuecsy; txn=valuecsn+60; txy=valuecsy; } else{ jfn=valuecsn+35; jfy=valuecsy; txn=valuecsn+50; txy=valuecsy; } out.print(jfn); } %> <br><br><br><br> <p>缴费日期:<%=jfn%>年<%=jfy%>月 <br> <p> 退休日期:<%=txn%>年<%=txy%>月 </body> </html>
在tomcat中为什么不行?出现以下问题?请大家帮忙解决!谢谢!
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP An error occurred at line: -1 in the jsp file: null Generated servlet error: [javac] Since fork is true, ignoring compiler setting. [javac] Compiling 1 source file [javac] Since fork is true, ignoring compiler setting. [javac] E:\java\tomcat\dist\work\Catalina\localhost\myweb\lx\e_4_jsp.java:87: variable jfn might not have been initialized [javac] out.write(String.valueOf(jfn)); [javac] ^ [javac] E:\java\tomcat\dist\work\Catalina\localhost\myweb\lx\e_4_jsp.java:89: variable jfy might not have been initialized [javac] out.write(String.valueOf(jfy)); [javac] ^ [javac] E:\java\tomcat\dist\work\Catalina\localhost\myweb\lx\e_4_jsp.java:93: variable txn might not have been initialized [javac] out.write(String.valueOf(txn)); [javac] ^ [javac] E:\java\tomcat\dist\work\Catalina\localhost\myweb\lx\e_4_jsp.java:95: variable txy might not have been initialized [javac] out.write(String.valueOf(txy)); [javac] ^ [javac] 4 errors