Isn't the file divider "\" in Windows--that may be part of the problem.

Also, some debugging appears needed here, from both ends.  Perhaps you
should System.out.println() what you are passing in via Spring as the
resourceBase value--first confirm that indeed the Java code is getting the
"d:/temp/" from the config file.  Next, factor out that hardcoded "d:/temp/"
from your Java code into a String variable and then
setResourceBase(myNewVar) --> does that work?

Glen


Marcus Redeker wrote:
> 
> All,
> 
> I am trying to use the spring configuration to added a ResourceHandler for
> static content to jetty. 
> It does not work when I use the following spring configuration:
> 
> ========== Spring config ================
>   <httpj:engine-factory bus="cxf">
>     <httpj:engine port="9000">
>       <httpj:handlers>
>         <bean class="org.mortbay.jetty.handler.ResourceHandler">
>               <property
> name="resourceBase"><value>d:/temp/</value></property>
>         </bean>         
>       </httpj:handlers>
>     </httpj:engine>
>   </httpj:engine-factory>
> =========================
> 
> But when I use the following java code it does work:
> 
> =========== Java code ==========================
> Bus bus = (Bus)ctx.getBean("cxf"); 
> ServerRegistry sr= bus.getExtension(ServerRegistry.class); 
> ServerImpl si = (ServerImpl) sr.getServers().get(0); 
> JettyHTTPDestination jhd = (JettyHTTPDestination)si.getDestination(); 
> JettyHTTPServerEngine engine = (JettyHTTPServerEngine) jhd.getEngine(); 
> Server server = engine.getServer(); 
> Handler serverHandler = server.getHandler(); 
> ContextHandlerCollection contextHandlerCollection =
> (ContextHandlerCollection)serverHandler; 
> HandlerList handlerList = new HandlerList(); 
> ResourceHandler resourceHandler = new ResourceHandler(); 
> handlerList.addHandler(resourceHandler); 
> handlerList.addHandler(contextHandlerCollection); 
> server.setHandler(handlerList); 
> handlerList.start(); 
> resourceHandler.setResourceBase("d:/temp/");
> ========================================
> 
> Can you guys help me? I would like to only use spring config and not have
> to
> have the extra java code.
> 
> Thanks,
> 
> Marcus 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Configure-jetty-to-use-static-content-tp18554067p18554593.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to