creating web.xml - need help

Discussion in 'Java' started by vidya, Jul 26, 2005.

  1. vidya

    vidya Guest

    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
     
    vidya, Jul 26, 2005
    #1
    1. Advertising

  2. vidya

    Nic Guest

    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
     
    Nic, Jul 26, 2005
    #2
    1. Advertising

  3. vidya

    Juha Laiho Guest

    "vidya" <> 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)
     
    Juha Laiho, Jul 29, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chetna Joshi
    Replies:
    0
    Views:
    504
    Chetna Joshi
    Jul 5, 2003
  2. adamR
    Replies:
    4
    Views:
    2,632
    Juha Laiho
    Jul 16, 2004
  3. Kristen
    Replies:
    5
    Views:
    386
    Mark Rae
    Aug 14, 2006
  4. Erik Wasser
    Replies:
    5
    Views:
    463
    Peter J. Holzer
    Mar 5, 2006
  5. Replies:
    5
    Views:
    86
    Chris Angelico
    May 14, 2014
Loading...

Share This Page