simonkaspers1
simonkaspers1

Reputation: 626

Paths in an Intellij Spring-project

So I am currently working on a Spring-project in Intellij. In my JSP-view I have both JQuery, Bootstrap and some local css/js-files.

When I work on the pure HTML in WEBSTORM the paths are easy to interpreter as they just are relative. As far as I understand the paths in Spring are defined in a XML-file and everything goes from there.

My mvc-dispatcher-servlet.xml has this:

 <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/pages/"/>
        <property name="suffix" value=".jsp"/>
    </bean>

And my files are organized like this:

How do i find the path? Have google like a hero and tried a lot but the files are not found Are there other files that rules over the path-hierarchy?:(:(

Example:

Upvotes: 0

Views: 1280

Answers (1)

Jaiwo99
Jaiwo99

Reputation: 10017

Assuming you are using maven:

  • src/main

  • java

  • resources

  • webapp

    • static
      • css
      • js
      • ...

Then the config..

<mvc:resources mapping="/static/**" location="/static/"/>

then you can use /css/main.css, something like this to access your resources in jsp

But there are different options out there, I will suggest you to read the document

Upvotes: 1

Related Questions