I would like to ask if someone knows how to configure default servlet or
replace it? I use karaf 4.3.0 RC1 with PAX Web 7.2.14 (pax-http-jetty)
We have angular app with very simple web.xml
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<display-name>chronos</display-name>
It works but now we would like to add support for static compression (i.e
index.html also will have indext.html.br and index.html.gz). Jetty has a
support for this via "precompressed" init param.
But I don't know how to apply this init param for default servlet. I have
tried to replace default servlet in my web.xml:
<servlet>
<servlet-name>test</servlet-name>
<servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>
<display-name>test</display-name>
<init-param>
<param-name>precompressed</param-name>
<param-value>br=.br,gzip=.gz</param-value>
</init-param>
<init-param>
<param-name>dirAllowed</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>test</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
I can see my servlet via http-list command :
ID │ Servlet │ Servlet-Name │ State │
Alias │ Url
────┼─────────────────────┼────────────────────────────┼─────────────┼───────┼─────────────────────────────────────────────────────────────────────────────
147 │ CXFNonSpringServlet │ cxf-osgi-transport-servlet │ Deployed │
/cxf │ [/cxf/*]
329 │ ResourceServlet │ default │ Deployed │
// │ [//]
329 │ JspServletWrapper │ jsp │ Deployed
│ │ [//*.jsp, //*.jspx, //*.jspf, //*.xsp, //*.JSP, //*.JSPX,
//*.JSPF, //*.XSP]
329 │ │ test │ Deployed
│ │ [//]
but when I tried http://localhost:8181 I got
URI: /
STATUS: 404
MESSAGE: Not Found
SERVLET: test
Powered by Jetty:// 9.4.22.v20191022
I guess that there is something wrong with loading of resources. I also
tried set resourceBase to / but without success. Could anybody show me the
way how to set it up?
best regards
jakub
--
--
------------------
OPS4J - http://www.ops4j.org - [email protected]
---
You received this message because you are subscribed to the Google Groups
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ops4j/3ad2e518-f61c-4c74-af71-b66bce1bd2c5%40googlegroups.com.