Checking user agent in cassette

I am using wicket 1.5 and I cannot see in the getClientInfo() method

 (WebRequest)RequestCycle.get().getRequest() 

I saw another place of this code

 WebClientInfo clientInfo = (WebClientInfo)WebRequestCycle.get().getClientInfo(); 

But I can not see any WebRequestCycle in Wicket 1.5.

Any ideas on user agent verification in Wicket 1.5?

+4
source share
2 answers

The easiest way is to use

 WebSession.get().getClientInfo().getUserAgent(); 
+10
source

You can also do:

 ((WebRequest) getRequest()).getHeader("User-Agent") 
+2
source

Source: https://habr.com/ru/post/1414042/


All Articles