Re: IE SSL cache bug

2008-04-20 Thread Mr. Pierre Frisch

Could you please file a bug report? Including the fix :).

Thank you

Pierre
--
Pierre Frisch
[EMAIL PROTECTED]


On Apr 18, 2008, at 21:34, Chuck Hill wrote:

That is a great bug, isn't it!  I have enjoyed it many times over  
the years.  Here is a class that I wrote that seems to fix this.  It  
is for 5.3, can be trimmed for 5.4.  Add this to your project, then  
add this method to Application:



   public WOResponse createResponseInContext(WOContext context)
   {
   return new Response();
   }




package net.global_village.woextensions;

import com.webobjects.appserver.*;
import com.webobjects.foundation.*;



/**
* Fixes and hacks for WOResponse.
* p
* Creates a response configured to use UTF-8 for the  
codedefaultFormValueEncoding()/code.

* /p
* p
* Prevents disabling client caching for downloads by IE to fix the  
bug with IE that causes problems when displaying
* content that cannot be displayed inline in the browswer (pdf  
files, for example). This was a known bug in IE 4.0 and

* is reported fixed by MS:
* 
http://support.microsoft.com/support/kb/articles/Q231/2/96.ASP?LN=EN-USSD=gnFR=0qry=Internet%20Explorer%20cannot%20downloadrnk=19src=DHCS_MSPSS_gn_SRCHSPR=IE
* When you try to download a .pdf file from a Web site that uses  
the Hypertext Transfer Protocol (HTTP) Cache-Control =
* 'no-cache' directive, Internet Explorer may generate the  
following error message: Internet Explorer cannot down load

* from the Internet site File_name from Computer_name.
* /p
*
* @author Copyright (c) 2001-2005  Global Village Consulting, Inc.   
All rights reserved.
* This software is published under the terms of the Educational  
Community License (ECL) version 1.0,
* a copy of which has been included with this distribution in the  
LICENSE.TXT file.

*/
public class Response extends WOResponse
{

   public static final String ContentDispositionHeaderKey = content- 
disposition;

   public static final String ContentTypeHeaderKey = content-type;
   public static final String DisablePageCachingKey =  
com.webobjects.appserver.Response.DisablePageCaching;


   private boolean allowClientCaching = false;


   /**
* Creates a response configured to use UTF-8 for the  
codedefaultFormValueEncoding()/code.

*/
   public Response()
   {
   super();
   setContentEncoding(_NSUtilities.UTF8StringEncoding);
   }



   /**
* Overridden to set allowClientCaching to deal with the IE  
download caching bug. Forces all HTML pages returned to

* be UTF-8.
*
* @see  
com 
.webobjects 
.appserver 
.WOResponse#_finalizeInContext(com.webobjects.appserver.WOContext)

* @param aContext
*the WOContext the request is being finalized in
*/
   public void _finalizeInContext(WOContext aContext)
   {
   String contentDisposition =  
headerForKey(ContentDispositionHeaderKey);

   String contentType = headerForKey(ContentTypeHeaderKey);

   boolean isAttachment = contentDisposition != null 
   (contentDisposition.indexOf(inline)  
 -1 ||
 
contentDisposition.indexOf(attachment)  -1);
   boolean isIE = aContext != null   
RequestUtilities.isUserAgentInternetExplorer(aContext.request());
   boolean isHTML = contentType != null   
contentType.toLowerCase().indexOf(text/html)  -1;

   allowClientCaching = isIE  isAttachment  ! isHTML;

   // Force all HTML pages returned to be UTF-8.
   if (isHTML)
   {
   // This controls the display and is also needed to handle  
input via forms
   setHeader(text/html; charset=UTF-8,  
ContentTypeHeaderKey);

   }

   super._finalizeInContext(aContext);
   }



   /**
* Overridden to bnot/b call super if allowClientCaching is  
set.

*
* @see com.webobjects.appserver.WOResponse#disableClientCaching()
*
*/
   public void disableClientCaching()
   {
   if ( ! allowClientCaching) {
   super.disableClientCaching();
   }
   }



   /**
* @see #disablePageCaching()
* @return codetrue/code if disablePageCaching() has been  
called for this response

*/
   public boolean isPageCachingDisabled()
   {
   return userInfoForKey(DisablePageCachingKey) != null;
   }



   /**
* Adds a value for DisablePageCachingKey to this response's  
userInfo().  This can be used later

* to flag that this response should not be cached.
*
* @see WOSession#savePage(WOComponent)
* @see #isPageCachingDisabled()
*/
   public void disablePageCaching()
   {
   setUserInfoForKey(dummy value, DisablePageCachingKey);
   }



   /**
* WO 5.4 API
* Sets the value for key in the user info dictionary.
*
* @param value value to add to userInfo()
* @param key key to add value under
*/
   public void setUserInfoForKey(Object value, String key)
   {
   /** require [valid_value] value != null;
   [valid_key] key != null;
**/
   

Re: IE SSL cache bug

2008-04-20 Thread Chuck Hill


On Apr 20, 2008, at 11:06 AM, Mr. Pierre Frisch wrote:


Could you please file a bug report? Including the fix :).


But, I don't know how to fix IE!  :-)  Which is why I had not reported  
this as a WO bug: it isn't.  But I will happily file this as an  
enhancement request.


Chuck





Thank you

Pierre
--
Pierre Frisch
[EMAIL PROTECTED]


On Apr 18, 2008, at 21:34, Chuck Hill wrote:

That is a great bug, isn't it!  I have enjoyed it many times over  
the years.  Here is a class that I wrote that seems to fix this.   
It is for 5.3, can be trimmed for 5.4.  Add this to your project,  
then add this method to Application:



  public WOResponse createResponseInContext(WOContext context)
  {
  return new Response();
  }




package net.global_village.woextensions;

import com.webobjects.appserver.*;
import com.webobjects.foundation.*;



/**
* Fixes and hacks for WOResponse.
* p
* Creates a response configured to use UTF-8 for the  
codedefaultFormValueEncoding()/code.

* /p
* p
* Prevents disabling client caching for downloads by IE to fix the  
bug with IE that causes problems when displaying
* content that cannot be displayed inline in the browswer (pdf  
files, for example). This was a known bug in IE 4.0 and

* is reported fixed by MS:
* 
http://support.microsoft.com/support/kb/articles/Q231/2/96.ASP?LN=EN-USSD=gnFR=0qry=Internet%20Explorer%20cannot%20downloadrnk=19src=DHCS_MSPSS_gn_SRCHSPR=IE
* When you try to download a .pdf file from a Web site that uses  
the Hypertext Transfer Protocol (HTTP) Cache-Control =
* 'no-cache' directive, Internet Explorer may generate the  
following error message: Internet Explorer cannot down load

* from the Internet site File_name from Computer_name.
* /p
*
* @author Copyright (c) 2001-2005  Global Village Consulting, Inc.   
All rights reserved.
* This software is published under the terms of the Educational  
Community License (ECL) version 1.0,
* a copy of which has been included with this distribution in the  
LICENSE.TXT file.

*/
public class Response extends WOResponse
{

  public static final String ContentDispositionHeaderKey = content- 
disposition;

  public static final String ContentTypeHeaderKey = content-type;
  public static final String DisablePageCachingKey =  
com.webobjects.appserver.Response.DisablePageCaching;


  private boolean allowClientCaching = false;


  /**
   * Creates a response configured to use UTF-8 for the  
codedefaultFormValueEncoding()/code.

   */
  public Response()
  {
  super();
  setContentEncoding(_NSUtilities.UTF8StringEncoding);
  }



  /**
   * Overridden to set allowClientCaching to deal with the IE  
download caching bug. Forces all HTML pages returned to

   * be UTF-8.
   *
   * @see  
com 
.webobjects 
.appserver 
.WOResponse#_finalizeInContext(com.webobjects.appserver.WOContext)

   * @param aContext
   *the WOContext the request is being finalized in
   */
  public void _finalizeInContext(WOContext aContext)
  {
  String contentDisposition =  
headerForKey(ContentDispositionHeaderKey);

  String contentType = headerForKey(ContentTypeHeaderKey);

  boolean isAttachment = contentDisposition != null 
  (contentDisposition.indexOf(inline)  
 -1 ||

contentDisposition.indexOf(attachment)  -1);
  boolean isIE = aContext != null   
RequestUtilities.isUserAgentInternetExplorer(aContext.request());
  boolean isHTML = contentType != null   
contentType.toLowerCase().indexOf(text/html)  -1;

  allowClientCaching = isIE  isAttachment  ! isHTML;

  // Force all HTML pages returned to be UTF-8.
  if (isHTML)
  {
  // This controls the display and is also needed to handle  
input via forms
  setHeader(text/html; charset=UTF-8,  
ContentTypeHeaderKey);

  }

  super._finalizeInContext(aContext);
  }



  /**
   * Overridden to bnot/b call super if allowClientCaching is  
set.

   *
   * @see com.webobjects.appserver.WOResponse#disableClientCaching()
   *
   */
  public void disableClientCaching()
  {
  if ( ! allowClientCaching) {
  super.disableClientCaching();
  }
  }



  /**
   * @see #disablePageCaching()
   * @return codetrue/code if disablePageCaching() has been  
called for this response

   */
  public boolean isPageCachingDisabled()
  {
  return userInfoForKey(DisablePageCachingKey) != null;
  }



  /**
   * Adds a value for DisablePageCachingKey to this response's  
userInfo().  This can be used later

   * to flag that this response should not be cached.
   *
   * @see WOSession#savePage(WOComponent)
   * @see #isPageCachingDisabled()
   */
  public void disablePageCaching()
  {
  setUserInfoForKey(dummy value, DisablePageCachingKey);
  }



  /**
   * WO 5.4 API
   * Sets the value for key in the user info dictionary.
   *
   * @param value value to add to userInfo()
   * @param key key to add value under
   */
  public void 

Re: IE SSL cache bug

2008-04-20 Thread Mr. Pierre Frisch
I will be happy to add this work around it it trips many people it is  
worth it.


Thanks

Pierre
--
Pierre Frisch
[EMAIL PROTECTED]


On Apr 20, 2008, at 11:32, Chuck Hill wrote:



On Apr 20, 2008, at 11:06 AM, Mr. Pierre Frisch wrote:


Could you please file a bug report? Including the fix :).


But, I don't know how to fix IE!  :-)  Which is why I had not  
reported this as a WO bug: it isn't.  But I will happily file this  
as an enhancement request.


Chuck





Thank you

Pierre
--
Pierre Frisch
[EMAIL PROTECTED]


On Apr 18, 2008, at 21:34, Chuck Hill wrote:

That is a great bug, isn't it!  I have enjoyed it many times over  
the years.  Here is a class that I wrote that seems to fix this.   
It is for 5.3, can be trimmed for 5.4.  Add this to your project,  
then add this method to Application:



 public WOResponse createResponseInContext(WOContext context)
 {
 return new Response();
 }




package net.global_village.woextensions;

import com.webobjects.appserver.*;
import com.webobjects.foundation.*;



/**
* Fixes and hacks for WOResponse.
* p
* Creates a response configured to use UTF-8 for the  
codedefaultFormValueEncoding()/code.

* /p
* p
* Prevents disabling client caching for downloads by IE to fix the  
bug with IE that causes problems when displaying
* content that cannot be displayed inline in the browswer (pdf  
files, for example). This was a known bug in IE 4.0 and

* is reported fixed by MS:
* 
http://support.microsoft.com/support/kb/articles/Q231/2/96.ASP?LN=EN-USSD=gnFR=0qry=Internet%20Explorer%20cannot%20downloadrnk=19src=DHCS_MSPSS_gn_SRCHSPR=IE
* When you try to download a .pdf file from a Web site that uses  
the Hypertext Transfer Protocol (HTTP) Cache-Control =
* 'no-cache' directive, Internet Explorer may generate the  
following error message: Internet Explorer cannot down load

* from the Internet site File_name from Computer_name.
* /p
*
* @author Copyright (c) 2001-2005  Global Village Consulting,  
Inc.  All rights reserved.
* This software is published under the terms of the Educational  
Community License (ECL) version 1.0,
* a copy of which has been included with this distribution in the  
LICENSE.TXT file.

*/
public class Response extends WOResponse
{

 public static final String ContentDispositionHeaderKey = content- 
disposition;

 public static final String ContentTypeHeaderKey = content-type;
 public static final String DisablePageCachingKey =  
com.webobjects.appserver.Response.DisablePageCaching;


 private boolean allowClientCaching = false;


 /**
  * Creates a response configured to use UTF-8 for the  
codedefaultFormValueEncoding()/code.

  */
 public Response()
 {
 super();
 setContentEncoding(_NSUtilities.UTF8StringEncoding);
 }



 /**
  * Overridden to set allowClientCaching to deal with the IE  
download caching bug. Forces all HTML pages returned to

  * be UTF-8.
  *
  * @see  
com 
.webobjects 
.appserver 
.WOResponse#_finalizeInContext(com.webobjects.appserver.WOContext)

  * @param aContext
  *the WOContext the request is being finalized in
  */
 public void _finalizeInContext(WOContext aContext)
 {
 String contentDisposition =  
headerForKey(ContentDispositionHeaderKey);

 String contentType = headerForKey(ContentTypeHeaderKey);

 boolean isAttachment = contentDisposition != null 
 (contentDisposition.indexOf(inline)  
 -1 ||
   
contentDisposition.indexOf(attachment)  -1);
 boolean isIE = aContext != null   
RequestUtilities.isUserAgentInternetExplorer(aContext.request());
 boolean isHTML = contentType != null   
contentType.toLowerCase().indexOf(text/html)  -1;

 allowClientCaching = isIE  isAttachment  ! isHTML;

 // Force all HTML pages returned to be UTF-8.
 if (isHTML)
 {
 // This controls the display and is also needed to handle  
input via forms
 setHeader(text/html; charset=UTF-8,  
ContentTypeHeaderKey);

 }

 super._finalizeInContext(aContext);
 }



 /**
  * Overridden to bnot/b call super if allowClientCaching is  
set.

  *
  * @see com.webobjects.appserver.WOResponse#disableClientCaching()
  *
  */
 public void disableClientCaching()
 {
 if ( ! allowClientCaching) {
 super.disableClientCaching();
 }
 }



 /**
  * @see #disablePageCaching()
  * @return codetrue/code if disablePageCaching() has been  
called for this response

  */
 public boolean isPageCachingDisabled()
 {
 return userInfoForKey(DisablePageCachingKey) != null;
 }



 /**
  * Adds a value for DisablePageCachingKey to this response's  
userInfo().  This can be used later

  * to flag that this response should not be cached.
  *
  * @see WOSession#savePage(WOComponent)
  * @see #isPageCachingDisabled()
  */
 public void disablePageCaching()
 {
 setUserInfoForKey(dummy value, DisablePageCachingKey);
 }



 /**
  * WO 5.4 API
  * Sets the value for key in the user info dictionary.
  *
  * @param value 

Database Design - Multiple locations

2008-04-20 Thread Mr. Frank Cobia
I have a database design question. I am posting it to the WebObjects  
list because I am building a WebObjects app and want a solution that  
works well for EOF.


I have a table of data that has to have a location associated with it.  
Unfortunately the level of the location is not constant. The data can  
be associated with a Country, Region, State, Metro Area, County or  
City. Each of those levels is its own table with relationships  
pointing to the related locations. i.e. a State knows which Region it  
belongs to and which Metro Areas belong to it.


I have been unable to come up with a design that seems elegant. I have  
thought of having 6 separate relationships to each of the location  
levels, but it seems to duplicate data and the data could get out of  
sync if a state is moved to a different region or a City is moved to a  
different county.


Has anyone had a situation like this and come up with a good solution?

Thanks,
Frank Cobia
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Out of memory

2008-04-20 Thread Lachlan Deck

Hi there,

has anyone seen this before? Is it just coincidental? Usually when I  
see OutOfMemoryErrors it's due to some infinite loop or some bug...


WO5.3.3, Mysql jconnector 5.0.6

com.webobjects.foundation.NSForwardException for
java.lang.OutOfMemoryError: Java heap space
at java.lang.StringCoding.trim(StringCoding.java:74)
at java.lang.StringCoding.access$100(StringCoding.java:37)
at java.lang.StringCoding$CharsetSD.decode(StringCoding.java:201)
at java.lang.StringCoding.decode(StringCoding.java:228)
at java.lang.String.init(String.java:405)
at java.lang.String.init(String.java:433)
at com.mysql.jdbc.ResultSet.getStringInternal(ResultSet.java:5674)
at com.mysql.jdbc.ResultSet.getString(ResultSet.java:5544)
	at com.webobjects.jdbcadaptor.JDBCColumn._fetchText(JDBCColumn.java: 
205)
	at  
com 
.webobjects.jdbcadaptor.JDBCColumn._fetchCorrectObject(JDBCColumn.java: 
217)
	at com.webobjects.jdbcadaptor.JDBCColumn._fetchValue(JDBCColumn.java: 
319)
	at com.webobjects.jdbcadaptor.JDBCColumn.fetchValue(JDBCColumn.java: 
307)
	at com.webobjects.jdbcadaptor.JDBCChannel.fetchRow(JDBCChannel.java: 
1406)
	at  
com 
.webobjects 
.eoaccess.EODatabaseChannel._fetchObject(EODatabaseChannel.java:302)
	at  
com 
.webobjects 
.eoaccess 
.EODatabaseContext 
._objectsWithFetchSpecificationEditingContext(EODatabaseContext.java: 
3221)


with regards,
--

Lachlan Deck



___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Database Design - Multiple locations

2008-04-20 Thread James Cicenia
Does your data haphazardly point to any location? Or does it point  
always to city (the most discreet) which is hierarchical down from  
Country?
If that is the case just point it to city and you will have access to  
all the other locations as they would all be joined in to-one  
relationship up the tree.


Otherwise, maybe have an intermediary object that has a type attribute.

HTH
James Cicenia


On Apr 20, 2008, at 8:15 PM, Mr. Frank Cobia wrote:

I have a database design question. I am posting it to the WebObjects  
list because I am building a WebObjects app and want a solution that  
works well for EOF.


I have a table of data that has to have a location associated with  
it. Unfortunately the level of the location is not constant. The  
data can be associated with a Country, Region, State, Metro Area,  
County or City. Each of those levels is its own table with  
relationships pointing to the related locations. i.e. a State knows  
which Region it belongs to and which Metro Areas belong to it.


I have been unable to come up with a design that seems elegant. I  
have thought of having 6 separate relationships to each of the  
location levels, but it seems to duplicate data and the data could  
get out of sync if a state is moved to a different region or a City  
is moved to a different county.


Has anyone had a situation like this and come up with a good solution?

Thanks,
Frank Cobia
___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/james%40jimijon.com

This email sent to [EMAIL PROTECTED]


___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Out of memory

2008-04-20 Thread Andrew Lindesay

Hello Lachlan;

I have reasonable suspicions that the MySQL driver leaks -- the most  
damning of which is a project wherein the instances went down  
frequently owing to memory exhaustion, but immediately after a  
migration to PostgreSQL in 2006, the memory exhaustion problem stopped  
and instances would stay up (for months) between version changes.


cheers.

has anyone seen this before? Is it just coincidental? Usually when I  
see OutOfMemoryErrors it's due to some infinite loop or some bug...  
WO5.3.3, Mysql jconnector 5.0.6


___
Andrew Lindesay
www.lindesay.co.nz

___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Out of memory

2008-04-20 Thread Lachlan Deck

Hi Andrew,

thanks for the info...

On 21/04/2008, at 2:54 PM, Andrew Lindesay wrote:


Hello Lachlan;

I have reasonable suspicions that the MySQL driver leaks -- the  
most damning of which is a project wherein the instances went down  
frequently owing to memory exhaustion, but immediately after a  
migration to PostgreSQL in 2006, the memory exhaustion problem  
stopped and instances would stay up (for months) between version  
changes.


cheers.

has anyone seen this before? Is it just coincidental? Usually when  
I see OutOfMemoryErrors it's due to some infinite loop or some  
bug... WO5.3.3, Mysql jconnector 5.0.6


___
Andrew Lindesay
www.lindesay.co.nz


with regards,
--

Lachlan Deck



___
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list  (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]