Results 1 to 4 of 4
- 11-19-2011, 03:23 AM #1
Member
- Join Date
- Dec 2010
- Posts
- 6
- Rep Power
- 0
java packages and (web)applications
Hello,
I am very new to the java programming language, java servlets is perhaps even more confusing to me. So I'm hoping my explanation will make some sense.
I have set up a server through Terminal (/Command Prompt), more specifically the Mobicents Sip Server. And to test this server Mobicents provided a sample application 'click-to-call' (which can be accessed through localhost:8080/click2call/ when the server has been started). The WEB-INF directory of this directory contained four java classes, two of which are called SimpleWebServlet and SimpleSipServlet (the code can be found here: http://www.google.com/codesearch#NmC...s_navigation=1).
I am a bit confused how these classes are being used upon running the (web)application, as they are part of a package.
Also, does the SimpleWebServlet correspond to the web application and the SimpleSipServlet to the (SIP) server I started? Or what is the appropriate way I should address these two classes?
Thanks in advance.
- 11-21-2011, 01:26 PM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Re: java packages and (web)applications
Is there a web.xml file in the WEB-INF directory?
This is where the mapping of the servlet to a URL is done, so the server knows that click2call/SimpleWeb maps to SimpleWebServlet, for example.
- 11-24-2011, 12:17 AM #3
Member
- Join Date
- Dec 2010
- Posts
- 6
- Rep Power
- 0
Re: java packages and (web)applications
Hello,
thank you for your reply.
Indeed, there is a web.xml file:
so it's the part between <servlet-class> that informs the server it should deploy the simplewebservlet when visiting the url? Or is it related to the <url-pattern>?XML Code:<?xml version="1.0" encoding="iso-8859-1" ?> <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"> <display-name>Click To Call</display-name> <description>Simple Converged Sip Servlet Demo</description> <servlet> <servlet-name>ClickToCall</servlet-name> <servlet-class>org.mobicents.servlet.sip.example.SimpleWebServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>ClickToCall</servlet-name> <url-pattern>/call</url-pattern> </servlet-mapping> </web-app>
- 11-28-2011, 01:16 PM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Similar Threads
-
using SSL in java applications
By porchrat in forum Advanced JavaReplies: 4Last Post: 06-28-2011, 01:15 PM -
Java Packages
By ShitalJain in forum New To JavaReplies: 12Last Post: 06-11-2011, 08:14 AM -
Importing packages from the packages within same application.
By sta2003 in forum New To JavaReplies: 3Last Post: 02-12-2008, 11:03 AM -
JDOM in java applications
By boy22 in forum Advanced JavaReplies: 1Last Post: 08-02-2007, 05:38 PM -
convert VB6 applications to Java
By bbq in forum New To JavaReplies: 1Last Post: 07-05-2007, 03:57 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks