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

ServletContextListener attribute set in event is null

I have a ServletContextListener like the one below public class MyServletContextListener implements ServletContextListener { @Override public void contextInitialized(ServletContextEvent servletContextEvent) { System.out.println("Start"); …
Ovi Faur
  • 518
  • 3
  • 19
0
votes
1 answer

welcome-file index.xhtml gives Not Found in ExternalContext as a Resource

I have a jsf project which deployed to wildfly 10 server . After deployment I navigate to deployment root (http://localhost:8080/{deployment-name}/) get "/home/default.xhtml Not Found in ExternalContext as a Resource" error but when I navigate…
Osman Corluk
  • 325
  • 1
  • 3
  • 12
0
votes
1 answer

temporary file creation and deletion in web.xml or spring/servlet?

I am trying to create temporary files and folder which will delete after a specified time or when the session timeout. Is there there way to do this in servlet or spring ?
neel
  • 9
  • 5
0
votes
0 answers

Unable to cache static resources on Tomcat 8

With the below settings in web.xml I still don't see any caching going on in the headers: curl -X HEAD -i http://localhost:8080/css/style-index.min.css?v=iris-7.23- Server: Apache-Coyote/1.1 Set-Cookie: JSESSIONID=782E2A12B148B7A53DBDD4B3C081EA33;…
jBoive
  • 1,219
  • 1
  • 14
  • 40
0
votes
1 answer

Specifying UI class for SpringVaadinServlet inside web.xml

I have a Vaadin application which uses ru.xpoft.vaadin.SpringVaadinServlet as its single servlet. Now I am trying to change the servlet class to com.vaadin.spring.server.SpringVaadinServlet. But I don't know how to specify the UI class for…
AJA
  • 456
  • 3
  • 12
0
votes
1 answer

How to add a separate web deployment descriptor?

So i have a dynamic web project. Servlet mapping is defined in WEB-INF/web.xml I know i can add further mapping in web.xml, but it get things easily messed up coz I am adding url paths that are just many. So, how do i add a new web deployment…
ivanceras
  • 1,415
  • 3
  • 17
  • 28
0
votes
1 answer

Resrouce-ref in web.xml breaks servlet mapping

I am trying to add a resource-ref to my web.xml. It looks like this:
IonicBlaze
  • 125
  • 1
  • 11
0
votes
0 answers

How do I do complex url patterns for security constraints?

I am using the following to secure parts of my website. secure /*
0
votes
1 answer

java tomcat: only a type can be imported. com.a.B resolves to a package

i have the following project structure: ./WEB-INF/web.xml ./WEB-INF/lib ./WEB-INF/classes/com/a/B.class ./index.jsp when i try to put this project in tomcat webapp and try to execute index.jsp i get the error: org.apache.jasper.JasperException:…
ufk
  • 30,912
  • 70
  • 235
  • 386
0
votes
0 answers

mapping of url in web.xml for java servlet

I read this - url mapping in stackoverflow. I am new to java web, and trying to map the url in web.xml for company detail page... I have following lines in web.xml CompanyController
Veshraj Joshi
  • 3,544
  • 3
  • 27
  • 45
0
votes
1 answer

Simple Servlet Not Working

My servlet is not workning. Cold someone help me ? you can see thre files her : web.xml, java code, and jsp page. thanks for some help. web.xml file : <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="UTF-8"%> …
0
votes
0 answers

No mapping found for HTTP request with URI-Spring Error

I have the following web.xml file .The server config is JBOSS 6.1 and i use Spring STS for development.The issue is on server startup,sometimes(not always),I get the default "QbatLogin.jsp" page but the rest of the pages do not appear.I use…
Random
  • 23
  • 3
0
votes
1 answer

Inherit web.xml from jar file

We have many web applications that have shared setting (the web.xml and servlets are the same) and just Spring routes requests to different beans (BlazeDS & Spring). My question is: is there a way to place web.xml in a shared jar? or another way to…
mbdev
  • 6,343
  • 14
  • 46
  • 63
0
votes
1 answer

How to implement correctly web.xml for spring-mvc and spring-security together

Hello I am trying to develop a spring mvc web application includes spring security and hibernate. I searched on Google but I could not figure out how to concate spring mvc configurations and spring security configurations in web.xml file. Finally I…
Ali insan Soyaslan
  • 836
  • 5
  • 14
  • 33
0
votes
1 answer

Look up a dynamic JNDI name

My application code receives the JNDI name to look up at runtime. Hence, the JNDI name may not be configured beforehand in web.xml or in the @Resource annotation. How may I lookup an Object in such a scenario? Application is running on Tomcat 7.
Somu
  • 3,593
  • 6
  • 34
  • 44