Re: Serve Static HTML from WebObjects
Re: Serve Static HTML from WebObjects
- Subject: Re: Serve Static HTML from WebObjects
- From: email@hidden
- Date: Wed, 24 Sep 2003 11:00:10 CDT
- Priority: 3 (Normal)
[demime could not interpret encoding binary - treating as plain text]
Sure, just have a direct action class that reads the file from disk, and
returns it in a WOResponse. You will also want to set the content-type
header in the WOResponse. There may be other headers you want to set, but
I can't think of any right now.
You'll want to either read the file into memory, and then set it in the
WOResponse, or you'll want to try to stream it to the WOResponse
(possible only as of 5.2; probably better, although probably not really
neccesary for a relatively small text file). You'll need to use some JDK
classes (not WO-specific) to access the file. (See java.io.File,
java.io.FileInputStream, and possibly java.io.FileReader and
java.io.BufferedReader). Then you'll need to construct and properly set a
WOResponse, see the documentation for WOResponse.
Hope this helps,
--Jonathan
On Wed, 24 Sep 2003 12:26:38 +0200 Steven Pannell wrote:
> Hi,
>
> I would like to display some static pages through webobjects without
> using a
> WOComponent. What I would like to use is a direct action something like:
>
> http://myserver/cgi-bin/WebObjects/App.woa/wa/showHTML?mypage.html
>
> does anyone know how I can achive this??
>
> Thanks,
> Steve.
>
>
> ------------------------------------------------------------------------
> Steven Pannell
> Technical Project Manager
>
> zooplus.com AG
> Eichenweg 4 Rg.
> 85774 Unterfvhring
> Tel: +49 (89) 95006-163
> Fax: +49 (89) 95006-500
> mailto:email@hidden
> http://www.zooplus.com - Mehr f|r mein Tier im Web
> _______________________________________________
> 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.