在我的一个protected ActionForward handleDelivery里面有一句return mapping.findForward( "BUY_CONTENT_TKU" );如果BUY_CONTENT_TKU并不存在,那么return以后会发生什么

解决方案 »

  1.   

    怎样做一个判断,当拿不到BUY_CONTENT_TKU的值的时候,就不做return mapping.findForward( "BUY_CONTENT_TKU" ); 
      

  2.   

    从一本书上面找到If the findForward( ) method does not find a forward that matches the name argument, it will not complain. A null will be returned, and you will receive a blank page because no output will be written to the response. 就是说找不到的话,会返回一个null但是实际上,我用
    mapping.findForward( "BUY_CONTENT_TKU" )==null ? "null":"not null"
    来做判断,发现返回为not null这样就觉得很奇怪
      

  3.   

    你加了引号,return的是一个字符串
    和BUY_CONTENT_TKU本身有什么关系?
      

  4.   

    返回的应该是: struts-config.xml中action 中的input 属性值
      

  5.   

    mapping.findForward( "BUY_CONTENT_TKU" ); 
    如果findForward方法没有找到匹配的ActionForward对象,不会抛出异常,而是返回NULL,在浏览器,用户收到空白页
      

  6.   

    会跳转到structs配置文件中以BUY_CONTENT_TKU为id的forword的一个.jsp页面上。