What is web.xml file and what are all things can I do with it?

前端 未结 8 958
-上瘾入骨i
-上瘾入骨i 2020-11-30 17:18

The web.xml Deployment Descriptor Elements in Oracle\'s BEA WebLogic Server 8.1 Documentation pretty much sums up each element in a web.xml file. But I am also curious about

相关标签:
8条回答
  • 2020-11-30 18:16

    What all should I know about web.xml apart from element name and their usage ?

    The SINGLE most important JSP configuration parameter of ALL TIME is in your web.xml. Ladies and gentlemen, I give you... the TRIM-DIRECTIVE-WHITESPACES option!

    <jsp-config>
        <jsp-property-group>
            <url-pattern>*.jsp</url-pattern>
            <trim-directive-whitespaces>true</trim-directive-whitespaces>
        </jsp-property-group>
    </jsp-config>
    

    This removes all the hundreds or thousands of lines of white space that you'll get in your generated HTML if you use any tag libraries (loops are particularly ugly & wasteful).

    The other big one is the default web page (the page you get automatically sent to when you don't enter a web page in the URL):

    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>    
    
    0 讨论(0)
  • 2020-11-30 18:22

    Deployment descriptor file "web.xml" : Through the proper use of the deployment descriptor file, web.xml, you can control many aspects of the Web application behavior, from preloading servlets, to restricting resource access, to controlling session time-outs.

    web.xml : is used to control many facets of a Web application. Using web.xml, you can assign custom URLs for invoking servlets, specify initialization parameters for the entire application as well as for specific servlets, control session timeouts, declare filters, declare security roles, restrict access to Web resources based on declared security roles, and so on.

    0 讨论(0)
提交回复
热议问题