Where to put the files?

Asked

Viewed 320 times

0

When we use Spring and Maven, where should we put the files? in the webapp folder or in the Webcontent folder?

  • Never heard of WebContend, nor WebContent. Only java, resources and webapp

  • just fix, eh webcontent,

3 answers

1

Each IDE/Build Tool has its own way of structuring a Java project, some are more rigid, others more flexible. The folders you mentioned will not be present in the same project, since they are part of the structure of different Ides/Build Tools.

The briefcase WebContent exists in type Eclipse projects Dynamic Web Project.

The briefcase webapp is part of the Standard Directory Layout of a Maven Web Project (As Maven became popular, some other tools adopted a similar structure, such as Gradle).

How your project is one Maven Web Project, you must use the folder webapp which, according to the Maven documentation, is where files like your JSP pages should go, web.xml, etc..

  • Your answer made me understand the question

0

Good afternoon, my friend, Here where I work, we put all code related to Frontend (Javascript, Html, Css, Jquery..) within Webcontent (responsive), where there are organization subfolders (View, Model, Collection and template)... I hope I’ve helped.

0

It depends a lot on which files. A clear example is that properties files for example is in the Resource folder. On the other hand, the java files are placed in their package structure, and from there it is possible to define which packages store models, Repository and even view.

If you use Thymeleaf for example, there is specific configuration to do in the xml file configuration of the same where you can define in which place and which structure of the file. In the documentation it is possible to find the form. Look for the spring version, I believe there will be a clear definition.

Could give an example but there are several versions. Put a version of spring and mavem and I can even post a basic example(skeleton).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.