Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSP with IntelliJ

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?

like image 213
Martijn Jansen Avatar asked Dec 06 '25 19:12

Martijn Jansen


2 Answers

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...

  1. created spring web application using spring initializr (provided inside intellij IDEA)
  2. created webapp folder under src/main
  3. opened project structure window (ctrl-shift-alt), selected modules under project settings
  4. in the middle window pane, selected Web
  5. added newly created folder (src/main/webapp) under "web resources directory"
  6. 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...

like image 170
AlYosha Avatar answered Dec 08 '25 10:12

AlYosha


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

like image 39
Kasun Dinesh Madusanke Avatar answered Dec 08 '25 11:12

Kasun Dinesh Madusanke



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!