Archiv der Kategorie: pax-web

Just Annotation

Starting with version 2.0 of Pax-Web it’s possible to use Servlet 3.0 annotations for Servlets in a web application bundle (WAB). As defined in the Servlet spec it’s possible to have servlet definitions and configuration either in a web.xml or in the annotations of the Servlet. In this case the annotation of the servlet does override the configuration found in the web.xml. According to the servlet spec it’s even possible to skip the web.xml completely. That’s the part where Pax-Web 3.0 will kick in. Starting with version 3.0.0.M2 it’s possible to deploy a purely annotated WAB. It just needs a annotated Servlet

Bind certain Web-Applications to specific HttpConnectors

Starting with Pax-Web 2.1 it’s possible to bind web applications to a specific http-connector. For this to work you need to configure an additional http connector through jetty.xml. The jetty.xml for pax-web uses a slightly different way of configuring connectors. Instead of setting a new Connector the jetty.xml is interpreted after the Jetty Server has already been configured. Therefore you need to add a connector, not create a new one.

    <Call name="addConnector">
      <Arg>
          <New class="org.eclipse.jetty.server.nio.SelectChannelConnector">
            <Set name="host"><Property name="jetty.host" /></Set>
            <Set name="port"><Property name="jetty.port" default="8282"/></Set>
            <Set name="maxIdleTime">300000</Set>
            <Set name="Acceptors">2</Set>
            <Set name="statsOn">false</Set>
            <Set name="confidentialPort">8443</Set>
            <Set name="name">jettyConn1</Set>
	    <Set name="lowResourcesConnections">20000</Set>
	    <Set name="lowResourcesMaxIdleTime">5000</Set>
          </New>
      </Arg>
    </Call>

Make sure you have a name configured for this connector. The sample uses jettyConn1 as name.