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

I created a CRUD application that uses a @WebServlet("/") annotation, it works fine until I try add another table

The CRUD application works for one table perfectly but when I copy in the code for the second table, it doesn't allow me to use the same WebServlet annotation, I have tried declaring the servlet in the brackets but no luck. WebServlet("/") public…
0
votes
0 answers

How to inject dependency into Servlet?

I've created a Servlet and added configuration in web.xml: MyServlet com.foo.web.MyServlet MyServlet
wdc
  • 2,623
  • 1
  • 28
  • 41
0
votes
1 answer

how to bootstrap spring application with @Configuration within web.xml?

how to bootstrap spring application with @Configuration within old web.xml ? Say I am building a spring project with @Configuration @ComponentScan annotation style, then how do i get it working with web.xml ? where to start the config class? I did…
feiyuerenhai
  • 308
  • 1
  • 3
  • 11
0
votes
0 answers

RestEasy Scanners breaking Tomcat Application

here the RestEasy filter which is being extended by RestListener is nreaking up the application after upgrading the version of log4j from 1.x version to 2.x verison, Kindly help stuck on this issue for last 2 weeks, …
0
votes
1 answer

JBOSS Configuring Context Param from System Properties

Im using jboss server and primefaces also. I want to use google captcha for my login page. At First it's ok and the captcha showed up, but I want capctha public key and private key stored in properties file. I was made a configuration like this…
muhkanda
  • 319
  • 1
  • 9
0
votes
0 answers

Log4j2, IBM WAS spring project. Not able to see the logs on the console

While migrating from log 1.x to log2.17.1. I am facing issue in printing of the logs over the console. I changed my web app version from 2.4 to 3.0 and remove all the other config for log4j 1.x. I kept only the new config:-
yadav_1992
  • 43
  • 2
  • 11
0
votes
1 answer

Form based login on HTTPS fails with browser error that it couldn't connect the server

I'm trying to implement a simple form-based login for my web application deployed with Tomcat. loginPage.html has j_username and j_password as fields, and the form method is j_security_check, as specified. /Actions is a directory containing all of…
joseph
  • 767
  • 3
  • 8
  • 16
0
votes
0 answers

HTTP status 500 : Error instantiating servlet class [com.test.Login]

I was following a tutorial, while tring to run this little code I got this error : HTTP status 500 : Error instantiating servlet class [com.test.Login] Would you like please to help me to figure a solution The Servlet : package com.test; import…
Jasmine
  • 72
  • 1
  • 14
0
votes
1 answer

Java filter class java.lang.ClassNotFoundException

I have a Java web project which can't find the filter classes, I get this error: java.lang.ClassNotFoundException: AuthFilter at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at…
user5507535
  • 1,580
  • 1
  • 18
  • 39
0
votes
1 answer

Running methods depending JSP link using switch statements on Servlets

Hi there I am fairly new to building web pages using JSP and servlets and I'm trying to use switch statements to run functions depending on the link/button the user clicks but every code I've tried fails to run the function or redirect to new page,…
0
votes
0 answers

How to properly serve static files in jsp redirecting from jax rs service on a Websphere without using Node.js when using @ApplicationPath

I am doing openID SSO authentication for my web tool and I am trying to retrieve user email adress for further use. I am trying to use jax-rs service for that. The way I would like it to work is to redirect from jax-rs service to loading.jsp file …
Vlad67
  • 38
  • 7
0
votes
1 answer

Correct path to static resources in order to omit them from authorization-constraint

I have a java ee-struts application using websphere and everything is restricted if the user is not logged in. Even the static resources like css and images.I would like to unrestrict access for 2 things, the style.css and blue_logo.gif files so…
Andrew
  • 3
  • 1
0
votes
2 answers

Websphere Application Server: web.xml location for servlet deployment descriptor and log file location where a filter servlet will log

I have deployed a filter in Tomcat which logs the URLs and a request parameter for all servlets. Now I want to deploy the same in Websphere Application server. 1. Where to copy my Filter Class file? 2. Location of web.xml in which I have to enter…
Rana Asghar
  • 1
  • 1
  • 1
0
votes
1 answer

How can I put UTF8 value to web.xml?

I'm thinking to put some UTF-8 words into web.xml as env-entry-value, but somehow that will cause my war become not deployable to my server. A case of my setting that causes deployment failure look like below. Msg…
Kaninchen
  • 455
  • 2
  • 7
  • 19
0
votes
1 answer

Java EE, JSF programmaticaly login with form-based does not redirect to user's home page on production

I'm developping a project with several different user profiles / roles. Security is realm-based and a form authentications is used. When a user logs in successfuly it must be redirected to his/her home page according tho the user's role. All those…