4

I'm currently learning about JavaEE in school and haven't come across the meaning behind the web.xml file and the face-config.xml file. I know from my textbook "Core Java Server Faces" 3rd edition that the face-config file can have additional configuration parameters placed in it. For example I have seen what I believe to be declarations to some of my bean parameters in a face-config file and some navigation to other pages such as...

    <navigation-rule>
        <navigation-case>
            <from-outcome>startOver</from-outcome>
            <to-view-id>/index.xhtml</to-view-id>
        <navigation-case>
    </navigation-case>

And what the hoot is web.xml for? The textbook says my web.xml and beans.xml are needed to keep the application server happy. Okay cool but how does web.xml and face-config.xml interact? Do they? Are these two files like the frame for my painting and the canvas for me to paint on?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Stubudd
  • 141
  • 2
  • 8

2 Answers2

4

In a nutshell:

  • web.xml is the deployment descriptor file and it is part of the servlet standard for web applications. It is used to determine how URLs map to servlets, which URLs require authentication, and other information. This file resides in the app's WAR under the WEB-INF/ directory.

    Citation: Google Cloud Platform documentation:

  • faces-config.xml is usually the name for the application configuration resource file in JavaServer Faces technology and provides a portable configuration format (as an XML document) for configuring resources.An application architect creates one or more files, called application configuration resource files, that use this format to register and configure objects and to define navigation rules.

    Citation: Java EE 5 tutorial.

Spyros K
  • 2,480
  • 1
  • 20
  • 37
0

what ever programming language you choose,you have to inform the language about some initial look up details,then that language will take care of remaining process.so in java web.xml is such a file which is used for informing the java based web applications about where to look up and what to take up for initial start up.This web.xml is the heart of java based web applications.

Madhesh
  • 69
  • 6
  • 1
    The purpose of the web.xml is not to be used by the application, neither the Java language. It is used by the server. – Spyros K Nov 16 '15 at 19:17