DefaultServelt is what is serving
http://localhost:8080/services/images/myimage.png,
thus using CXFServlet with the redirect parameters as suggested should have
the same effect.

I'll need to check why /images/.* is not matched though.

Sergey

On Tue, Mar 8, 2011 at 3:03 PM, Billy Newman <[email protected]> wrote:

> I tried:
>
> /images/.*
>
> and I have the same problem.
>
> A little more specific.  Before I was using cxf in my war I could navigate
> in a browser to http://localhost:8080/services/images/myimage.png.  Where
> services is the context root of my war.  I did not have a servlet serving
> this, it just worked, I could get to the images folder in my war.
>
> When I added cxf and mapped it to /* I now cannot navigate to my image.  I
> should not need a servlet to get to things in my wars root like images.  So
> I do not really want a default servlet I just want cxf to do nothing when I
> go to services/images.
>
> Is the only way (as sugeested before) really to map my cxf servlet to /ws/*
> ?
>
> and then get to my images
> http://localhost:8080/services/images/myimage.png
>
> and my services
> http://localhost:8080/services/ws/myservice
>
> Seems like I should be able to tell cxf to ignore and do nothing with
> certain url, that way I can get the same behavior as I had before I added
> cxf.
>
> Thanks again for all the help with this.
>
> On Tue, Mar 8, 2011 at 6:58 AM, Sergey Beryozkin <[email protected]
> >wrote:
>
> > Hi
> >
> > On Tue, Mar 8, 2011 at 1:34 PM, Billy Newman <[email protected]>
> wrote:
> >
> >> So there is no way to get cxf to ignore services/images/*?
> >>
> >> What does static-resources-list really do?  Was hoping this was a way
> >> to have cxf ignore certain urls.
> >>
> >>
> > This actually has to work.  CXFServlet expects the value of the static
> > resource list to contain one (or more comma-separated) regular
> expressions -
> > I'll need to update the docs.
> >
> > /images/.*
> >
> > should probably fix it.
> >
> > Now, what will happen is that CXFServlet will attempt to serve those
> > resources itself.
> > Instead you may want to  redirect to a default servlet. For this to work
> > try to use redirect parameters instead:
> >
> > Set "redirects-list" to "/images/.*"
> > Set "redirects-servlet-name" to "default"
> >
> > (or whatever the name of the Default servlet is)
> >
> > Let me know if it works please
> > Cheers, Sergey
> >
> >  Thanks again for the help.
> >>
> >> Sent from my iPhone
> >>
> >> On Mar 8, 2011, at 1:44 AM, Edwin Quita <[email protected]> wrote:
> >>
> >> > hi Billy,
> >> >
> >> > if you really want to have your images prefixed with the /services
> >> > path (i.e., /services/images/image_dir/anotherimage.png), use a
> >> > different url pattern for your CXFServlet:
> >> >
> >> > <servlet-mapping>
> >> >  <servlet-name>CXFServlet</servlet-name>
> >> >  <url-pattern>/wsapi/*</url-pattern>
> >> > </servlet-mapping>
> >> >
> >> > and your project's folder structure should be:
> >> > src/main/webapp/services/images/image_dir/anotherimage.png
> >> >
> >> >
> >> > On Tue, Mar 8, 2011 at 6:01 AM, Billy Newman <[email protected]>
> >> wrote:
> >> >> In the root of my war I have an images directory.  My problem is that
> >> from
> >> >> my wars context I cannot get to the images directory.  I.E. in my
> >> javascript
> >> >> I need to be able to get to my images */services/images/.....*.
> >> >>
> >> >> I tried adding a static-resource-list as follows but that was not
> help
> >> >> either:
> >> >>
> >> >> <servlet>
> >> >> <servlet-name>CXFServlet</servlet-name>
> >> >> <display-name>CXF Servlet</display-name>
> >> >> <servlet-class>
> >> >> org.apache.cxf.transport.servlet.CXFServlet
> >> >> </servlet-class>
> >> >> <init-param>
> >> >>       <param-name>static-resources-list</param-name>
> >> >> *        <param-value>/images/*</param-value> *
> >> >>       </init-param>
> >> >> <load-on-startup>1</load-on-startup>
> >> >> </servlet>
> >> >>
> >> >>       <servlet-mapping>
> >> >> <servlet-name>CXFServlet</servlet-name>
> >> >> <url-pattern>/services/*</url-pattern>
> >> >> </servlet-mapping>
> >> >>
> >> >> So I think that I do not want to hit the CXFServlet when I go to
> >> >> /services/images/myimage.png or
> >> /services/images/image_dir/anotherimage.png.
> >> >>
> >> >> Any ideas?
> >> >>
> >>
> >
> >
>

Reply via email to