Detecting Device Type in a web application

You’ll have to read the User-Agent header from the request and decide on that. In vanilla servlet apps, a crude way of doing it is: public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if(request.getHeader(“User-Agent”).contains(“Mobi”)) { //you’re in mobile land } else { //nope, this is probably a desktop } }

ClassCastException when casting to the same class

I am not quite following your description of the program flow, but usually when you get ClassCastExceptions you cannot explain you have loaded the class with one classloader then try to cast it to the same class loaded by another classloader. This will not work – they are represented by two different Class objects inside … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)