Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > creating web.xml - need help

Reply
Thread Tools

creating web.xml - need help

 
 
vidya
Guest
Posts: n/a
 
      07-26-2005
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

 
Reply With Quote
 
 
 
 
Nic
Guest
Posts: n/a
 
      07-26-2005
vidya wrote:
> 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?
>


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
 
Reply With Quote
 
 
 
 
Juha Laiho
Guest
Posts: n/a
 
      07-29-2005
"vidya" <(E-Mail Removed)> 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
>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.


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/ .
--
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)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Error Creating Control" when creating a custom control (Design Time). Can't see tooltip message. Ravi Ambros Wallau ASP .Net Web Controls 0 06-01-2005 02:36 PM
"Error Creating Control" when creating a custom control (Design Time). Can't see tooltip message. Ravi Ambros Wallau ASP .Net 0 06-01-2005 02:36 PM
Urgent Help Need: Error creating control on ASP TreeView Jie ASP .Net 1 11-13-2004 04:38 PM
need help creating a new asp.net project soni29 ASP .Net 0 11-30-2003 07:31 PM
Need help on creating a shortcut to a Web Application using a .NET Web Setup project in VS.NET 2003. Chetna Joshi ASP .Net 0 07-05-2003 01:50 PM



Advertisments