tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: getAttribute(null)?
Date Thu, 12 Jun 2008 20:30:26 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jonathan,

Leffingwell, Jonathan R CTR FRCSE, JAX 7.2.2 wrote:
| I have the following code that worked in Tomcat 5.0, but doesn't work in
| Tomcat 5.5.26:
|
| String formName = mapping.getAttribute();   // mapping is a variable of
| type ActionMapping. In this scenario, formName is null.

[snip]

| formName is null.  In Tomcat 5.0.x, no exception was thrown and
| processing continued (as if passing a null argument to getAttribute
| simply returned NULL).  In Tomcat 5.5.26, a ServletException is thrown
| (with a NullPointerException).
|
| I know how to code a work-around (and have done so), but is this
| considered a bug in Tomcat?

The servlet specification does not prohibit a NullPointerException from
being thrown, but it does seem like the method should probably return
null rather than throwing an NPE.

Could you post the stack trace of the exception?

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkhRh2IACgkQ9CaO5/Lv0PAOOgCfUWeV+OsSiqYjmkb24ueCduk4
BkMAn1bwrj3MldbyadbsKIWmPWrE9yVL
=IoqQ
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message