One correction. In url patern there is a forward slash prefixed before the string. So if in jsp string was: action="servlet/com.onjava.login", in xml it will be
<url-pattern>/servlet/com.onjava.login</url-pattern>