Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2005

Tip: Looking for answers? Try searching our database.

creating web.xml - need help

Thread view: 
vidya - 26 Jul 2005 06:40 GMT
hi,

I am using JSPs, java beans and java files for my project. Tomcat is
the server. I put all the java beans and files (compiled ones)in
WEB-INF directory.

The directory structure is,
myproject
  |
JSPs + WEB-INF folder
         |
       classes folder + web.xml
          |
        .class files

I think my strcuture is correct, byt im having confusion about what
should i write inside web.xml file.

I should tell the server that the classes are in this particular
folder. right? And i think i should tell it using web.xml. but what is
the syntax for it?? can anybody please help me?

Thanks in advance.
Vidya
Nic - 26 Jul 2005 08:32 GMT
> The directory structure is,
> myproject
[quoted text clipped - 11 lines]
> folder. right? And i think i should tell it using web.xml. but what is
> the syntax for it?? can anybody please help me?

Hi,
web.xml is in WEB-INF folder.
Tomcat looks for classes in WEB-INF/classes
and library in WEB-INF/lib.

You don't have to tell him explicitly in web.xml
bye
nic
Juha Laiho - 29 Jul 2005 14:33 GMT
"vidya" <vpt@csmsoftware.com> said:
>I am using JSPs, java beans and java files for my project. Tomcat is
>the server. I put all the java beans and files (compiled ones)in
[quoted text clipped - 11 lines]
>I think my strcuture is correct, byt im having confusion about what
>should i write inside web.xml file.

If I read that correctly, then, yes, your structure is correct.
Minimally, your web.xml just needs to contain the <web-app>
element, without any subelements - if you don't have any servlet
classes that should be accessible through URLs by clients (and
you don't have any need for the other functionality provided
by web.xml).

>I should tell the server that the classes are in this particular
>folder. right? And i think i should tell it using web.xml. but what is
>the syntax for it?? can anybody please help me?

Please read the servlet specification (check which is the correct
specification version for the version of Tomcat you're using). The
servlet specification contains (among other, important, issues) the
syntax for web.xml.

There is a standard directory structure that is required for servlet
applications - this is the WEB-INF directory, having contents:
- web.xml file (mandatory)
- classes subdirectory (optional)
- lib subdirectory (optional)

... but I still leave the details of this to the servlet specification,
which I consider to be mandatory material for anyone writing servlet
applications. See http://java.sun.com/products/servlet/ .
Signature

Wolf  a.k.a.  Juha Laiho     Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
        PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.