jsp问题,快疯掉了!
<html>  
        <body>  
  <% 
 	TeacherVo   tv=new   TeacherVo(); 
 	String   tnos   =   tool.formatString(request.getParameter( "tno ")); 
 	tv.setTname(request.getParameter( "tname ")); 
 	tv.setTpassword(request.getParameter( "tpassword ")); 
 	tv.setTtel(request.getParameter( "ttel ")); 
 	tv.setTaddress(request.getParameter( "taddress ")); 
 	if(!tnos.equals( " "))		 
 	{ 
 		int   tno   =   Integer.parseInt(tnos); 
 		tv.setTno(tno); 
 	} 
 	try{ 
 		if(!tnos.equals( " "))		 
 		{ 
 			DAOFactory.getTeacherDAOInstance().update(tv);  		 
 %>  
 		   教师信息插入成功请 <a   href= " "> 返回 </a> 。 
  <%   			 
 		} 
 		else   { 
 			DAOFactory.getTeacherDAOInstance().insert(tv); 
 %>  
 		教师信息修改成功请 <a   href= " "> 返回 </a> 。 
  <%     			 
 		} 
 	}catch(Exception   e){  	 
 %>  
    		数据库操作发生错误错误! <a   href= " "> 请返回! </a>  <%e.printStackTrace();   %>  
  <%    
    	} 
 %>  
        </body>  
  </html>      
 从别的页面传过来,其中request.getParameter( "tno "))明明是空的, 
 在这个页面怎么会报:  
java.lang.NumberFormatException:   For   input   string:    "null " 
 	java.lang.
NumberFormatException.forInputString(Unknown   Source) 
 	java.lang.Integer.parseInt(Unknown   Source) 
 错呢。根本就没有走 
 int   tno   =   Integer.parseInt(tnos); 
 这句啊??!! 
 郁闷坏了。
------解决方案--------------------你的tnos分明是null,转成String就是 "NULL ",当然要执行 
 if(!tnos.equals( " "))这个里面的内容了
------解决方案--------------------先判断一下: 
 if(null!=request.getParameter( "tno ")) 
 { 
   String tnos = tool.formatString(request.getParameter( "tno ")); 
 }
------解决方案--------------------可以自己写过class 
 如 
 public class StringUtil{ 
   public static String formatString(String tempValue,String defaultValue){ 
     if(tempValue==null||tempValue.equals( " ")){ 
       tempValue=defaultValue; 
     } 
    return tempValue; 
   } 
 }   
 调用的时候可以 
 String tno=SystemUtil.formatString(request.getParameter( "tno "), "空值 "); 
 如果提交过来的是null值或空值,则设为默认值 "空值 ", 
 这样写的话,对于维护性很好,