Awesome, thanks! This works perfectly fine with me. Thanks a ton, @Joakim Erdfelt <joa...@webtide.com>
Best, Aniruddha ======== ᐧ On Tue, Jul 6, 2021 at 3:06 PM Joakim Erdfelt <joa...@webtide.com> wrote: > Ah, I missed that you were on Jetty 11. > > The request.getHttpFields() is an immutable object starting in Jetty > 10.0.0. > > No worries, do this ... > > HttpFields.Mutable replacement = HttpFields.build(request.getHttpFields()) > .put("X-Request-ID", UUID.randomUUID().toString().toUpperCase()); > request.setHttpFields(replacement); > > > Joakim Erdfelt / joa...@webtide.com > > > On Tue, Jul 6, 2021 at 5:00 PM Aniruddha Tekade <atek...@cloudian.com> > wrote: > >> Hi all, >> >> I actually posted this question on stackoverflow earlier. I am using >> Jetty 11 and I am trying to add a custom header into httpServletRequest in >> my handler class. >> >> Thanks to @Joakim Erdfelt <joa...@webtide.com> for introducing me to >> HttpChannel.Listener. I followed his solution from stack-overflow comment >> but stuck at finding the put() method. Here are my details: >> >> 1. I created a class RequestChannelListener implements >> HttpChannel.Listener >> 2. Created an instance of this class >> 3. Added as bean into connector in main method of the project >> 4. Within RequestChannelListener - I implemented method >> onRequestBegin(Request request) and used this - >> >> public class RequestChannelListener implements HttpChannel.Listener { >> @Override >> public void onRequestBegin(Request request) { >> request.getHttpFields().put("X-Request-ID", >> UUID.randomUUID().toString().toUpperCase()); >> } >> } >> >> But I am not able to find the put method. Any suggestions? >> >> >> Best, >> Aniruddha >> ======== >> ᐧ >> >
_______________________________________________ jetty-users mailing list jetty-users@eclipse.org To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jetty-users