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

how can i change my url-pattern in servlet mapping without facing 404

UploadServlet com.UploadServlet UploadServlet /go
raj
  • 148
  • 13
0
votes
0 answers

redirect to a servlet when a url/link sent to user in email is clicked

i have a situation where an email is sent to a user containing a url in the format http://xxxxxxxxxx/user=ABCXYZ where ABCXYZ is a randomly generated 6 digit alphanumeric code. My question is when the URL is clicked it should redirect to my…
Akash Sharma
  • 1
  • 1
  • 1
  • 5
0
votes
0 answers

j_security_check not redirecting to correct jsp

I've been playing around with using j_security_check with jsp pages. When I hit the pages separately they all seem to work, however whenever I login It should redirect me to my /index.jsp but instead it just sends me to / which gives me a 404 since…
Kevin
  • 7
  • 7
0
votes
1 answer

Unable to access index.html from jetty

I am trying to deploy a jetty server. The deployment is happening fine and I am able to access all the resources. But I am unable to access the files in web root directory, specifically index.html. Here are my configurations: Web.xml
Abhishek Gupta
  • 6,465
  • 10
  • 50
  • 82
0
votes
1 answer

Any way to set distributable element in tomcat conf rather than WEB-INF/web.xml?

We will release our product as a WAR file and will deploy it into tomcat. However there a few different projects using the same WAR file, but some will use cluster and others not. The WEB-INF/web.xml in WAR file does not have
Randy Huang
  • 328
  • 3
  • 10
0
votes
1 answer

Spring+SpirngMVC+Hibernate configuration issue

My purpose is to use transaction by annotation. But when I only use context-scan in springmvc-servlet.xml, the annotation transaction doesn't work. So I figured out that it should use spring framework to annotate the beans rather than spring-mvc.…
user2301210
  • 399
  • 3
  • 12
0
votes
1 answer

Spring 4 + metadata-complete="false" + tiles 3

I am facing very specific problem with Spring. If I keep metadata-complete="true" in my web.xml, my application works lie a charm. But if I make it false, spring is not able to find tiles definitions. My code base versions are as follows: Spring…
Nirav
  • 1
  • 4
0
votes
1 answer

Access images in src/main/webapp/images in Vaadin project

In my Vaadin project I want to be able to access images as a static resource directly. When I put the images below src/main/webapp/VAADIN/themes/... it works. What do I have to do to access images if they are located in src/main/webapp/images? So…
Marco
  • 508
  • 2
  • 7
  • 22
0
votes
1 answer

Profile not getting picked from environment variable set in tomcat but is picking when mentione in web.xml

I have created a environment variable entry of profile to be active in my web application: In setenv.bat file in Tomcat server JAVA_OPTS=%JAVA_OPTS% -Dspring.profiles.active=prod And when my application tries to load datasource using active profile…
0
votes
1 answer

Accessing WAR with www.myApp.com instead of www.myApp.com:8080/myApp, Tomcat 8

i know there are several topics about this, but after days i am not able to localize and solve this problem. the steps i've done so far: installed tomcat 8.5.8 changed the following lines in /opt/tomcat/conf/server.xml
Steve
  • 384
  • 1
  • 7
  • 17
0
votes
1 answer

getServletContext().getAttribute() resets value?

The following code is my sample servlet application protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String userEmail = request.getPathInfo().split("/")[1]; …
0
votes
1 answer

Where is the right place for spring configuration files?

Why there must be in node with the "contextConfigLocation" ? Because if comment all the group then a project will not load?
thinker
  • 402
  • 1
  • 6
  • 15
0
votes
0 answers

Web.xml servlet-class references to non-existent class "ClassName"

I am working on a project and hit a brick wall. I couldn't find any resources or bug reports to solve this issue. I have a maven project setup as maven-archetype-webapp. I am new to JEE and it took me sometime to get this far but I have a better…
Grim
  • 2,398
  • 4
  • 35
  • 54
0
votes
1 answer

Is it possible to define custom JSP tag without web.xml

I have a Servlet 3.0 project where web.xml does not exist. Just realized web.xml will needed to refer the TLD. From Oracle custom JSP tag help page: 4 Reference the TLD in the Web application deployment descriptor (web.xml). Is web.xml the only…
kmansoor
  • 4,265
  • 9
  • 52
  • 95
0
votes
1 answer

When I add to web.xml, welcome files do not appear when I go to web page

I added a servlet to my web app and a servlet mapping but now nothing but a blank screen when I go to my web page, and no errors in the developer console. Can anyone help?
Tanvi
  • 1