How to find the host from which the Applet has originated ?,Java, C ,C++, ASP, ASP.net C# ,Struts ,Questions & Answer, Struts2, Ajax, Hibernate, Swing ,JSP , Servlet, J2EE ,Core Java ,Stping, VC++, HTML, DHTML, JAVASCRIPT, VB ,CSS, interview ,questions, and answers, for,experienced, and fresher
How to find the host from which the Applet has originated ?

Two methods help here:public java.net.URL getDocumentBase();public java.net.URL getCodeBase(); 

The getDocumentBase() returns the URL to the host that server the HTML document.The getCodeBase() returns the URL to where the original applet class was loaded from.

More interview questions and answers
What is the difference between an array and a vector ?
What is singleton class ?
What is constructor ?
What is casting ?
What is the difference between final, finally and finalize ?
What is mean by packages in java?
Name 5 calsses you have used ?
Name 2 classes that can store arbitrary number of objects ?
What is the difference between java.applet.* and java.applet.Applet ?
What is a default package ?
What is anonymous class ?
What is the use of an interface ?
What is a serializable interface ?
How to prevent field from serialization ?
What is the difference between throw and throws ?
Can multiple catch statements be used in exceptions ?
Is it possible to write a try within a try statement ?
What is mean by a Thread ?
What is mean by multi-threading ?
What is the 2 way of creating a thread ? Which is the best way and why?
What is the method to find if a thread is active or not ?
What is the difference between sleep and suspend ?
Can thread become a member of another thread ?
What are the three types of priority ?
Garbage collector thread belongs to which priority ?
What is the use of this ?
How can you find the length and capacity of a string buffer ?
How to compare two strings ?
What is the purpose of run-time class and system class?
What is the method used to clear the buffer ?
What is mean by Stream Tokenizer ?
What is serialization and de-serialisation ?
What is mean by Applet ?
How to find the host from which the Applet has originated ?
What is the life cycle of an Applet ?
How do you load an HTML page from an Applet ?
What is mean by getCodeBase and getDocumentBase method ?
What is the use of parameter tag ?
What is the difference between getAppletInfo and getParameterInfo ?
How to communicate between applet and an applet ?
What is mean by event handling ?
What are all the listeners in java and explain ?
What is mean by an adapter class ?
What are the types of mouse event listeners ?
What are the types of methods in mouse listeners ?
What is the difference between panel and frame ?
What is the default layout of the panel and frame ?
What is the difference between list and choice ?
What are the different types of Layouts ?
What is mean by CardLayout ?
What is the difference between GridLayout and GridBagLayout?
Which class has no duplicate elements ?
What is mean by Swing ?
What is the difference between an applet and a Japplet?
What are all the components used in Swing ?
What is mean by tab pans ?
What is the use of JTree ?
What is the use of JTable ?
What is mean by JFC ?
What is JAR file ?
What is mean by manifest files ?
What is two properties in Beans ?
What is the use of beaninfo ?
What are the interfaces you used in Beans ?
What are the classes you used in Beans ?
What is the difference between C++ & Java ?
What is the difference between Process and Threads ?
How will you initialize an Applet ?
What is the order of method invocation in an Applet ?
When is update method called ?
What is JNI ?
What is the base class for all swing components ?
Is there any tag in HTML to upload and download files ?
What is the Layout for ToolBar ?
How will you add panel to a Frame ?
What is the corresponding Layout for Card in Swing ?
What is light weight component ?
What is difference in between Java Class and Bean ?
Diff between Application and Applet ?
What is the use of Interface ?
Why Java is not fully objective oriented ?
What it the root class for all Java classes ?
What is the exact difference in between Unicast and Multicast object ? Where we will use ?
Why there are some null interface in java ? What does it mean ?
What is latest versions in JAVA related areas ?
What is mean by class loader ? How many types are there? When will we use them ?
public static void main - Explain?
What is difference between String & StringBuffer?
What is Wrapper class. Is String a Wrapper Class?
What is Default modifier in Interface?
Can abstract be declared as Final?
Can we declare variables inside a method as Final Variables?
How can a dead thread be started?
Can Applet have constructors?
What is Checked & Unchecked exception?
Explain. Two types of multi-tasking.
Explain I/O Filter.
Can applet in different page communicate with each other?
How many nodes do a complete full binary tree with 10 leaves have?
What is server code and client code in C#?