Questions tagged [war]

Web Application Archive - Is a JAR file used to distribute JavaServer Pages, Java Servlets, Java classes, XML files, tag libraries and static Web pages (HTML and related files) that together constitute a Web application.

In software engineering, a WAR file (or Web application ARchive) is a JAR file used to distribute a collection of pages, Java , classes, files, tag libraries, static web pages ( and related files) and other resources that together constitute a web application.

A WAR file may be digitally signed in the same way as a file in order to allow others to determine what source the code came from.

There are special files and directories within a WAR file.

The /WEB-INF directory in the WAR file contains a file named web.xml - the Web Application Deployment Descriptor - which defines the structure of the web application. If the web application is only serving JSP files, the web.xml file is not strictly necessary.

If the web application uses servlets, then the servlet container uses web.xml to ascertain to which servlet a URL request will be routed to. web.xml is also used to define context variables which can then be referenced within the servlets.

Environmental dependencies which the deployer is expected to set up can also be defined in this file. An example of an environmental dependency is a dependency on a mail session used to send email. The servlet container is responsible for providing this service.

Useful links

3745 questions
39
votes
2 answers

Why spring boot generates jar or war file with .original extension?

Why after building spring boot app, it generates two jar or war files with .original extension? I use spring boot maven build plugin. For example: application.jar application.jar.original
Tohid Makari
  • 1,700
  • 3
  • 15
  • 29
37
votes
5 answers

How can I store Java EE configuration parameters outside of an EAR or WAR?

I want to store configuration for a web project outside of the web project (ear/war file). The application shouldn't know in which container it's running (WebSphere/JBoss etc.). What is the best way to handle this? Is JNDI a clean way? If JNDI can…
Martin K.
  • 4,669
  • 7
  • 35
  • 49
36
votes
3 answers

In maven - how to rename the output .war file based on the name of the profile in use

I have three profiles in my pom.xml for our application... dev (for use on a developer's) qa (for use on our internal qa server) prod (production). When we run our maven build all three profiles ouput a war file with the same name. I would like to…
benstpierre
  • 32,833
  • 51
  • 177
  • 288
33
votes
1 answer

What is .apt_generated folder in Web project?

What and why .apt_generated folder is created inside the Web Project within Eclipse or RAD workspace?
user1195192
  • 679
  • 3
  • 11
  • 19
33
votes
1 answer

spring-boot without parent pom.xml cannot generate war packaging

I used the example gs-convert-jar-to-war provided by spring-io. It describes how to generate war packaging within a spring boot project. The spring-boot documentation allows for using own parent poms, thus omitting the predefined parent pom for all…
Matthias Brenner
  • 372
  • 1
  • 3
  • 10
32
votes
4 answers

UnsupportedClassVersionError unsupported major.minor version 51.0 unable to load class

Possible Duplicate: Exception in thread “main” java.lang.UnsupportedClassVersionError: a (Unsupporte d major.minor version 51.0) i have developed an web application in java using jdk 1.7.0 ,Eclipse IDE (Indigo) and is running that application on…
Nishit Jain
  • 1,549
  • 8
  • 21
  • 33
32
votes
6 answers

Tomcat not autodeploying war file

I followed the following steps Shutdown Tomcat Deployed a war file with a timestamp of 1st December Start Tomcat - This created the exploded directory for the deployed war file. Stop Tomcat Updated the war file with a new one with a timestamp of…
ziggy
  • 15,677
  • 67
  • 194
  • 287
31
votes
3 answers

Jboss 7 war deployment failed

Jboss 7 war deployment failed and i got the below error message in the log. ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015052: Did not receive a response to the deployment operation within the allowed timeout…
Radan
  • 1,630
  • 5
  • 25
  • 38
30
votes
5 answers

spring boot war without tomcat embedded

I want to create a war file without embedded tomcat with maven. Here the relevant part of my pom ... org.springframework.boot spring-boot-starter-parent
niels
  • 7,321
  • 2
  • 38
  • 58
30
votes
3 answers

Deploy Spring Boot to Tomcat

So I am new to Spring - so I thought I would try Spring Boot I am using a Maven to build - I set up a view requests, when I run it as "App" looks like it starts tomcat up itself and i have a service at default 8080 port, so when I call…
philthomas26
  • 315
  • 1
  • 3
  • 8
29
votes
3 answers

How to setup angular 4 inside a maven based java war project

I'm becoming a bit crazy because I can't find a guide to setup an angular 4 app inside a java war project that will be built with maven. This is because I want to run it into a wildfly server. Any help? Thanks
Giamma
  • 808
  • 2
  • 10
  • 21
28
votes
7 answers

Separating war application name from war file name

Currently if i deploy a war file on tomcat named say myapp.war, I can access its url by http://localhost/myapp/MyServlet. However what I want is to deploy a war with a version number in the war file name and still have the same url. For eg, I want…
pdeva
  • 43,605
  • 46
  • 133
  • 171
27
votes
8 answers

"Module name is invalid" when exporting an existing eclipse project to a war file

I am trying to export an existing Eclipse project to a war file. But whatever I typed in the "WAR Export" dialog page, the system always returned "Module name is invalid". I do not know how to fix this issue. Thanks for the help.
bit-question
  • 3,733
  • 17
  • 50
  • 63
27
votes
4 answers

what is the right path to refer a jar file in jpa persistence.xml in a web app?

persistence.xml looks like this: org.hibernate.ejb.HibernatePersistence jdbc/test
Bobo
  • 8,777
  • 18
  • 66
  • 85
26
votes
4 answers

How to make maven place all jars common to wars inside the same EAR to EAR root?

We have a solution with numerous wars. Wars are similar in the sense they all use hibernate and spring. This means that we have a number of same jars inside each war. This is becoming a problem, because the size of the ear is starting to grow out of…
Dan
  • 11,077
  • 20
  • 84
  • 119