0

I'm currently working on a project, which serves different faces in the localhost:8080/myapp/faces/ subdirectory using a Faces servlet (see web.xml:)

<servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
</servlet-mapping>

My plan now is to have another directory accessible via localhost:8080/myapp/secondapp/. There I'd like to place some plain html files, css resources etc. as it will be an Angular app.

I just added the directory "secondapp" including an "index.html" in my /src/main/webapp folder, but I can't access it via localhost:8080/myapp/secondapp/index.html directly. I already did a clean redeploy of the app, but it just won't work.

How do I need to change my web.xml or other files to get this running in glassfish with jersey to be able to access all files in the "secondapp" directory via simple GET requests?

Thanks in advance, guys :)

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
sibbl
  • 3,203
  • 26
  • 38
  • What's your URL pattern for your Jersey app? Is it `/*`? – Paul Samsotha Jun 03 '15 at 12:55
  • Yes, all the other jersey and javax.ws.rs stuff is running at `/*`. But no other servlets are mapped in the `web.xml`. – sibbl Jun 03 '15 at 13:24
  • What does `/*` mean do you think? – BalusC Jun 03 '15 at 13:25
  • Actually I want to know whether it's possible to easily have the jersey app return a specific folder under a specific end point without changing the `/*`. If there's no other solution than creating another java app, then I go for it ;) – sibbl Jun 03 '15 at 13:30
  • 2
    You're going to want to look [at this](http://stackoverflow.com/q/12422660/2587435) then. Note the key with the solutions is to configure Jersey as a filter. – Paul Samsotha Jun 03 '15 at 13:30
  • Thx, peeskillet. That works perfect and was exactly the modification I was looking for. – sibbl Jun 04 '15 at 09:37

0 Answers0