tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: NullPointerException with Parameters.getParameterValues(String)
Date Tue, 10 Apr 2007 12:26:33 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rashmi,

Rashmi Rubdi wrote:
> From looking at the following snippet I assume that username, password
> and logout are initialized as in:
> 
> String username ="username";
> String password ="password";
> String logout="logout";
> 
> If the above are not initialized then you would get NPE.

Huh? Are you suggesting that this will cause an NPE:

String username;

...

username = pageContext.getRequest().getParameter(username);


??!

That's simply not true.

Rahul, are you (or any of your filters) ever calling
Request.getInputStream or Request.getReader /before/ you make any calls
to Request.getParameter*()? If so, you could be tripping-up Tomcat's
ability to collect request parameters. I didn't think it would cause an
NPE... I thought it usually threw an IllegalStateException. Also, it
looks like Tomcat has assembled the Parameters object already... hmm...

- -chris

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

iD8DBQFGG4J59CaO5/Lv0PARApbGAJ9aaJGEkny6N/2qazHkfay+uMV9PgCghPFj
XA6iBhZvQHaKEgPxAgu5cZ0=
=FvGX
-----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