I installed Intellij yesterday to see how it compared to Eclipse.
I've created a Maven project, imported the dependencies for Spring and setup everything I think I need to test the application runs.
The issue I have is that in the web.xml file it's marking one of the servlet configuration files as not found, when it does exist. I'm guessing this has something to do with the mapping of the web-inf folder, but I can't figure it out in Intellij
Here's the content of the web.xml file
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/dispatcher-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
I'm including a screenshot of my folder structure too.
The path was mapping fine, but then I change the artifact to be a war instead of exploded, and it seems to have broken something.
The error message on application run is;
IOException parsing XML document from ServletContext resource [/WEB-INF/spring/dispatcher-servlet.xml]; nested exception is java.io.FileNotFoundException:
Any assistance would be appreciated.
Probably this one will make it clearer:
project structure:
set webapp folder as resources:
I managed to fix this.
The web-inf folder was set as / in the paths section.
File > Project Structure Choose Modules Select Web Under Web Resources Directories, map the 'web' folder to '/'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With