• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [SOLVED (better)]: International chars and session timeout...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [SOLVED (better)]: International chars and session timeout...


  • Subject: Re: [SOLVED (better)]: International chars and session timeout...
  • From: Alex Johnson <email@hidden>
  • Date: Mon, 20 Jun 2005 12:28:26 -0500

Hi

You might be able to accomplish this by creating a subclass of WOResponse, let's call it UTF8Response, and calling _NSUtilities.setClassForName( UTF8Response.class, "WOResponse" ). You then put the UTF8 stuff in the constructor for that class. IIRC (this is all from my mid-to-long-term memory), the WO classes all use _NSUtilities to generate their response objects, so you it would not require a lot of fussing around -- unless you create responses manually.

Alex Johnson

|| | ||| || | ||| | | | || || |||
\\ SITE 9 \\ SITE9.COM \\ 312.670.8469 \\


On Jun 19, 2005, at 3:03 PM, Ryan Klems wrote:

How about overriding the performActionNamed() method...

public WOActionResults performActionNamed(String name)
{
WOResponse response;

response = super.performActionNamed(name).generateResponse();
Application.updateResponseForUTF8(response);
return response;
}

On Jun 19, 2005, at 10:38 AM, Ondra Cada wrote:

Again, found my own answer--nothing's better than posting questions :))

On 19.6.2005, at 19:17, Ondra Cada wrote:


Anyway, is there some other generic "appendToDirectActionResponse" method to be used, so that one does not have to override appendToResponse component-level? So far, I haven't been able to find one...


This seems to work quite all right:

public class DirectAction extends WODirectAction {
...
public WOActionResults defaultAction() {
WOResponse rr=pageWithName("Main").generateResponse();
Application.updateResponseForUTF8(rr);
return rr;
}
...

Note that very very probably (I just haven't checked yet, but it seems self-evident) this would be needed for *any* Direct Action which returns components whose contents should be UTF8. Therefore it still is not perfect, though much better than placing the code into components themselves.

with, of course, the Application code looking like this

...
static public void updateResponseForUTF8(WOResponse rr) {
rr.setContentEncoding(_NSUtilities.UTF8StringEncoding);
rr.setHeader("text/html; charset=UTF-8; encoding=UTF-8", "content-type");
}
public void appendToResponse(WOResponse rr, WOContext cc) {
updateResponseForUTF8(rr);
super.appendToResponse(rr,cc);
}
...

Still, if anybody happens to know of a better solution, let me please know :)
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >International chars and session timeout... (From: Ondra Cada <email@hidden>)
 >[SOLVED (kind of)]: International chars and session timeout... (From: Ondra Cada <email@hidden>)
 >Re: [SOLVED (better)]: International chars and session timeout... (From: Ondra Cada <email@hidden>)
 >Re: [SOLVED (better)]: International chars and session timeout... (From: Ryan Klems <email@hidden>)

  • Prev by Date: Re: When a session is created?
  • Next by Date: Re: newbie needs help/advice
  • Previous by thread: Re: [SOLVED (better)]: International chars and session timeout...
  • Next by thread: Re: [SOLVED (better)]: International chars and session timeout...
  • Index(es):
    • Date
    • Thread