Le 07-04-08 à 18:32, Drew Thoeni a écrit :

I'm sure I'm missing a small bit of common WOKnowledge, because this seems pretty basic. But help would be greatly appreciated.

I'm sending an HTML email using a WOComponent as the source. I've done this before from within another component but I'm now trying to do this in a separate (non-WOComponent) standard Java class.

Are you importing com.webobjects.appserver.* on your standard Java class ? If not, it's normal that you don't get access to pageWithName.

I started with:

EmailHTMLTemplate mailPage = (EmailHTMLTemplate)pageWithName ( "EmailHTMLTemplate" );

And got "cannot find symbol"

Thinking the errant symbol might be "pageWithName", I tried this:

EmailHTMLTemplate mailPage = (EmailHTMLTemplate) WOApplication.application().pageWithName( "EmailHTMLTemplate", context() );

Ditto. So, do I need to pass in a context()? If so, how? (FYI: this is a static method and being called from a WOComponent).

Or, am I looking at this all wrong and trying to force fit something? Anytime I get into a spot like this I think back to Jonathan Rentzsch's "If you're writing code, you're doing something wrong" maxim. Perhaps I'm headed in the wrong direction.

_______________________________________________
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]

Reply via email to