Questions tagged [web.xml]

The web.xml is the web deployment descriptor file of Java Servlet based web applications. It allows you to define, declare and configure the Servlet API based implementations in your web application, such as servlets, filters and listeners.

A deployment descriptor (DD) refers to a configuration file for an artifact that is deployed to some container/engine.

In the Java Platform, Enterprise Edition, a deployment descriptor describes how a component, module or application (such as a web application or enterprise application) should be deployed. It directs a deployment tool to deploy a module or application with specific container options, security settings and describes specific configuration requirements. XML is used for the syntax of these deployment descriptor files.

For web applications, the deployment descriptor must be called web.xml and must reside in the WEB-INF directory in the web application root.

Further Reading:

2074 questions
0
votes
1 answer

Spring application deployed but context fails to start

After some modifications in my XML configuration files, my current spring project do not start anymore on tomcat. Message displayed is: FAIL - Deployed application at context path /loja but context failed to start in the catalina.out file, it's…
Kleber Mota
  • 8,521
  • 31
  • 94
  • 188
0
votes
1 answer

Can't load properties file for log4j 2 from path on disk

For my application in Glassfish 4.1.1 I'm configuring path to properties file in web.xml: log4jConfiguration file:///G:/log4j2.properties My…
0
votes
2 answers

DispatcherServlet doesn't redirect to the appropriate view

I keep getting the 404 not found HTTP response when asking for the appropriate view. These are my config files. web.xml
Soufiane Rabii
  • 427
  • 2
  • 8
  • 29
0
votes
1 answer

Apache Tomcat 9 - HTTP Status 404 on browser

I'm trying to create a simple web service, but I'm getting 404 when I try to go to the URL. Here's the web.xml:
E. Muuli
  • 3,940
  • 5
  • 22
  • 30
0
votes
0 answers

Exclude url from basicAuthenticationFilter

I want to exclude one url from filter mapping, is it possible to do that in web.xml? basicAuthenticationFilter org.springframework.web.filter.DelegatingFilterProxy
anand
  • 11,071
  • 28
  • 101
  • 159
0
votes
1 answer

Display menu items depending on user roles defined in web.xml

I have my own realm classes extends AppservPasswordLoginModule and AppservRealm where I get user and roles from my own table in database. In web.xml I defined access to pages and it works. I have some mechanism to read main menu from my menu.xml…
0
votes
1 answer

Spring MVC - ContextLoaderListener loaded twice

So my head really hurts - I have read about Role/Purpose of ContextLoaderListener in Spring and I cannot go one step further. I have a really old project and I'm upgrading it. So far I've managed to bring it from spring 2.x to spring 4.x and from…
atoha
  • 81
  • 4
0
votes
1 answer

How to configure a non-spring pure javaee web-application without web.xml

I want to create a simple web application that runs on tomcat with pure java configuration. I know how to do it with Spring frameworks WebApplicationInitializer. But i don't know without Spring. I have heard about @WebServlet Please guide me.
Kazi
  • 113
  • 2
  • 13
0
votes
2 answers

Passing parameter to web.xml from .txt file

How to read value from Session.txt and pass that value to web.xml? I am trying to set session-timeout for a Java web application by placing the Session.txt file outside the project folder and reading the value to web.xml.
Pavithra
  • 29
  • 1
  • 1
  • 14
0
votes
2 answers

Setting session timeout without web.xml in java web application

Is it possible to set session timeout without setting in web.xml or servlet for java web application? 60(time in minutes) And how to read .txt file which contains time and give…
Pavithra
  • 29
  • 1
  • 1
  • 14
0
votes
0 answers

How to redirect invalid URLs with valid action at the end

When accessing our website with an invalid action in the url followed by a valid action, web xml is not filtering it out. Below is an example. https://portal.abcd.org/Enroll - Loading Enroll Page https://portal.abcd.org/sdafj - Loading Page not…
RakeshS
  • 119
  • 1
  • 2
  • 13
0
votes
0 answers

what is the actual reson of using com.sun.faces.config.ConfigureListener in web.xml of a JSF Project

I'm a beginner to JSF Framework. When I enable the jsf capabilities in my maven project. It's automatically generating some XML codes inside the web.xml. But I don't know what they actually do?. can anyone explain me about last three tags. explain…
M. Nashath
  • 107
  • 1
  • 4
0
votes
1 answer

making files under folder accessable by their url

I have a webproject in J2ee , now there are some files which can be access directly by typing thier URL and some files which cannot be accessed EG files under folder admin/xyz.js are Not accesble but files under folder common/xyz.js is…
akp
  • 1,823
  • 7
  • 26
  • 29
0
votes
1 answer

What does the following entry in web.xml refer to?

one is under ROOT as webapps/ROOT/jsp/error.jsp and other is under webapps/documents/jsp/errorpage.jsp and my web.xml entry is as follows ErrorPage
0
votes
1 answer

How change dynamiclly the welcome-file in web.xml according to incoming ROOT request

I want to display the index html in different in 2 cases: Recognise if the request come from Mobile device so redirect welcome-file to mobile.html , If the request come from web page redirect to second welcome-file web_index.html HOW CAN I DO A…
VitalyT
  • 1,671
  • 3
  • 21
  • 49