Re: What governs a URL connection timeout?

2010-02-25 Thread Stephan van Loendersloot

On 25-02-10 18:37, Chris Mannion wrote:

Very helpful advice.  I can't help but feel a little out of my depth
with this one :-\

   


Hi Chris,

You may want to check if your JVM is started with one of the following
options:

-Dsun.net.client.defaultConnectTimeout=value in milliseconds
-Dsun.net.client.defaultReadTimeout=value in milliseconds

For both of these the default is -1, which means no timeout is set.

For more information:
http://java.sun.com/j2se/1.5.0/docs/guide/net/properties.html

Regards,

Stephan.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 5.0.28 is showing an old applets

2006-08-28 Thread Stephan van Loendersloot
This solution will not work, probably it was Mansour's unintentional 
typo. I think he meant to say:


applet code=MyClass.class  archive=MyArchive.jar?=?php print 
date('U') ? width=xx height=xx


This might work, haven't tried it myself, but I do know that does when 
it comes to caching of images.


Anyway, I recognise the problem of the OP when I was still using classic 
ASP or PHP (a long time ago ;-) ), but since this is a Java/JSP related 
issue, the above solution may not make any sense to the people reading 
this newsgroup.


The recommended way of including embedded objects, like JAR's or Flash 
movies, has always been a pain because of the way different browsers 
interpret these things (EMBED or OBJECT... etc..).


The JSP specification has a nice way of including JAR's (jsp:plugin... 
/), which tries to determine how the requesting browser likes to 
include an embedded object. However, you're not allowed to use variables 
to specify the name of the JAR with this built-in function.


Nowadays, it even becomes harder because of the patent-violation that 
Microsoft has with EOLAS, regarding the way-of-loading-plug-ins in 
Internet Explorer. It requires a visitor to click on an embedded object 
to active it before use.


Microsoft's preferred solution is to load the embedded object through 
scripting, which indeed solves the problems of loading embedded object 
in Internet Explorer 
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/activating_activex.asp.



(Please note, that I do not endorse Microsoft in ANY way, the policy of 
my company is that we make sure that our applications work and look the 
same in IE (Windows), Firefox (Multi-platform), and Konqueror (Linux) at 
least).


This still doesn't solve the solve the problem of the OP, but there are 
ways to do this...


My solution back in the days of using Classic ASP or PHP was to generate 
a JAR with the name it intended to have (i.e. 
'C:\internet\www.mydomain.com\securedapplet.jar') in a directory which 
wasn't accessible by the web browser. When the page that was responsible 
for delivering the JAR to the browser was requested, that page would 
create a unique random name for that JAR for that request, and copy the 
original file to a directory accessible by the webserver (i.e. 
'C:\internet\www.mydomain.com\www\applets\mysecuredapplet1234567.jar' 
and serve that file, for each request. Of course, before each request, 
it would *try* to delete every other file in that directory before the 
copy. This worked, because if an existing 
'C:\internet\www.mydomain.com\www\applets\uniquename'.jar that existed, 
but was in use by another request by a random user could not be deleted, 
so it was skipped but deleted the next time a request was made.


This also meant, that I didn't have to ask my clients to clear their 
plug-in cache or browser-cache every time I made an update to the JAR.


Now, how do we create a solution for the problem of renaming the JAR 
during the copy while still using it in the standard JSP solution?


I have a few solutions to this, though I'd rather see that the JSP 
specification would allow for having variable EL expressions for the JAR 
and other's in the jsp:plugin... / tag.


My solutions are something for tomorrow, or the day after, since it's my 
birthday today and though I have two days off, I've been slightly 
celebrating. These few glasses of wine make me become unstable.


I hope I didn't make it too confusing... the proposed solutions 
shouldn't be too hard. Let me now if anyone's interested and I'll reply 
to this list soon.



Kind regards,

Stephan van Loendersloot.


I am new to JSP but this issue has nothing to do with tomcat as I have 
gone through this with apache. The browser keeps a version of the 
applet. I think you have to clear the java cache to fix this. However 
a work around, was to put the date and time after the javaclass. for 
example: applet  code=MyClass.class  archive=myJar.jar?v=theDate


I am not sure how to automate this in JSP, but that's what I did in 
PHP, and it works great.


applet code=MyClass.class  archive=MyClass.class?v=?php print 
date('U') ? width=xx height=xx


This will force the browser to obtain the latest version of the code 
every time. Maybe you can find out how to do the same in JSP.


I hope this helps.





Jose Roberto Torres wrote:


Good day every one.
I am using the following:
*Linux Suse 10.1.
*Tomcat 5.0.28
*JDK 1.5
*MySql database

I am having problems making tomcat show the correct version of my 
application. I am working with an applet that uses servlets to 
connect to a MySql database. From the beginning I had no problems 
with it, but two days ago the tomcat started to display an older 
version of the applet.
I am calling the applet like this 192.168.1.80/prime/servlets to 
test it and now is showing the correct applet only in the application 
server, if i try to access the applet from another computer in the 
LAN

Re: Tomcat 5.5.12 Refresh/Cache problem

2005-11-01 Thread Stephan van Loendersloot

Samit Paul wrote:

Arlene,
Thanks for the reply. My file is a PNG file. Can you tell me where can I put
this piece of code.  
Thanks,


Samit Paul

-Original Message-
From: Arlene Milgram [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 01, 2005 8:20 AM

To: users@tomcat.apache.org
Subject: RE: Tomcat 5.5.12 Refresh/Cache problem


  /** Turn on caching:  expire in one hour
   * @param response The Http Response.
   */
  public static void setHeadersCacheOn( HttpServletResponse response ){
java.util.Calendar expireDate = java.util.Calendar.getInstance();
expireDate.add(java.util.Calendar.SECOND, 30 );
response.setDateHeader(Expires, expireDate.getTime().getTime()); 
response.setHeader(Cache-Control,public,store,cache); 
response.setHeader(Pragma,cache); 
  }


-Original Message-
From: Samit Paul [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 31, 2005 8:17 PM

To: users@tomcat.apache.org
Subject: Tomcat 5.5.12 Refresh/Cache problem

Can somebody tell me what configuration parameter I need to set to get
rid
of page not refreshing.
I have a png image a.png . When I browse from IE it shows me the image
properly. Now I put a different image but with the same name a.png.
Event if I press the browser refresh button , it still does not refresh
the
image.


SNIP

The problem you describe is on a per-browser-per-user-basis, so they 
will not work effectively.


In IE for example, you can set the caching through the menu Tools - 
Internet Options - General and under 'Temporary Internet Files', click 
Settings, then under 'Check for newer versions of stored pages content', 
select 'Every visit to the page'. Also you can set the number of 
megabytes to use for caching to 1Mb.


As said, this totally leaves you up to the visitor's browser settings.

Other suggested options are to add a number of meta-tags or 
response-headers like 'Expires', 'Cache-Control', 
'Pragma-No-Cache-No-Store', 'Cache-Control-pre-check-post-check' to 
your pages.


However, the interpretation of these things, *again* differs per browser 
implementation per user and per HTTP protocol version these things were 
originally designed for.


This has nothing to do with Tomcat or any other webserver.

Some of the meta-tags and response-headers mentioned above even have an 
unreliable effect on the browsers 'Back'-button and on search-engines.


The most reliable way I have found is to simply take Maarten Janssens's 
advice:


img src=mypicture.jpg?ms=1130901624937

or even:

img src=mypicture.jpg?1130901624937

Where the value '1130901624937' is the current time in milliseconds.

Maybe you didn't understand his reply and you thought something like:

img src=1130901624937.jpg

This would indeed leave you with strange duplicate files. The trick is 
to use the time as a parameter appended to the filename, so you can keep 
the name your original image.



HTH,

--Stephan.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]