Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Deploying the application  RSS feed

 
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<p>
Hi all....I am not able to deploy my application correctly.
I wrote a small application called TestingServlet.java
My project make is TestingProject and my application is under the package com.elite.servlet.
To be more clear the structure is like this

TestingProject(ProjectName)
|-
WEB_INF/src
|-
com.elite.servlet
|-
TestingServlet.java

Now how should i use the web.xml
<servlet>
<servlet-name>TestingServlet</servlet-name><br>
<servlet-class>TestingServlet</servlet-class><br>
</servlet>
<servlet-mapping>
<servlet-name>TestingServlet</servlet-name><br>
<url-pattern>???</url-pattern><br>
</servlet-mapping>

My doubt is how should i give my url-patter.
And how should i invoke in my browser
Please Help me to clear my doubt.
Thanks in advance
Ramya
 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll give you as an example my own web.xml.
This web.xml tells Tomcat how to work with my web application
called gco. So, in my Tomcat folder, I have a folder C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\gco.

Inside the WEB-INF folder of this web application "gco" is the web.xml and it contains the following code

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
<display-name>CLUIF</display-name>
<description>CLUb op het Internet voor Filmfanaten</description>
<servlet>
<servlet-name>LoggerServlet</servlet-name>
<servlet-class>org.gertcuppens.controller.LoggerServlet</servlet-class>
<init-param>
<param-name>properties</param-name>
<param-value>WEB-INF\classes\log4j.properties</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>

<servlet>
<servlet-name>org.gertcuppens.controller.CluifController</servlet-name>
<servlet-class>org.gertcuppens.controller.CluifController</servlet-class>
</servlet>
<servlet>
<servlet-name>org.gertcuppens.controller.ImageServlet</servlet-name>
<servlet-class>org.gertcuppens.controller.ImageServlet</servlet-class>
</servlet>


<servlet-mapping>
<servlet-name>org.gertcuppens.controller.CluifController</servlet-name>
<url-pattern>/cluif</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>org.gertcuppens.controller.ImageServlet</servlet-name>
<url-pattern>/cluifimg</url-pattern>
</servlet-mapping>



</web-app>

The most important servlet is CluifController.
With the following lines I tell Tomcat to which class belongs this Cluifcontroller. In my case, I've been too lazy to give a different name; so Class and name are the same.

<servlet>
<servlet-name>org.gertcuppens.controller.CluifController</servlet-name>
<servlet-class>org.gertcuppens.controller.CluifController</servlet-class>
</servlet>

And which URL should be used to invoke this servlet ?
<servlet-mapping>
<servlet-name>org.gertcuppens.controller.CluifController</servlet-name>
<url-pattern>/cluif</url-pattern>
</servlet-mapping>


So, when I start Tomcat on my PC with http://localhost:8080, I get
the default start screen of Tomcat. To invoke my web application I have to write http://localhost:8080/gco/cluif.

With /gco, Tomcat knows it has to look for the web.xml inside the gco-folder. And with /cluif, Tomcat knows it has to start the servlet called org.gertcuppens.controller.CluifController.
 
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use something like
<url-pattern>/iwantyoucall*</url-pattern>

In this case I can reach it:
<a href="http://host/warname/<b rel="nofollow">iwantyoucall</b>something/somestring??some=parameters" target="_blank">http://host/warname/iwantyoucallsomething/somestring??some=parameters
 
meena latha
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks....
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!