war

Deploy WAR or “fat” JAR?

百般思念 提交于 2019-12-03 07:53:05
问题 I'm noticing a lot of projects (DropWizard, Grails, etc.) starting to embrace the notion of a "fat" JAR (using an embedded web server like Jetty or Tomcat) vs. the traditional WAR deploy. Both methods involve a single JVM process (i.e. no matter how many WARs are deployed to Tomcat, it's all the same JVM process). Under what circumstances is either deployment method preferable over the other? 回答1: Here are some reasons: In favor of JAR: Simple to build and deploy. Embedded servers like Jetty

Displaying version and date of build in the xhtml page

这一生的挚爱 提交于 2019-12-03 07:50:24
I want to display the build version and build date on the footer of a JSF application. The pages are XHTML. I'm looking for ways to get the information from pom.xml or other artifacts. I found the following that uses maven-replace plugin. http://www.vineetmanohar.com/2010/09/how-to-display-maven-project-version-in-your-webapp/ Are there any other techniques you use? I'm looking for something like this with JSF - Displaying the build date One approach that will work: use Maven filtering to put a file in your WAR or JAR containing the required information. Then in your Java webapp, load that

How are Java applications deployed in the “real world”?

谁说我不能喝 提交于 2019-12-03 06:53:13
问题 As a novice to the world of Java programming, this question has always boggled my mind. I first believed that all Java files were compacted into applets and then ran, but I soon realized that this isn't always the case. Could someone explain to me how we actually interweave our Java applications into a real product of everyday life? TL;DR: How do we implement our code for practical usage? 回答1: It depends on the application. There are many options depending on how you want your users to use

Deploying a WAR in Tomcat / Eclipse

大憨熊 提交于 2019-12-03 06:27:28
I use Tomcat 6.0 and Eclipse 3.0 under Linux and I try to deploy a WAR in Tomcat. The problem is that the server is managed by Eclipse and I have some Eclipse project deployed. I tried to modify the server.xml file then launch Tomcat via Eclipse but it doesn't work: Could not load the Tomcat server configuration at /Servers/Tomcat v6.0 Server at localhost-config. The configuration may be corrupt or incomplete. I tried to extract the war in the webapps directory but the webapp is still inaccessible. What is the best practice to deploy a War ? Yes, in a way, you can deploy a war in the dev mode.

Best location to put your CSS and JS files in a Mavenized Java Web app?

帅比萌擦擦* 提交于 2019-12-03 06:09:48
I have a Web application in maven that follows this structure: src `-- main |-- java |-- resources `-- webapp Is is better to put it in the main folder and then the maven plug in will try to move it or I should put it inside the webapp folder and why? If you don't need to filter CSS and JS files, I would simply put them in src/main/webapp (if you put them in src/main/resources , they will end up in target/classes and in WEB-INF/classes in the WAR which is very unlikely what you want). If you need to filter them, additional resources can be included in the WAR using the webResources parameter.

Maven String Replace of Text Web Resources

别等时光非礼了梦想. 提交于 2019-12-03 05:14:42
I have a Maven web application with text files in src/main/webapp/textfilesdir As I understand it, during the package phase this textfilesdir directory will be copied into the target/project-1.0-SNAPSHOT directory, which is then zipped up into a target/project-1.0-SNAPSHOT.war Problem Now, I need to do a string replacement on the contents of the text files in target/project-1.0-SNAPSHOT/textfilesdir. This must then be done after the textfilesdir is copied into target/project-1.0-SNAPSHOT, but prior to the target/project-1.0-SNAPSHOT.war file being created. I believe this is all done during the

Some necessary libraries are missing in WAR-File after export from Eclipse - why?

时光毁灭记忆、已成空白 提交于 2019-12-03 05:04:17
问题 I took over a project of a college which contains some web services and by exporting the project as WAR-file some libraries are contained in the file (e.g. Axis2) and some aren’t (hibernate, JDBC driver). Also a jar which is added to the class path has not been exported. All libraries are located in folders on the hard drive which means that they are not in located somewhere in the eclipse folder. If I open the WAR-file after export with WinRAR and add the libraries manually to the file the

How to add TLD and Tag Lib files into a Maven's jar project

笑着哭i 提交于 2019-12-03 03:31:19
I have a Maven project that is packaged as jar . And I also have a Maven project that is packaged as war . This war project has a tld file and some xhtml files (the tag libs). The structure of the war project is (basically): pom.xml src main java ... webapp WEB-INF my-facelets.taglib.xml facelets aTag.xhtml anotherTag.xhtml META-INF my-facelets.taglib.tld And then appeared a requirement to remove those xml, xhtml and tld files from the war project and package them into the jar project. So my first try was add in the jar project's POM: <resources> <resource> <directory>src/main/tld</directory>

Intellij multi-module maven project, update in one of the submodules is not propagated to war

心不动则不痛 提交于 2019-12-03 03:23:57
I'm using Intellij Idea 12 and have a multi module maven project. To make it simple let's assume that I have: Module A - compiled to JAR Module B - depending on module A and also compiled to JAR Module C - depending on module B, but compiled to WAR I know Intellij has it's own build mechanism for maven projects so when I build a WAR for the first time and deploy it to Tomcat generally all works as it should. The problem start when you need to make changes in one of the sub modules, for example Module A and rebuild the War (rebuild Module C) Intellij as it seems uses the old Module A jar that

Handling of configuration files in Spring web applications

大兔子大兔子 提交于 2019-12-03 02:52:11
I have several times ran into the same problem, and I would like to have some input on what other people think about the issue: Suppose we have Spring application packaged as a .war file and we want to run it on several environments . (development/test/preprod/prod/etc) For accessing the infrastructure needed by the application, (databases/webservices etc) we store the access info in configuration files, also some business configuration is in those files. Let's say we use .properties files for this purpose (because we have a spring application inside the war and we like having the properties