Use the New SIP Servlet wizard to create a Session Initiation Protocol (SIP) servlet. A
SIP servlet is a Java-based application component that performs SIP signaling and is run by a
Java-enabled SIP application server.
Before you begin
Before you create a SIP servlet, you must complete these tasks:
- Create a SIP project.
- Change to the Web development perspective.
Tip: [WebSphere® Application Server traditional] For SIP projects
targeted to WebSphere Application Server, on the SIP
preferences page (), ensure that Always update the deployment descriptors is
selected so that the web deployment descriptor (web.xml) is updated
with the new servlet that you create.
Procedure
To create a SIP servlet:
- In the Enterprise Explorer view, right-click the project where you want to add a SIP Servlet,
and then click .
- Open the SIP folder, click SIP Servlet, and then
click Next.
- On the first page of the wizard, either enter a Java™
package and class name, or select an existing servlet class or JSP, and click
Next. Typically, the superclass is
javax.servlet.sip.SipServlet.
- On the second page of the wizard, enter deployment information such as the description,
initialization parameters, and any servlet mappings.For SIP 1.1 servlets, you can select to use this servlet as the main
servlet. Click Next.
Tip: You can change deployment information later by using the deployment descriptor
editor.
Important: The following information applies when you create a SIP
servlet in a SIP 1.1 project with Web 3.0 and later facets:
- All servlets that are created by the wizard have the @SipServlet
annotation.
- If you select Use this Servlet as the Main Servlet, WebSphere Developer
Tools creates an annotated SIP servlet and a package-info.java file. This file
contains the @SipApplication configuration for the main servlet. When you start the
Create SIP Servlet wizard again, you cannot specify any servlet selection
options, because only one main servlet can be in a SIP application.
- If you select Specify Servlet Mappings, WebSphere Developer Tools creates
a non-annotated SIP servlet and then configures it in the sip.xml file.
- On the final wizard page, specify the modifiers, interfaces, and method stubs you want to
generate and click Finish.
- If you are prompted to update the Web deployment descriptor, click
Yes.
Tip: [WebSphere Application Server traditional]
For SIP projects targeted to WebSphere Application
Server, if you click No, or if you turned off the preference to always update
the deployment descriptors, then you can update the Web deployment descriptor
(web.xml) file later. (Right-click the sip.xml file and
click ).
Results
The wizard creates the new servlet in the specified source folder and opens it in the Java editor.