You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pax-web-extender-whiteboard/readme.adoc
+147-1Lines changed: 147 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -165,7 +165,7 @@ Servlet containers themselves also have "default"/"resource" servlets to serve s
165
165
166
166
ALl these servlets do several things like handling _index_ for directory access (or not), preventing access to `/WEB-INF/`, etc. For actual resource serving, another interface is used:
* `org.apache.catalina.util.ErrorPageSupport.exceptionPages` and `org.apache.catalina.util.ErrorPageSupport.statusPages`
288
288
* `io.undertow.servlet.api.DeploymentInfo.errorPages` and `io.undertow.servlet.core.DeploymentImpl.errorPages` (no specific Undertow `web.xml` parser. It's parsed in Wildfly by `org.jboss.metadata.parser.servlet.WebCommonMetaDataParser#parse()`)
289
+
290
+
== DTOs
291
+
292
+
Whiteboard DTOs (chapter `140.9 The Http Service Runtime Service`) is the last task I planned before Pax Web 8.0.0.GA.
293
+
Whiteboard specification assumes huge control over everything registered to the Whiteboard, but Pax Web moves the emphasis to native (Jetty/Tomcat/Undertow) mechanisms of the servlet container, so not everything is as easy as it'd be when implemented using single `DispatcherServlet`.
294
+
295
+
=== Where Pax Web 8 implements `org.osgi.service.http.runtime.HttpServiceRuntime`?
296
+
297
+
I decided to register this service not from pax-web-extender-whiteboard bundle, which is responsible for tracking Whiteboard services. In Pax Web 8, this service is published from pax-web-runtime and the _source_ of DTO information is `org.ops4j.pax.web.service.spi.model.ServerModel`, which keeps all the web elements - from Whiteboard, HttpService/WebContainer and from the WABs.
298
+
299
+
=== DTO for successful services
300
+
301
+
This part is easier - because every validated Whiteboard service is registered into `ServerModel`, we can easily associated the DTO information.
302
+
303
+
=== DTO for failed services
304
+
305
+
This is a bit trickier, at least for the Whiteboard part, because failed registrations are _not_ passed to pax-web-runtime. But I'll think about something.
306
+
307
+
=== DTO failure reasons
308
+
309
+
Checking the specification, these are the failure codes:
310
+
311
+
* `FAILURE_REASON_UNKNOWN` = 0 Failure reason is unknown.
312
+
* `FAILURE_REASON_NO_SERVLET_CONTEXT_MATCHING` = 1 No matching ServletContextHelper.
313
+
* `FAILURE_REASON_SERVLET_CONTEXT_FAILURE` = 2 Matching ServletContextHelper, but the context is not used due to a problem with the context.
314
+
* `FAILURE_REASON_SHADOWED_BY_OTHER_SERVICE` = 3 Service is shadowed by another service. For example, a service with the same service properties but a higher service ranking.
315
+
* `FAILURE_REASON_EXCEPTION_ON_INIT` = 4 An exception occurred during initializing of the service. This reason can only happen for servlets and servlet filters.
316
+
* `FAILURE_REASON_SERVICE_NOT_GETTABLE` = 5 The service is registered in the service registry but getting the service fails as it returns null.
317
+
* `FAILURE_REASON_VALIDATION_FAILED` = 6 The service is registered in the service registry but the service properties are invalid.
318
+
* `FAILURE_REASON_SERVICE_IN_USE` = 7 The service is not registered as a prototype scoped service and is already in use with a servlet context and therefore can't be used with another servlet context.
319
+
* `FAILURE_REASON_SERVLET_WRITE_TO_LOCATION_DENIED` = 8 The servlet is not registered as it is configured to have multipart enabled, but the bundle containing the servlet has no write permission to the provided location for the uploaded files. Since: 1.1
320
+
* `FAILURE_REASON_WHITEBOARD_WRITE_TO_DEFAULT_DENIED` = 9 The servlet is not registered as it is configured to have multipart enabled, but the whiteboard implementation has no write permission to the default location for the uploaded files. Since: 1.1
321
+
* `FAILURE_REASON_SERVLET_READ_FROM_DEFAULT_DENIED` = 10 The servlet is not registered as it is configured to have multipart enabled, but the bundle containing the servlet has no read permission to the default location for the uploaded files. Since: 1.1
322
+
* `FAILURE_REASON_WHITEBOARD_WRITE_TO_LOCATION_DENIED` = 11 The servlet is not registered as it is configured to have multipart enabled, but the whiteboard implementation has no write permission to the provided location for the uploaded files. Since: 1.1
323
+
324
+
Here are the failure codes associated with particular web element FailedDTOs:
Copy file name to clipboardExpand all lines: pax-web-extender-whiteboard/src/main/java/org/ops4j/pax/web/extender/whiteboard/internal/BundleWhiteboardApplication.java
+1-2Lines changed: 1 addition & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -76,8 +76,7 @@ public class BundleWhiteboardApplication {
Copy file name to clipboardExpand all lines: pax-web-extender-whiteboard/src/main/java/org/ops4j/pax/web/extender/whiteboard/internal/ExtendedHttpServiceRuntime.java
0 commit comments