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
19
votes
1 answer

Configuring a spring-boot application using web.xml

I'm bootifying an existing Spring Web application so the generated war file embed a Jetty web server. I want to stick to the existing configuration as much as I can in order to limit the regressions. Here is the existing web.xml:
18
votes
2 answers

ViewExpiredException shown in java.lang.Throwable error-page in web.xml

I'm working on a JSF web application in which I need to bring up a "Session Expired" page if the view expires, but a general technical error page for all others. The application only goes to the technical error page when I trigger the exception. …
Luke
  • 181
  • 1
  • 1
  • 3
17
votes
2 answers

Security constraint in web.xml for authenticated users without role memberships

I am quite desperate, because I think there must be an easy solution to my problem but I am searching - to no avail. I am using a custom Realm in Glassfish 3.1.1. This custom realm (implements AppservPasswordLoginModuleInterface) takes a security…
msaladin
  • 405
  • 1
  • 5
  • 12
17
votes
3 answers

How to specify multiple package names for service classes in REST web service using Jersey

How do I specify multiple for a given under servlet's tag. Following is my web.xml file:
Learner
  • 1,503
  • 6
  • 23
  • 44
17
votes
4 answers

Can load-on-startup in web.xml be used to load an arbitrary class on startup?

How can I load an arbitrary class on startup in Tomcat? I saw load-on-startup tag for web.xml file, but can I use it and how should I implement my…
enfix
  • 6,680
  • 12
  • 55
  • 80
17
votes
5 answers

EL expressions not evaluated in JSP

There's a small problem with my servlets/jsp web application. I'm trying to use jstl in jsp page. When I use any tag for example: it shows me ${command} in my browser instead of parameter 'command' value. I'm using…
Gleb S
  • 403
  • 1
  • 5
  • 13
17
votes
2 answers

Realm name in tomcat (web.xml)

What is the realm-name in the tomcat. BASIC In the above code I have to fill the realm-name element. I have seen the following code in the server.xml…
Krishna
  • 7,154
  • 16
  • 68
  • 80
15
votes
3 answers

What is the difference between session-timeout and max-age in web.xml?

I am not sure if I understand: 30 true 1800
Koray Tugay
  • 22,894
  • 45
  • 188
  • 319
15
votes
3 answers

How can I catch all errors to same page from web.xml?

I tried to use java.lang.Exception /errors/error.jsp but i dosen't catch 404 errors. How can I catch also 404 etc. errors to that same page ? I want to…
newbie
  • 24,286
  • 80
  • 201
  • 301
15
votes
1 answer

Spring application context : access web.xml context-params?

Greetings , Is there any way to get values from web.xml context-param into Spring context? For example I define the value in web.xml as : compass-index
Ashika Umanga Umagiliya
  • 8,988
  • 28
  • 102
  • 185
15
votes
1 answer

Some information about Spring web.xml and tag (referred to an Hello World example)

I am quite new in the Spring MVC World. Today I am studing the simple "Hello World" Example generated by STS doing: File ---> Spring Template Project ---> Spring MVC Project In the web.xml I have the declaration of the DispatcherServlet and the…
AndreaNobili
  • 40,955
  • 107
  • 324
  • 596
14
votes
3 answers

Servlet JSP web.xml

I see a feature in NetBeans for selecting a JSP for a Servlet and the result XML in web.xml is like this: TestServlet /index.jsp What does it mean? And what is it…
ehsun7b
  • 4,796
  • 14
  • 59
  • 98
14
votes
1 answer

Setting 'HttpOnly' and 'Secure' in web.xml

I need to have the 'HttpOnly' and 'Secure' attributes set to 'true' to prevent the CWE-614: Sensitive Cookie in HTTPS Session Without 'Secure' Attribute and CWE-402: Transmission of Private Resources into a New Sphere flaws from showing in the…
EH Khiari
  • 335
  • 1
  • 4
  • 12
14
votes
1 answer

Xframe option in tomcat 7

I have added the below code snippet in my tomcat web.xml to prevent clickjacking. In the section to add built-in filter, I have added httpHeaderSecurity
Rndp13
  • 1,094
  • 1
  • 21
  • 35
14
votes
2 answers

Security constraint in web.xml not getting applied to URL patterns having file extension

I have the following security constraints entered in the web.xml. My objective is that the XML files are in the Public area. This works for the /images/* folder. However the url-pattern *.xml does not seem to work. Any ideas ? …
mithrandir
  • 1,323
  • 4
  • 18
  • 39