How to create jar file for web application using Netbeans IDE 8.0

I have made a web application using NetBeans IDE 8.0 on JAVA platform. The project consists of JSP, Servlets and regular .java files. I would like to deploy the project as a simple jar file for the client so that it can execute the jar file and use the application. I am trying to create a jar file using NetBeans with given resources, but there were no suitable resources for that. When I tried one of the sources, a war file is generated, not a jar file.

So, help me convert my web app to jar file. Also please let me know why the war file is created for my application and not the jar file. Also let me know how to execute the war file.

0


source to share


1 answer


Java applications use jar files and java web applications use military files. JAR (Java ARchive) is a package file format commonly used to aggregate many Java class files and their associated metadata and resources (text, images, etc.) into a single file for distributing application software or libraries on the Java platform ... A WAR file (ARchive web application) is a JAR file used to distribute a collection of JavaServer Pages, Java Servlets, Java classes, XML files, tag libraries, static web pages (HTML and related files), and other resources that together make up the web -application, Since the structure of a web application is very different from a typical standalone Java application, you need to deploy it to a war file.To run WAR file you need a java EE based server like apache tomcat, jboss, glassfish, etc. Steps required to run the war file (one possible solution, although there are many others that boris points out): -

1. Start the web server;

2. Deploy the war file to a web server;



3.Enter JSP pages or servlets in the browser by typing their links to their path.

see this link for more details on deploying war: - deploy war file on tomcat server

+1


source







All Articles