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

Error 404 when accessing a resource in a Java Dynamic Web Project

can someone tell me how to setup my project structure and my web.xml? In my dynamic web project in the java resources folder i have a servlet (class name: RestFulService) which delivers a JSON file. The web pages are in the WebContent-folder, for…
0
votes
0 answers

MongoDB configuration with Spring MVC

I'm trying to connect MongoDB using Spring xml configuration i'm getting this error: INFO : org.mongodb.driver.cluster - Exception in monitor thread while connecting to server 192.168.1.7:27071 com.mongodb.MongoSocketOpenException:…
0
votes
2 answers

Basic authentication in Tomcat6 not working on directory

I have following structure in my tomcat web directory /webapps/ROOT.war /webapps/ROOT/ /webapps/protect/ In the web.xml inside my ROOT.war java application I have configured basic authentication for some of the pages of the ROOT application which…
Frank
  • 5,741
  • 4
  • 28
  • 49
0
votes
1 answer

Form Based authetication passing variable to JSP

We are using a form based authentication and below is the snippet from web.xml FORM /login.jsp?fromIndex=true
user2600752
  • 63
  • 1
  • 6
0
votes
1 answer

How to print context-param with jstl?

In web.xml i have email test In jsp I have
john
  • 647
  • 5
  • 23
  • 53
0
votes
1 answer

Spring MVC - issues while calling service from JS and while calling another JS from JSP file

I am trying Spring MVC 4 with datatables for publishing data on frontend. My project Name is NewEDXUI. Scenario :- index.jsp will get data from Controller/Rest Controller to publish data from database in Table format. Issues i am facing - i have…
niting
  • 55
  • 4
  • 12
0
votes
1 answer

Errors causing from web xml file

I'm having an issue in web.xml file. I'm getting the error, 'Server Tomcat v8.0 Server at localhost failed to start.' when I try to run my application. But this error can be bypassed when tag is used to web.xml file as shown below. But the new…
user3789200
  • 1,166
  • 2
  • 25
  • 45
0
votes
0 answers

Spring boot - unable to use web.xml with WAR deployment

I am not able to use web.xml with spring boot in war deployment. I am aware that there are ways of converting web.xml using @Configuration, but I must stick with web.xml for now. I was following the official document, here:…
RedA
  • 73
  • 3
  • 9
0
votes
1 answer

web.xml: how to map domain/xx/* to a servlet?

I have these URLs abc.com/aa/url1 abc.com/ab/url2 abc.com/ac/url3 etc. How to setup web.xml to map this pattern to a…
Tony
  • 603
  • 5
  • 9
  • 17
0
votes
1 answer

url-pattern for security-constraint not working

I've defined two roles - user User and administrator Admin in my web.xml. Problem 1 - I want the…
SeeObjective
  • 39
  • 1
  • 9
0
votes
1 answer

Reference properties files in WAS v8.5

We've purchased a thirdparty servlet that references a properties files from web.xml (i.e. d:\projects\MyProp.Properties) . Since moving to Websphere v8.5, we can no longer have the properties file on a logical drive and have to place it inside our…
Mark
  • 81
  • 12
0
votes
1 answer

JSP file not using CSS because of web.xml

I've had this simple jsp log-in form that used the css style sheet. It was working just fine until I included the web.xml file in my directory. Now the JSP file won't load the css files no matter what. I've tried changing the link address of the…
samatovS
  • 422
  • 4
  • 15
0
votes
2 answers

should web.xml contents should be in order?

my current web.xml file looks like this. and this is does not show any error. Archetype Created…
sagar limbu
  • 1,202
  • 6
  • 27
  • 52
0
votes
1 answer

Jenkins cannot find web.xml but Intellij can

I am running a test that reads web.xml as follows: new URL( new ClassPathResource("com/jettyrule/testwebapp/web-inf/web.xml") .getURL(), ".."); My test passes in Intellij but when I run in Jenkins, I get…
TheCoder
  • 8,413
  • 15
  • 42
  • 54
0
votes
2 answers

Spring injection in Filter implementation mapped in web.xml

web.xml: myFilter com.mypackage.MyFilter myFilter
amphibient
  • 29,770
  • 54
  • 146
  • 240