war

Maven String Replace of Text Web Resources

吃可爱长大的小学妹 提交于 2019-12-03 15:43:48
问题 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

Is it possible to observe a CDI Event inside a WAR when packaged as EAR

╄→尐↘猪︶ㄣ 提交于 2019-12-03 14:54:51
I have an Enterprise Application Archive ( EAR ) containing multiple backend modules ( EJB ) as well as some web modules ( WAR ). The Event gets fired inside one of the backend modules: @Inject private Event<MyEvent> myEvent; ... public void fireEvent() { myEvent.fire(new MyEvent()); } ... It can be observed in any of the other backend modules with code like this: public void listener(@Observes MyEvent myEvent) { .. } But I can't retrieve the event inside the WARs. Is this because of classloader visibility (classes from WAR are not visible to EJBs) or should CDI handle this? If CDI can't be

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

你离开我真会死。 提交于 2019-12-03 13:18:49
问题 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

maven WAR plugin skips resources?

空扰寡人 提交于 2019-12-03 12:51:00
Now this is downright bizarre: I have a number of folders/files I want copied into my WAR, here's the relevant part of the POM: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <configuration> <webResources> <resource><directory>../common-web-content/src/main/resources</directory></resource> <resource><directory>../pqm-web-content/src/main/resources</directory><filtering>true</filtering></resource> <resource><directory>../common-presentation/src/main/webapp</directory></resource> <resource> <directory>${project.basedir}/src/main/webapp/WEB-INF<

Handling of configuration files in Spring web applications

早过忘川 提交于 2019-12-03 12:21:40
问题 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

Differences between jar and war in Spring Boot?

时光毁灭记忆、已成空白 提交于 2019-12-03 12:05:04
问题 I'm about to build my first website in Java with Spring Framework using Spring Boot and it's much easier to build it in jar , but I have a few questions about it. What are the differences in general? In jar files the views are under /resources/templates , but in war file it's under /webapp/WEB-INF/ . What are the differences? Can I deploy a jar on an online host? 回答1: Spring Boot can be told to produce a 'fat JAR' which includes all of your module/service's dependencies and can be run with

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

天大地大妈咪最大 提交于 2019-12-03 10:58:22
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. Aneurysmo I had the same issue, and I fixed it. Please follow the steps below, and you can create your war file. Right-click on folder project. Click on properties. Go to project facets. Activate, if necessary. Scroll down to Configuration and mark Dynamic Web Module. This works for me. you must be sure your project is a Web Project, if it's not a Web Project check

When is it appropriate to use an EAR and when should your apps be in WARs?

前提是你 提交于 2019-12-03 10:18:01
We have many Spring web applications to make on a WebLogic server and are curious about when WARs should go in an EAR and when they should just exist as WARs. Occassionally, the WARs will need to access common logic JARs, but I don't see why these would need to go into an EAR when they could just be packaged into the WARs. From what I understand, if several WARs are in an EAR and you need to modify one of those WARs, you need to redeploy the entire EAR to update the server. This will cause all of the WARs to bounce. If they weren't in an EAR, however, I could just update the one WAR and it

Why use an ear instead of a war?

大城市里の小女人 提交于 2019-12-03 08:53:59
问题 I read this and this which are somewhat related to my question. But I came across this article that says that EJBs can be packaged in a war file. If this is the case, why is there a need for an ear? An explanation with an example will be highly appriciated. 回答1: Using EAR or WAR depends on the server you want to deploy it, your application, and on your personal preferences. From Java EE6 you can package your EJBs together with other servlets, jsps etc into WAR file (you end up with web

Show jsp page inside jar file using Spring MVC

只谈情不闲聊 提交于 2019-12-03 08:51:34
问题 I'm developing a web application in java using Spring MVC 3.2.2. I'm having problems loading jsp page from within the jar file. The Sring MVC web application that the following structure: |-META-INF |-WEB-INF |-spring | |- app-config.xml |-classes |-lib | |-external.jar | |-WEB-INF | | |-views | | |-external.jsp | |-classes | |-controller-for-external.class |-views |-... jsp Config in app-config.xml <context:annotation-config /> <context:component-scan base-package="com" /> <bean id=