Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The javax.servlet.http package is part of the servlet API. The relevant jars can be found in Java EE containers (such as Sun's Glassfish) or stand-alone servlet containers (like Apache's Tomcat). Essentially, these are Java web servers.</p> <p>In order to compile code that depends on it, you will have to add the servlet library to your dependencies. Exactly how that is done depends on the tools you are using.</p> <p>Are you building a web application? (Is the expected output a .war or .ear file?) Does the source come bundled with a <code>build.xml</code> (probably an <a href="http://ant.apache.org/" rel="nofollow noreferrer">Ant</a> build), any <code>pom.xml</code> files (probably a <a href="http://maven.apache.org/" rel="nofollow noreferrer">Maven</a> build) or any <code>.project/.classpath</code> files (probably an <a href="http://www.eclipse.org/" rel="nofollow noreferrer">Eclipse</a> project)?</p> <hr> <blockquote> <p>The scenario is this. Asp.net 1.1 having a javaapplet on a page calling a webservice. Javaapplet should detect the user preferred language in .net you do HttpContext.Current.Request.UserLanguages[0] so i asked and apparently in java the equivalent is request.getLocale();</p> </blockquote> <p>OK, ignore what I said above. To get the <a href="http://java.sun.com/javase/6/docs/api/java/util/Locale.html#getDefault()" rel="nofollow noreferrer">Locale</a> in an Applet, I imagine you would just use:</p> <pre><code>Locale userLocale = Locale.getDefault(); </code></pre> <p>On a Java web server, you would use <code>request.getLocale()</code> to pick up the user's locale from the HTTP request. Applets run on the client.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload