Servlets & Servers
Q: I am currently running Microsoft s IIS server. I have the Java Virtual machine
installed on this system. What else will I need to run my servlet. Do need the Apache
web server instead? Will IIS support Java servlet?
Answer: You will need a Servlet Engine to run your servlets. 
You can use either Allaire s JRun (http://www.jrun.com) or Tomcat
(http://jakarta.apache.org).
Both of them work with IIS.
  
Madhusudhanan Challur
 Q: How can I avoid browser caching?
In an applet, I call the function showDocument to send a GET message to one of my
servlets, which sends me back a PDF file dynamically generated by this servlet.
My problem is : the browser (in this case IE) always sends me back a PDF file with
the same content.
Answer 1: There are a few possibilities to avoid this problem.
A simple workaround is to add a random number URL variable with the request, such
as "ranx" with a value of the milliseconds since midnight. This will make the request
unique and, hence, avoid browser caching.
by Duane Morse
Answer 2: There are two other response setHeader attributes you can set:
response.setHeader("pragma", "no cache");
response.setHeader("Cache Control", "no cache");
response.setDateHeader("Expires", 0 )
Just in case.
Doug Schwartz
Answer 3: // for Answer 1 and 2 please go to yesterday s tip.
When you generate the PDF file, make sure you set the header to tell the browser
that the file will expire at a certain time. The browser should not cache the response
past the given time. The Java code looks something like
this:
import java.text.SimpleDateFormat;
import java.util.Date;
SimpleDateFormat dateFormat
= new SimpleDateFormat("EEE, dd MMM yyyy   HH:mm:ss z");
response.setHeader("Expires", dateFormat.format(new Date()));
The format of the date is very particular.
   
Scott Gartner
 Q: Wich free software can I use to debug Servlets?
Answer: What you need to do is use Jakarta Tomcat to run your servlets. Then, bring
in all the tomcat jars into your "required libraries".
Then set up your "project run" to actually run the Tomcat class. If you run it in debug
file:///F|/a_jsite/350_tips/servlets_servers.htm (6 of 7) [2001 07 08 11:24:58]






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

java web hosting

 

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved