Re: Call external images/video/other resources from external folder with (embebbed) jetty from GWT
getModuleBaseURL returns the "folder" where the *.nocache.js lives. You probably need getHostPageBaseURL, which is the "folder" in which your HTML page (which loads the *.nocache.js file) lives.
-- Also, those methods return a value that ends in "/", so you don't need to append "/" to it: GWT.getHostPageBaseURL() + "folder_name_of_static_resources/the_image.jpg"
On Friday, September 13, 2013 9:34:42 PM UTC+2, n3k0 wrote:
On Friday, September 13, 2013 9:34:42 PM UTC+2, n3k0 wrote:
Hi.
I actually have a trouble with calls to external resources like image/video. I read in the jetty docs, and some examples on the internet, and i found i have to do
a configuration like this:<Configure id="parentHandler" class="org.mortbay.jetty.
handler.ContextHandler" > <Set name="contextPath">/folder_name_of_static_resources </Set>
<Set name="resourceBase">/real/filesystem/path/to/static/ </Set> <Set name="handler"> <New class="org.mortbay.jetty.resources/ handler.ResourceHandler" > <Set name="cacheControl">max-age=3600,public </Set> </New> </Set> </Configure>
So, in my code, i want to get an image, in the form:GWT.getModuleBaseURL()+"
/
folde
r_name_of_static_resources /
the_image.jpg"
But, when jetty runs, it marksResult: 404 image not found
Now, why i want to do in this way?
I want to get video from a form, and after that, can view it in a videoplayer. i don't want to use a database (blob) because some files can be too heavy (5 to 100 MB aprox) so, i want to save and recovery from a filesystem.
I can't use GAE, nor other web server (like tomcat) but i'm sure that my requeriment can be satisfied if i resolve this configuration; and i suppose that the configuration can works in a embebbed jetty(GWT included) and a regular jetty server.
Can you give a hand?
Thanks in advance.
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home