[Celerity-users] page cacheing
jason franklin-stokes
jasoninclass at googlemail.com
Mon Sep 7 13:08:32 EDT 2009
Hi Jari,
I hope you can help me on this one.
Serialization seems to be working on the HtmlUnit side of things.
I have written this code on jruby side which seems to serialize the
webclient and page - which is exactly what i need. But for the life of
me I cannot save them to disk (Marshal dump hates anonymous classes).
Have you go any Ideas on how I can get the serialized data form the
htmlunit side on to disk and back off again and back to htmlunit?
Any ideas would be of great help.
#######
# serialize and deserialize working
#######
require 'java'
require 'htmlunit-2.7-SNAPSHOT.jar'
include_class 'com.gargoylesoftware.htmlunit.WebClient'
include_class 'org.apache.commons.lang.SerializationUtils'
webclient = WebClient.new(version)
page = webclient.getPage("http://www.google.de")
serialized_page = SerializationUtils.serialize(page)
serialized_client = SerializationUtils.serialize(webclient)
#write to disk
# read back from disk
webclient_1 = SerializationUtils.deserialize(serialized_client);
page_1 = SerializationUtils.deserialize(serialized_page);
puts webclient_1.inspect
puts page_1.inspect
On Aug 11, 2009, at 6:22 PM, Jari Bakken wrote:
> Out of curiousity, what's the use case? I can see Ashley's point about
> the back button loading a cached version, but why do you want to store
> the objects on disk?
> _______________________________________________
> Celerity-users mailing list
> Celerity-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/celerity-users
More information about the Celerity-users
mailing list