Struts1 with IntelliJ IDE - spring

I have developed struts1 application with Eclipse. I had to change my IDE into IntelliJ. I need to develop a new application integrating struts1 and Spring. I found some interesting tutorials from,
struts-spring-integration-example
and spring-and-struts-integration/
Since above examples were developed using Eclipse IDE, I might wonder is there is any better (easy) way of doing it using Intellij .
Please mentioned any tutorials or better way to doing this.

What did you try? I got Spring working in IntelliJ using Maven and copying other working projects. I hope that also can work for you. Configure Maven for IntelliJ, if you can get spring working with IntelliJ try make it work from the command prompt with maven + your app server (I can recommend jetty) and then you can open the Spring/Maven project in IntelliJ and it will work.

Related

Intellij complaining about JDK location

First Image
Second Image
As I attached 2 images, I am having trouble running my spring boot gradle project written in groovy.
As soon as I open the project, intellij tries to build the project and it fails saying Gradle Sync failed.
Since it is complaining about java home in the jdk setting, I was trying to change the path as my intellij expects. but as soon as I change it, it tells me that it cannot find android sdk location. and I have no idea why it cares about android sdk. This project is about spring batch job using gradle and groovy.
I have been searching why it happens for days now and online is talking about ardroid studio solution. and those solution do not apply to my problem.
Can someone help me with this issue please?
Thank you in advance.
It looks like you are running Android Studio instead of IntelliJ IDEA.
The former doesn't support projects other than targeted for Android, so your project will not work there.
Make sure you run IntelliJ IDEA. You can get it at https://www.jetbrains.com/idea/download/index.html.

IntelliJ SpringBoot dependency problems

I'm trying to follow several tutorials on how to use Spring Boot, however I keep running into issues where none of my dependencies are working properly. Below is an image displaying my problem.
I've tried making sure that I installed Maven correctly, however I imagine there is something that I'm doing wrong. I think that I have Maven in the proper Paths but, but I can't tell why it would still be providing the errors that it does. I've followed what it stated to do for Windows users, and have as follows.
Whenever I run mvn -version I am getting the following.
Can anyone help guide me in order to properly have Maven working on IntelliJ?
If you are using IntelliJ IDEA then I suggest using Spring Initializr which would create sample application with correctly configured maven setup is you choose Maven Project for Type:
http://blog.jetbrains.com/idea/2015/03/develop-spring-boot-applications-more-productively-with-intellij-idea-14-1/
Are you using Gradle or Maven to import required dependencies? If not, follow the guides here:
http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/
If you have them setup, try to click one of the error and then click the red light bulb icon, see what it suggests you to do.

How do I implement dynamic reloading in Spring (Netbeans)?

I'm used to writing Grails applications where my view or controller changes are automatically redeployed on save. I'm now stringing together a Spring Web-
MVC application and I'd like the same feature.
I'm using Netbeans as an IDE, Gradle as a build tool and the spring-boot plugin at the moment. I remember some talk of people using Jetty as it's so quick to restart that dynamic class reloading / deployment is no longer necessary. I've heard others mention JRebel which I used to use a few years back. I'm sure there is a more modern, spring-supported / spring-standard way of doing it.
I'd also like to know if you recommend deploying as a WAR or as a standalone executable JAR with a lightweight built-in web server.
Recommendations appreciated.
A yet unsolved challenge
It turns out that the Netbeans Gradle plugin does not support "compile on save" out-of-the box - and this means that a Java Agent won't be able to pick up the changes. The author kelemen suggested one or two approaches around this. It's a non-negotiable for me, so I decided to switch IDE's to Eclipse (terrible Gradle support), then IntelliJ Idea - which is looking very promising.
Netbeans Gradle Author Comment: https://github.com/kelemen/netbeans-gradle-project/issues/183
Alternatively, there is Jrebel, which is claimed to be able to support this Netbeans / Gradle combination. I wasn't able to get it working easily using a trial of JRebel. The JRebel support guys are there to help, so if you're willing to pay the price, it's likely that their support team will solve your problems.
JRebel: http://zeroturnaround.com/software/jrebel/
If anything changes, please comment below...
Spring class reloading is supported by HotswapAgent as well. It is free alternative to JRebel.
Spring has their own agent as well: https://github.com/spring-projects/spring-loaded. While developing why not just use embedded Tomcat/Jetty provided by Spring Boot.

How to use Maven, Spring, Hibernate (JPA) on Netbeans or Eclipse

Being extremely very new to Java EE, I am trying to build a rest api with a database layer.
I am using Netbeans 7.2 and Glassfish because they were easy to install on my Mac OSX Lion. From netbeans I open a project with Maven, choosing archetype weby. What I am going for is Maven, Spring, and Hibernate with JPA. Also I am using restlet for my Rest API layer. Anyway, the tutorials I find online, along with the book Spring persistence with Hibernate [electronic resource] / Paul Tepper Fisher and Brian D. Murphy keep refering to /src/main/resources/META-INF/spring/spring-master.xml. But the project has no such folder. Instead the project has the /main/resources/hibernate.cfg.xml and a folder about jdbc connection.
Basically I am stuck. Some questions:
Am I using the correct Maven Archetype? Is there another way to get what I am looking for (using Netbeans or Eclipse on my Mac)?
I don't want to spin around too much, which is why I have not manually added the /src/main/resources/META-INF/spring/spring-master.xml, especially since I am not sure what to put in it.
Others opinions is greatly appreciated.

Adding existing source packages to a Maven Web Application in Netbeans

I have a normal Netbeans project, and I would like to add the source packages of this project to a project that is a Maven Web Application, also within Netbeans.
I tried copy-pasting the packages into the /src project directory of the Maven application, but this doesn't seem to work.
Could someone please tell me how I could do this ?
If this is not possible, could someone tell me if I can convert the entire normal project into a Maven Web Application ? Thank you :)
It sounds like you need to add the dependency to your web-application instead of the source code, cause maven is intended to handle exactly such situations.

Resources