• 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: pre-render and cache a component?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pre-render and cache a component?


  • Subject: Re: pre-render and cache a component?
  • From: Ken Anderson <email@hidden>
  • Date: Fri, 13 Feb 2015 13:46:06 -0500

Take a look at ERMailDelivery, it does the same thing.



On Feb 13, 2015, at 1:07 PM, Chuck Hill <email@hidden> wrote:

Off the top of my head, you need to create a new WOContext and use the WOApplication pageWithName(String, WOContext) method.

Chuck

On 2015-02-13, 9:54 AM, "OC" wrote:

Hello there,

is it possible to pre-render a component to HTML string, and cache that string?

I thought this code would work:

=== code ===
...
private String cache=null
String componentContent {
  if (!cache) {
    def component=pageWithName(COMPONENT_NAME)
    component.awake()
    WOResponse nr=component.generateResponse()
    cache=nr.contentString()
  }
  return cache
}
...
=== HTML ===
...
<wo:str value="$componentContent" escapeHTML="NO"/>
...
===

but it does not -- it messes up my current context, it seems.

Thanks for any advice,
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
References: 
 >pre-render and cache a component? (From: OC <email@hidden>)
 >Re: pre-render and cache a component? (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: pre-render and cache a component?
  • Next by Date: Re: pre-render and cache a component?
  • Previous by thread: Re: pre-render and cache a component?
  • Next by thread: Re: pre-render and cache a component?
  • Index(es):
    • Date
    • Thread