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
0 answers

Getting not found error while redirecting to custom error pages

I am trying to redirect to a custom error.jsp page but I get the following not found page (looks like it is unable to locate error.jsp file). error page Location of my error.jsp file : project_root_dir --> src --> main --> webapp --> WEB-INF web.xml…
0
votes
1 answer

Problem in understanding the significance of xml file in web application

I am using jsp to develop a web application...using tomcat server... I am facing a bit problem in creating the web.xml file....what confusion i am having is that can an application have more than one web.xml file(obviously with a different name)?…
0
votes
0 answers

Consuming a Filter (in external JAR) in a Spring Application without web.xml

I have a third party jar which has a filter say XYZFilter. Usual way specified to configure this JAR in applications is to make a fresh entry in web.xml with XYZFilter which will invoke the filter. Later, we can consume APIs exposed by this JAR like…
user3310534
  • 19
  • 1
  • 4
0
votes
1 answer

configure BasicDataSource as bean in web.xml

I'm trying to configure org.apache.commons.dbcp.BasicDataSource as bean in web.xml under a tomcat project using tomcat 6. (it's red5 with tomcat, we can ignore that the main server is actually red5 because i actually run jsp files under port 5080…
ufk
  • 30,912
  • 70
  • 235
  • 386
0
votes
2 answers

How to use doGet in jsp with Servlet

I'm trying to send some thing to a servlet but i get this Etat HTTP 404 - /pdfreader/Services%20Web%20avec%20J2EE%20et%20.NET.pdf -------------------------------------------------------------------------------- type Rapport d''état message…
David
  • 47
  • 1
  • 3
  • 16
0
votes
1 answer

Tomcat web.xml: restrict access to specific methods of a servlet

I'm running a web application under Tomcat server. Different servlets are configured using Tomcat's web.xml. I'm looking for a convenient way to restrict access to specific METHODS of specific URLS so that only these METHODS can be accessed using an…
Forepick
  • 919
  • 2
  • 11
  • 31
0
votes
1 answer

problem with very first spring project

I just switched from Striped to Spring but i'm having issues with my very first project, Basically i get the 404 from the server. Strange enough, i have followed one by one all the steps in my book. I use Eclipse, Tomcat 6 and Spring 2.5 The…
JBoy
  • 5,398
  • 13
  • 61
  • 101
0
votes
1 answer

How can I set the content-disposition header for a zip-file referred to in welcome-file-list?

I want to create a WAR that would only contain a single zip file that is included in the of the web app, deploy that war to JBoss and be able to download the zipfile by accessing the root of the WAR. So, currently I have a war, which has the…
Vilho Ketjunen
0
votes
1 answer

Resource not injecting Datasource from web.xml - Java Framework - Payara Micro - NullPointerException

My Payara REST API is working fine without DB Connection, and also Postgres localhost connection works fine through DriverManager i.e.: Connection connection = DriverManager.getConnection("jdbc:postgresql://localhost:5432/postgres", "postgres",…
B Sohal
  • 13
  • 3
0
votes
1 answer

cvc-complex-type.2.4a: Expected elements "run-as, security-role-ref, multipart-config" instead of "load-on-startup" here in element "servlet"

I got the following error while deploying a war in weblogic server but it is getting deployed successfully in wildfly 17 . Error Unable to access the selected application. Error VALIDATION PROBLEMS WERE FOUND <113:5> problem:…
0
votes
2 answers

Server Tomcat v8.5 Server at localhost failed to start Eclipse due to web.xml or servlet.java

I am building a simple dynamic web app that displays the weather of a given place. Initially, It was running fine but when I created the servlet, the tomcat server did not get started. I am attaching all the files in my project. any help would be…
0
votes
1 answer

Prevent Tomcat6 from caching for an application

I have an application running in a Tomcat6. Can I prevent Tomcat from caching for this application by setting in the web.xml? if yes, how? Thanks, M
Mirko
  • 13
  • 1
  • 3
0
votes
1 answer

The webpage cannot be found - HTTP 404 JSP page

Experts, My dynamic web project having 3 JSP page and 3 servlets .. and everthing was working fine till date. when i executed the same project today, it was showing this below message. The webpage cannot be found - HTTP 404 I deleted the whole…
TTT
  • 37
  • 8
0
votes
0 answers

Unable to run java servlet on Ubuntu

I am trying to run a java servlet on an Ubuntu machine. I have copied my project directory and web.xml file below. I have Java and Tomcat9 installed, and Tomcat seems to be working properly, as the initial splash screen shows up on port 8080. I have…
Sal
  • 1,471
  • 2
  • 15
  • 36
0
votes
2 answers

Tomcat FORM based authentication, on every page

I would like to use authentication form on every page (in the header of the page), so user could authenticated from any page. I'm using Tomcat's FORM based authentication, but when i go to my index page, and try to login using the form in the…
Igor
  • 1,406
  • 2
  • 23
  • 45