Re: SSI within main.html
Re: SSI within main.html
- Subject: Re: SSI within main.html
- From: Jerry Haynes <email@hidden>
- Date: Tue, 20 Jan 2004 09:15:45 -0500
Brian, this works for me. I have to restart the WO App if the header or
footer is changed.
public class Application extends WOApplication {
protected String responseHeader;
protected String responseFooter;
public static void main(String argv[]) {
WOApplication.main(argv, Application.class);
}
public Application() {
super();
//Enable direct action request handler.
setDefaultRequestHandler(requestHandlerForKey(directActionRequestHandler
Key()));
String server = "www.yourdomain.com";
String header = "/INCLUDE/header.shtml";
String footer = "/INCLUDE/footer.shtml";
WOHTTPConnection h = new WOHTTPConnection( server, 80 );
h.sendRequest(new WORequest("GET", header, "HTTP/1.1", new
NSDictionary( server, "Host" ), null, null));
responseHeader = h.readResponse().contentString();
h.sendRequest(new WORequest("GET", footer, "HTTP/1.1", new
NSDictionary( server, "Host" ), null, null));
responseFooter = h.readResponse().contentString();
}
public String responseHeader() {
return responseHeader;
}
public String responseFooter() {
return responseFooter;
}
}
/*Make your WOComponent a partial document then create two Strings*/
String1: WOString {
escapeHTML = false;
value = application.responseHeader;
}
String2: WOString {
escapeHTML = false;
value = application.responseFooter;
}
Cc: email@hidden
From: Brian Dote <email@hidden>
Subject: Re: SSI within main.html
Date: Mon, 19 Jan 2004 06:59:44 -0800
To: Chuck Hill <email@hidden>
Thanks for the info. I've ported the SSI's to WO components and include
these instead since, as you've mentioned, apache won't play nice with
what I wanted to do.
Thanks again,
Brian
On Jan 18, 2004, at 10:51 PM, Chuck Hill wrote:
Yes. You can include HTML generated by WO into static pages (direct
actions are easiest). But including static HTML files into the result
of a
cgi call is not supported by Apache.
Chuck
At 03:55 PM 19/01/2004 +1100, Marek Wawrzyczny wrote:
AFAIK Apache never gets the chance to process include tags, it simply
passes the request onto the WO module and then passes the response to
the user. You will have to convert your includes into components.
On Monday, Jan 19, 2004, at 15:26 Australia/Sydney, Brian Dote wrote:
Hello,
I would like to include some header and footer HTML I use on many
sites into the main.html. I cannot get this to work. At the moment,
apache just puts the SSI tags into the HTML and doesn't parse them.
I've been told it might be an apache config issue with regards to
the
WO chain, but I don't know how to invoke SHTML on the WO response.
Anyone done this type of thing before? Is there a better solution?
I'm
thinking I might convert my includes into components, and call the
components into the pages, but that would be a significant amt. of
work atm.
Any help would be greatly appreciated!
- B
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.