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 / [email protected]


On Fri, Jan 4, 2019 at 1:27 AM kapil gupta <[email protected]> wrote:

> This is for request.getParameter
>
> Thanks
>
> On Fri, Jan 4, 2019 at 12:30 PM kapil gupta <[email protected]>
> wrote:
>
>> Hi,
>>
>> 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.
>>
>> Thanks
>>
>> _______________________________________________
> jetty-users mailing list
> [email protected]
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://www.eclipse.org/mailman/listinfo/jetty-users
_______________________________________________
jetty-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://www.eclipse.org/mailman/listinfo/jetty-users

Reply via email to