Magazine
 

Tips & Tricks

 
}
Compile and run this program:

Output:
After running this program, you get:

If you click “Add Tab” button then the input box appears on the screen:

Suppose, you fill “Java” in the input box and click the “OK” button:

After clicking the “OK” button, you get a tab named “Java”.

 

you don’t give any name to the input box then it gives:

In the same way, you can add many tabs. For example, here is one more tab named “JavaJazzUp” in the figure below:

3. Sending jar file as a Servlet Response 

Sometimes, the user needs to download any jar file. This is the example where the “SendJar” servlet is responsible to send the jar file to the user when requested. This code is given below. The important part of this program is to set the content type, which intimates the browser about the type of content to be sent by the servlet. An HTTP response header named

Nov 2007 | Java Jazz Up | 59
previous
index
next
 
View All Topics
All Pages of this Issue
Pages: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,

30
, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53 , 54, 55, 56, 57,

58
, 59, 60, 61, 62, 63 , 64, 65 , 66 , 67 , 68 , 69   Download PDF