Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] String "" in Jetty 8 vs Jetty 9

The fact that it worked for you in Jetty 8 is just luck.
You accidentally found a way on your JVM to have that work for you in a way that seemed reliable to you.

As Mark Mielke pointed out, that code is wrong, and shouldn't have worked in the first place, even on Jetty 8.

Also note that getParameter(String keyname) can return 3 different states:

1. The value of the keyname as a String
2. Empty String (indicating the keyname exists, but without a value, aka "?foo" )
3. null (indicating the keyname does not exist)

Joakim Erdfelt / joakim@xxxxxxxxxxx

On Fri, Jan 4, 2019 at 1:27 AM kapil gupta <kapilgupta82@xxxxxxxxx> wrote:
This is for request.getParameter


On Fri, Jan 4, 2019 at 12:30 PM kapil gupta <kapilgupta82@xxxxxxxxx> wrote:

We were using Jetty 8 and now trying to upgrade on Jetty 9. The below piece of code has different results in both versions of Jetty.

if (a != "") 

Where a is string variable. 

I understand the code is wrong, we should always use a.equals for comparison. But we have it at so many places, but not sure why Jetty 8 and Jetty 9 have different results for it.

Please let me know.


jetty-users mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Back to the top