JSP with IntelliJ - spring

Since a while I started to use IntelliJ instead of Eclipse. I created my project from Eclipse (where it was working) in IntelliJ and I can start the Spring Boot Application. As a Front-end I use JSP files, but when I open the project in my browser it shows only the HTML code, not the actual website. Can anyone help me with this problem?

I am aware that this thread is 3 years old, but since I'm currently working on something similar (spring boot + web application + jsp + intellij ultimate as IDE), wanted to share my experience...
created spring web application using spring initializr (provided
inside intellij IDEA)
created webapp folder under src/main
opened project structure window (ctrl-shift-alt), selected modules under project settings
in the middle window pane, selected Web
added newly created folder (src/main/webapp) under "web resources
directory"
applied changes
After that, in my "left click - new" drop down menu, jsp files were also provided...
My current Intellij IDEA Ultimate version is 2020.1
Hope this helps...

I also faced similar kind of issue earlier. I have solved it by adding the following dependency.
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>
I have created a project sometime ago to cover this issue. The link to the project is mentioned below. Please refer it. I wish it will help you.
Spring Boot Maven Webapp

Related

Spring boot application not detected by Intellij

Intellij is not detecting spring boot application created in a different IDE.
The application in discussion is the one starting with the letter "e"
How can i fix this ? I am using intellij community edition.
As mentioned in the comment, there is no standard spring boot application in IntelliJ.
In the screenshot provided in the question, there is no pom.xml file. If you have that in the project then right-click on it -> Maven -> Add as a maven project.
If this doesn't work, read this https://intellij-support.jetbrains.com/hc/en-us/community/posts/360000023059-IntelliJ-does-not-recognize-workspace-maven-modules for more analysis ways.

Spring Boot application is not running in STS with profiles due to Run Configuration is not showing Project names in Drop Down to be selected

Need some help in running Spring Boot Application, I have cloned a Microservice and Imported into Eclipse. Now I want to run this as spring boot application in my STS(4.10.0 version). While running I need to supply profile. For this I am setting up configuration (Run Configuration).
Steps :
Right click on Project
Select Run As > Run Configurations
Select "Spring Boot App" -> Click to Add new Configurations
Here I am unable to select Project, it is not displayed in drop down. Below is screenshot
Note : I tried Importing Project as "Maven Project", "Existing project Into Workspace" and Git project into workspace. All these 3 ways are not working for me
Need help
This looks like your project is not recognized as a Spring Boot application. Without looking at your project it is hard to say why the IDE doesn't identify your project as a Spring Boot project. Does that work when you create a new Spring Boot project using the Spring wizards? Also feel free to share a link to your project, we would be happy to take a deeper look.
As a workaround, you can always start your Spring Boot application as a regular Java Application using the "Run as Java Application" in the IDE. That way you would have to set the active profiles via a system property in your launch config.
Oddly, I had this issue for a spring boot maven project and it was pom.xml being malformed even with no warning or error. Took me days, I had imported/re-imported/messed with the java build path/compiler and installed jres. I was unable to download maven dependencies. I took a look in the dependencies section of the pom.xml and noticed lifecycle-mappings issue. Once I took out the 3 lines of incorrect xml syntax in the pom.xml I was able to download the maven dependencies and then the project appeared as a spring boot project in run configs.

How to create a Java EE 7 Maven IntelliJ Project

I am new to Stack Overflow because of my frustration to build a working Java EE 7 Project with Maven and IntelliJ ultimate.
I learned a lot about JPA and JSF in the last weeks and am thrilled to put my knowledge to use but unfortunately I am not able to create a working project structure as I get all sorts of errors along the way. I haven't found a single up to date tutorial which is working on the entire Internet.
My greatest achievement is creating a Maven project, and run the index page on a Jboss Wildfly (11) server.
I know Maven (3) requires a certain structure to work, I read that it is the one in picture 1.
Picture 1
Furthermore I know that I can add framework support by right clicking the project name and that I can add facets or modules by selecting files and project structure.
I would be very thankful if someone could explain the right creation of such a project. I already wasted double digit hours and lost a lot of fun.
I had to create a Maven Project with IntelliJ. After that I added JavaEE Application under Framework Support and checked the boxes for JSF and Web Application under Java EE aswell.
Now this doesn't work alone, I had to put this in the right structure Maven requires. I moved the META-INF Folder to main/src/resources. After renaming the web Folder to webapp, I moved it to src/main.
To check, go to Project Structure/ Facets and check if the paths are set correctly.
After adding a local Wildfly 11 Server Artifact (war), IntelliJ starts the default browser and I get to the index page.
The Project Structure
I recommend you take a look at JetBrains page, they have a lot of tutorials on how to use their products. Here how to create new Maven project:
https://www.jetbrains.com/help/idea/maven.html#maven_create_project
Also, here you have information how an example pom.xml file looks like and how to build it:
https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
When you develop your project you can add dependencies to the pom.xml file

question marks in project explorer and version errors in pom.xml using Spring STS for Jhpister generated application

I have generated spring-boot and angularjs based application using jhipster and imported as existing Maven Project in Spring STS.
The application is running fine but I did not understand what are those question marks (?) in the project explorer are? and also red marks in pom.xml for versions indicate?.
But still the application is running fine. I am not sure whether these issues cause problems in future and how can I get rid of them?
The question marks are coming from the version control integration and indicate that those files are not yet committed to version control.
The squiggle lines in the pom should reveal more information if you hover over them.

NetBeans 7.3 maven project "No web folder found"

I am running the latest version of NetBeans (7.3) with GlassFish and I have created a maven web project that adds the necessary JSF 2.1 dependency. I am able to deploy the project and access the home page. The problem is that when I try to use the "JSF pages from Entities" wizard, I get the following error "No web folder found". If I try to add the JSF 2.1 framework support thru "Project/Properties/Framework" I get the same error.
I assume that NetBeans does not know that a "web folder" already exists but at a different location "project/src/main/webapp" (maven) instead of "project/web" as it normally expects if the project is a non-maven project. Does anybody know if there is a setting I can change, to let NetBeans know that the web folder is located under "project/src/main/webapp" instead of "project/web"?
I tried to get support thru the NetBeans forum/mailing-list but nobody responded.
I had the same problem when I tried to import an eclipse project.
After editing the "nbproject/project.properties" manually, changing the build.web.dir property to the right directory (WebContent instead of web) it seemed to work.

Resources