Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account
List archives

Re: serve static content through jetty

Instantiation of service class -- Are constructor paramters supported?
(18 lines)
Log API time
(10 lines)
Feb 8, 2012
Sergey Beryozkin
Sergey Beryozkin
Hi

On 08/02/12 17:10, matteo rulli wrote:
 Dear all,

 I publish some soap-WS through CXF (v. 2.5.0 - bundled into OSGi
equinox) on
 the following URI:



 http://10.0.2.243:8160/Persistence



 The problem is that when a Silverlight client tries to consume my WS,
a
 "get" request for a resource called clientaccesspolicy.xml is
generated,
 namely

 http:// 10.0.2.243:8160/clientaccesspolicy.xml
 <http:// 10.0.2.243:8160/clientaccesspolicy.xml>

where exactly is this file located/created ? Is it available before the 
bundle is even started for the very first time ?

Cheers, Sergey





 Is there a way to configure Jetty to serve this file? I should perform
this
 programmatically. I tried with something like (sorry for that, I know
it is
 a very awkward attempt of mine to reproduce the
 <http://cxf.apache.org/docs/standalone-http-transport.html>" rel="nofollow" target="_blank">http://cxf.apache.org/docs/standalone...ransport.html>
 http://cxf.apache.org/docs/standalone-http-transport.html example):



 String address = "http:// 10.0.2.243:8160";

 Bus _defaultBUS = BusFactory.getDefaultBus();

 JettyHTTPServerEngineFactory jettyFactory =


 _defaultBUS.getExtension(JettyHTTPServerEngineFactory.class);

 // get the jetty server form the destination

 EndpointInfo ei = new EndpointInfo();

 ei.setAddress(address);

 DestinationFactoryManager dfm =

 _defaultBUS.getExtension(DestinationFactoryManager.class);

 DestinationFactory df = dfm.getDestinationFactoryForUri(address);

 JettyHTTPDestination destination =

          (JettyHTTPDestination) df.getDestination(ei);



 JettyHTTPDestination jettyDestination = (JettyHTTPDestination)
destination;

 ServerEngine engine = jettyDestination.getEngine();

 Handler handler = engine.getServant(new URL(address));

 org.eclipse.jetty.server.Server server = handler.getServer(); // The
Server



 // We have to create a HandlerList structure that includes both a
 ResourceHandler for the static

 // content as well as the ContextHandlerCollection created by CXF
(which we
 retrieve as serverHandler).

 Handler serverHandler = server.getHandler();

 HandlerList handlerList = new HandlerList();

 ResourceHandler resourceHandler = new ResourceHandler();

 handlerList.addHandler(resourceHandler);

 handlerList.addHandler(serverHandler);



 // replace the CXF servlet connect collection with the list.

 server.setHandler(handlerList);

 // and tell the handler list that it is alive.

 handlerList.start();



 // setup the resource handler

 File staticContentFile = new File(staticContentPath); // ordinary
pathname.

 URL targetURL = new URL("file://" +
staticContentFile.getCanonicalPath());

 FileResource fileResource = new FileResource(targetURL);

 resourceHandler.setBaseResource(fileResource);



 But unfortunately it does not work and it spoils my endpoint.



 Could you suggest an alternative java-based approach to serve the
 clientaccesspolicy.xml file?



 Thank you very much.



 Matteo Rulli








Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com


Reply
Tags: cxfosgiequinoxpersistencesoapuri
Messages in this thread
Re: serve static content through jetty
reply R: serve static content through jetty
(170 lines) Feb 9, 2012 03:30
reply Fwd: serve static content through jetty
(172 lines) Feb 9, 2012 06:27
reply Re: Fwd: serve static content through jetty
(210 lines) Feb 9, 2012 09:22
serve static content through jetty
February 8, 2012 11:10:33 AM
Dear all, I publish some soap-WS through CXF (v. 2.5.0 - bundled into OSGi equinox) on the following URI: http://10.0.2.243:8160/Persistence The problem is that when a Silverlight client tries to consume my WS, a "get" request for a…
Serve static file
January 13, 2011 10:21:29 PM
Hello, I thought I've configured Nginx serve static content itself. How do I know Nginx is serving Static content on itself. my config server { # Replace this port with the right one for your requirements listen 80; #could also be…
serve static file?
May 12, 2011 05:07:42 AM
Hey, Is there a way to serve static files from filesystem (not repository)? For example, GET /static/js/jquery.js will be served from /var/www/media/js/jquery.js of filesystem, not repository. (/static/* is served from /var/www/media/*)
Re: serve static/module and dynamic/template files from a single directory via puppet
January 21, 2011 11:15:34 AM
On Jan 21, 2011 4:21 AM, "Andreas Paul" <a.pa### @enbw.com> wrote: > I'm trying to replace our current sed and rsync configuration > management solution and we are used to have static and dynamic > configuration files in the same…
serve static/module and dynamic/template files from a single directory via puppet
January 21, 2011 06:21:37 AM
Hello there, I'm trying to replace our current sed and rsync configuration management solution and we are used to have static and dynamic configuration files in the same folder. After creating a prototype with puppet I defined the static files as…
static pages with embedded jetty. Where can I find better doc?
May 5, 2011 03:08:21 PM
Hi everyone, I've found this page that answers perfectly my needs: https://cwiki.apache.org/confluence/display/CXF20DOC/Standalone+HTTP+T ransport in other words: I need to add some static page to the embedded jetty server of my service! So, to be…
static pages with embedded jetty. Where can I find better doc?
May 5, 2011 03:08:23 PM
Hi everyone, I've found this page that answers perfectly my needs: https://cwiki.apache.org/confluence/display/CXF20DOC/Standalone+HTTP+T ransport in other words: I need to add some static page to the embedded jetty server of my service! So, to be…
Re: embed/include dynamic Java Server Pages content in email/NTLM Authentication to Exchange Serve
August 9, 2010 08:54:03 PM
Thanks for your incite with my posts regarding this Siegfried and Ricardo! I suppose that commons-email doesn't support the kind of integration I was hoping to use in my JSP pages. I was thinking that I could have the dynamic content of my JSP…
Created] (CAMEL-4363) Allow for static file handlers to be added to the jetty component
August 22, 2011 06:49:06 AM
Allow for static file handlers to be added to the jetty component
Speed up static content
November 8, 2011 10:03:30 AM
Is there a special configuration for static content like image files? I have no problem with nginx, and the reason that I am asking is to know if there is a different nginx conf to load static files faster. Posted at Nginx Forum:…
Caching of static content
August 2, 2010 01:06:51 PM
Can someone point me to the documentation on how to handle caching of static content? Images and static HTML documents are all being returned without cach-control response headers but I am unsure how to set these values. Thus the files are being…
Can't disable caching of static content
October 28, 2010 02:30:05 AM
Hi, For some reason Tomcat keeps caching my static content even though I've set the cachingAllowed attribute to false. I've set the following attributes in %CATALINA_HOME%\conf\Catalina\localhost\myContext.xml: <Context path="/myContext"…
The best configuration for serving static content
December 5, 2011 04:29:51 AM
I want to create a config for domains serving static content. I made the following conf file. Is it the best possible code? (I just kept php interpretation for possible usage) location ~*…
Serving static content using embedded tomcat 7
February 8, 2012 01:49:55 AM
Hello, I am working on embedding tomcat 7 into our application. We have a number of web apps and the static content is located in a different directory, common to all webapps. I am not finding a way to serve this static content. Could somebody…
Form Content Size of the Jetty Server
October 12, 2010 11:03:08 AM
If I put this in the Jetty.XML will this increase the form content size? Or how do I increase the form content size of the Jetty Server? <Call name="setAttribute"> <Arg>maxFormContentSize</Arg> …
static content not served for non-root apps via mod_jk
January 13, 2012 09:19:15 PM
Hi all, I'm having trouble getting Apache to serve static content (jpg, css, js, etc.) for Tomcat apps via mod_jk for any application except the ROOT Tomcat app. The ROOT app shows static content just fine. I have the following Apache settings…
Setting the expiry for static content served by Tomcat 6.0.32
February 23, 2011 07:47:27 AM
Hey, Is there any way I can specify the expiry of static content (js,css etc) by some setting in the context.xml or sever.xml .Or the only way to achieve this is to write my own filter which will add the appropriate header. Thanks
Odp.: static content not served for non-root apps via mod_jk
January 14, 2012 02:18:24 AM
Have you measured that Tomcat is too slow for you to serve static content? If not - serve everything from Tomcat itself and enjoy simple configuration;-)
Any potential risk of just pass the request to static content?
May 25, 2010 02:51:13 PM
Hi, I found CRS generated quite a lot of alerts for the requests to static content so I created a rule to just allow them. SecRule REQUEST_URI "^(?:/javascripts|/favicon\.ico|/images|/stylesheets|/logos|/documents|/static)"…
mod_fcgid: fcgid processes serving static content as well
October 28, 2010 09:11:06 AM
Hi! I use mod_fcgid & suexec for safe execution of php scripts. I've recently tested the performance of fcgid and found out that when i request static page (.html or .css) fcgi process is spawned (if doesn't exist yet) and the counter…
Would it be wise to serve static content on a cookie-free domain in SSL?
January 13, 2011
I have long read about "Use cookie-free domains" aka create a subdomain that can serve css, js, and images, all in 1 subdomain. However 99% of our…
Browser blocking image download when nginx was placed infront of apache to serve static content
March 8, 2011
I was tying to place nginx infront of apache to server static content. This set up was performing better than just having apache. but suddenly some…
Browser blocking image download when nginx was placed infront of apache to serve static content
March 8, 2011
I was tying to place nginx infront of apache to server static content. This set up was performing better than just having apache. but suddenly some…
Static content domain using nginx giving me an error while trying to access static files.
April 18, 2011
Hello, as title says i'm trying to serve my static content form another domain hosted on the same server using nginx. This is my server config:…
Nginx - serve static html if ip is not mine?
March 16, 2011
I'm trying to switch some stuff over to a domain running nginx. Is there a simple way to just put my ip address in the configuration for the…
How can I serve a static landing page if my server is down?
April 11, 2011
I would like to fallback to a static webpage if my main web server is down (currently a Rackspace Cloud instance). This would be a sort of…
Is it reasonable to put nodejs behind nginx to serve static assets?
April 3, 2011
Is it reasonable to put nodejs behind nginx to serve static assets?
Configuring htaccess/mod_rewrite to serve static files with question mark in the URL
June 2, 2011
Hi I've just taken on hosting of an ancient site that was converted from asp to static html, consisting of about 6,000 files. However, my server…
How can I get nginx to serve static files from two locations when also serving a unicorn rails server?
January 31, 2011
Ok, so I have pretty much the standard nginx config for serving a unicorn rails server (listens to a socket file and also serves static files from…
How can I get nginx to serve static files from two locations when also serving a unicorn rails server?
January 31, 2011
Ok, so I have pretty much the standard nginx config for serving a unicorn rails server (listens to a socket file and also serves static files from…
Mod_rewrite to serve static cached files if they exist and if the source file hasn't changed
March 2, 2011
I am working on a project that processes images, saves the processed images in a cache, and outputs the processed image to the client. Lets say that…
How to serve content from different directory for sub domains
February 4, 2011
How to serve contents from different directory for virtual sub domains. Ex: http://www.website.com gets its content from www directory. for…
Is it safe to serve pre-gziped content?
June 16, 2011
Is it safe to serve pre-gziped content? Does every browser support it?
Separate servers to serve django app and it's content?
April 5, 2011
Hi There, I'm a little confused as to how to proceed. I'm setting up Django to run on a Mediatemple DV server. I'm trying to figure out the…
Making apache serve unzipped content from zipped files
March 10, 2011
I need to serve a bunch of gzipped MIDI files from an Apache server. The catch is that when the user requests them, the response should come back…
How to serve a 3rd-party web site through my proxy, but alter content before it is displayed?
March 2, 2011
I would like to fetch a remote web site, alter the contents slightly, and then display the final, altered contents to the end-user. Is this…
Caching static content
May 6, 2011
I'm trying to understand what's the best Cache-Control value to be set for static content (images, css, javascript). The issue with this is that my…
Nginx static content
May 21, 2011
hi! i have a following deployed scenario. one server with nginx doing gzip and ssl offload and haproxy listening on 127.0.0.1:8000 to do…
Serving static content with nginx
May 16, 2011
Hello, I'm currently struggling to get the static content served with nginx for my application. I'll give a bit of background information: Server :…
Htaccess for static content not working!
May 29, 2011
So I setted up the following lines in order to redirect some requests to my static domain: RewriteEngine On RewriteBase / RewriteRule ^img/(.*)$…