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

Loading a spring config at server startup

I have a jsp login page for identifying users. To configure JdbcTemplate , I set up its properties with spring under "WEB-INF/applicationContext.xml" , so for loading spring context , i added some tags in web.xml . But , autowiring jdbcTemplate…
0
votes
1 answer

CSRF Validation/Verification doesn't work on exported war builds - while using OWASP CSRFGuard

I have a web application built using Spring MVC framework. I wanted to fix the CSRF vulnerability without using Spring Security. As I have other custom code is enabled for user authentication/ authorization. Thus I decided to use the OWASP CSRF…
0
votes
1 answer

Is it possible to get the root-context (defined on the web.xml) of an application

Example of root-context /Tesoreria-WEB 300 Is it possible to get that…
BugsForBreakfast
  • 712
  • 10
  • 30
0
votes
0 answers

How to map Java exceptions to HTTP Status codes?

Currently working on a legacy Java-web project (Java 8, Tomcat 7, mix of good ol' JSP's, JSF & various Servlet stuff e.g. web.xml v2.5) I'd like to be able to let specific Java technical exceptions flow until Tomcat catches them, in order to use its…
maxxyme
  • 2,164
  • 5
  • 31
  • 48
0
votes
1 answer

web.xml struts filter causes server starting error

Whenever I add the filter tag into the web.xml file I get the following error. SEVERE: The required Server component failed to start so Tomcat is unable to start. org.apache.catalina.LifecycleException: A child container failed during start at…
Joda
  • 1
0
votes
1 answer

JBoss 6.1.0 AS filter position in web.xml

The following error is shown when trying to deploy WAR in JBoss 6.1.0 DEPLOYMENTS IN ERROR: Deployment "vfs:///D:/workspace/.metadata/.plugins/org.jboss.ide.eclipse.as.core/JBoss_AS_6.x1555321418499/deploy/MyProject.war" is in error due to the…
S_S
  • 1,276
  • 4
  • 24
  • 47
0
votes
0 answers

Url pattern "/*" not working in mvc project

While using "/*" as url pattern in web.xml in spring mvc, I am not redirected to page. Whenever i try below urls, i am getting logger inside the controller methods but i am not getting the page. Url tried : http://localhost:8080/mvc-example Logger…
0
votes
0 answers

Handling 302 Redirect in Tomcat's web.xml

Is it possible to handle 302 redirect in web.xml using and tags? For example, 302 index.html This code is not working. Am I missing anything…
Crash OR
  • 327
  • 1
  • 3
  • 14
0
votes
1 answer

How to get a request on controller for endpoint which is defined as default servlet-mapping on web.xml?

I am working on a server where we are using a third party API provider for a particular service. The third party send a image endpoint. Eg. "/media/image/image.jpg". The image is available on the third party base URL. I need to make the image…
0
votes
0 answers

how to configure a servlet as a filter

I am trying to simulate something like L7 in struts. where we have a lot of filters in web.xml. but when the URL pattern matches something like "abc/qwe"the L7 simulation filter must skip all the filters after it and execute a servlet.
Prabu M
  • 109
  • 2
  • 8
0
votes
0 answers

How do I redirect a servlet to a static html page?

I am using Tomcat 6 on an Apache server and have an app in webapps called support that is working correctly. There are two urls that are used in calling pages called register and activate. They are both accessed by www.oururl.com/support/activate…
TimM
  • 1
0
votes
1 answer

Question on the first loaded page of my RESTful Jersey web application

My RESTful jersey project (dynamic web project) name is "my-jersey". I have resource class defined following method: @Path("/my") public class resource{ @GET @Produces(MediaType.TEXT_PLAIN) public String sayPlainTextHello() { …
Mellon
  • 37,586
  • 78
  • 186
  • 264
0
votes
0 answers

web.xml Session timeout increment with IdleMonitor Tag

Hi I have session timeout 16 minutes in web.xml on the server side. and for front end we are using primefaces IdleMonitor tag to show warning message at 14.5 minutes. User is getting into a screen where it shows huge search results, and user is…
0
votes
1 answer

@RequestMapping welcome file

My goal is to map /{any path} and *.html to a servlet without mapping /*. For example: map: /foo /foobar/ /bar.html /foo/bar.html don't map: /foo.js /bar.pdf In order to do this, I have a servlet and welcome file mapped like…
Keith
  • 2,958
  • 4
  • 26
  • 29
0
votes
0 answers

web.xml error using glassfish(payara) server on IntelliJ

I use IntelliJ to run my backend for my project. I use glassfish server to run my project, but everytime I run my project I get an xml error. I have tried to add the xlmns:web namespace, but it sais that it is not getting used. I have checked other…