Oracle Server E10293-02 Instrukcja Użytkownika Strona 28

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 108
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 27
Configuring SIP Applications in sip.xml
2-14 Oracle Communication and Mobility Server Developer’s Guide
Defining a Servlet
The <servlet> element defines the SIP containers servlets. A servlet requires a
servlet name <servlet-name>, and a servlet class, <servlet-class>. The name
must be unique within the application and the class must be the fully qualified name
of the servlet class, as illustrated in
Example 2–7.
Example 2–7 Servlet Name and Servlet Class
<servlet>
<servlet-name>MyServlet</servlet-name>
<servlet-class>com.company.example.MyServlet</servlet-class>
</servlet>
A servlet can also have its own init parameters, <init-param> and a description
<description>. When the container starts, it only instantiates and calls the init()
method for the servlets which have set the <load-on-startup> element, as shown
in
Example 2–8.
Example 2–8 Defining a Servlet
<servlet>
<servlet-name>MyServlet</servlet-name>
<servlet-class>com.mydomain.test.MySipServlet</servlet-class>
<init-param>
<param-name>logging</param-name>
<param-value>true</param-value>
<description>
Set if logging should be switched on (true) or not (false).
</description>
</init-param>
<init-param>
<param-name>infotainment</param-name>
<param-value>http://www.infotainmentsite.com</param-value>
<description>
The site to use as the infotainment content provider.
</description>
</init-param>
<load-on-startup/>
</servlet>
Defining the Servlet Mapping
The <servletmapping> element of the SIP servlet application deployment
descriptor defines the conditions for invoking a servlet.
Example 2–9 illustrates how a
servlet named MySipServlet can only be invoked for incoming MESSAGE requests. For
more information, see
"Servlet Mapping".
Example 2–9 Servlet Mapping
<!-- Servlet Mappings for incoming requests-->
<servlet-mapping>
<servlet-name>My Sip Servlet</servlet-name>
<pattern>
<equal>
<var>request.method</var>
<value>MESSAGE</value>
</equal>
</pattern>
</servlet-mapping>
Przeglądanie stron 27
1 2 ... 23 24 25 26 27 28 29 30 31 32 33 ... 107 108

Komentarze do niniejszej Instrukcji

Brak uwag