I tackled the same problem using a dummy context:
public WOContext dummyContext()
{
WOApplication app = Application.application();
String dummyUrl = app.cgiAdaptorURL() + "/" + app.name() +
".woa/wa/dummy";
WORequest request = app.createRequest("GET", dummyUrl, "HTTP/
1.0", null, null, null);
WOContext context = app.createContextForRequest(request);
context._generateCompleteURLs ();
return context;
}
On 14-dec-2007, at 19:28, Gennady Kushnir wrote:
I need to send email with information actual at the sending moment.
2007/12/14, Tonny Staunsbrink <[EMAIL PROTECTED]>:
How about generating a string from the wocontext (when you have in
the original request). and then storing that for later sending?
On Dec 14, 2007 7:09 PM, Kieran Kelleher < [EMAIL PROTECTED]>
wrote:
Solution:
Project Wonder -> ERJavaMail framework will get you where you want to
go. That is what all the cool kids use.
On Dec 14, 2007, at 12:59 PM, Gennady Kushnir wrote:
> Hello, List
> I need to sent e-mail from my application. Currently I'm studying
> JavaMail package - it's not very simple but the question is
> WebObjects-related.
> The message body should be generated from WOComponent. But I don't
> know how to make WOComponent generate HTML.
>
>
> The only way I know to make HTML from WOComponent is
> generateResponse() and appendToResponse(WOResponse,WOContext).
> (Which one is better by the way?) But both of them work in context
> of request-response loop.
>
>
> Sending mail is to be scheduled - so when performing the task I
> don't have WOContext - it is not initialised with WORequest -
> because there is no request when in scheduled action.
>
>
> The question is :
> How can I generate HTML from WOComponent without WOContext or how
> to get WOContext not in R-R loop.
>
> Gennady Kushnir
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list ( [email protected])
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/webobjects-dev/kieran_lists%
> 40mac.com
>
> This email sent to [EMAIL PROTECTED]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/mezz.dk%
40gmail.com
This email sent to [EMAIL PROTECTED]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/blue.moon%
40tiscali.nl
This email sent to [EMAIL PROTECTED]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]