火星文 技术研习社

Noname Cat, Keep Thinking
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

Servlet 初始设定值校验

Posted on 2006-12-02 20:32  剑廿三  阅读(186)  评论(0编辑  收藏  举报
若 web.xml 中有
    <init-param>
     <param-name>username</param-name>
     <param-value></param-value>
    </init-param>

那么 init(ServletConfig config) 中得到的 username.equals("") 是 true

若 web.xml 中没有以上定义,则 username == null 是 true