• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

WebApp archetype not generating proper directory structure

 
Ranch Hand
Posts: 66
MyEclipse IDE Firefox Browser Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay I am using Maven within Eclipse a project which uses Hibernate. I am using the maven-archetype-webapp(version 1.0) for the project. I am getting the following directory structure for my src folder-:

src
|---main
|----resources
|----webapp
|----WEB-INF
| |---web.xml
|----index.jsp

Where is the src/main/java folder ? As given here (https://maven.apache.org/plugins-archives/maven-archetype-plugin-1.0-alpha-7/examples/webapp.html)

Where are the tests folder ?

Also there is only one archetype relating to webapp present. That too in the Internal catalog.

How do I get the correct structure ? What am I doing wrong ?
 
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Generally, the convention is that the webapp project should have UI only. All the java code logic goes into a separate module that packages a Jar file. The webapp project should contain only the web.xml and the JSF/JSP files. This is reccomended because if you want to use your business logic in a differrent web app, or if you want to build command line utilities that use the business logic, you create seperate projects that use the business logic module. That's why you don't have test and java folder. If you follow convention, you shouldn't need it

Also, archetypes do the most basic setup. If you do want java code in the WAR, you can always create the java folder.

 
Sreyan Chakravarty
Ranch Hand
Posts: 66
MyEclipse IDE Firefox Browser Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jayesh A Lalwani wrote:Generally, the convention is that the webapp project should have UI only. All the java code logic goes into a separate module that packages a Jar file. The webapp project should contain only the web.xml and the JSF/JSP files. This is reccomended because if you want to use your business logic in a differrent web app, or if you want to build command line utilities that use the business logic, you create seperate projects that use the business logic module. That's why you don't have test and java folder. If you follow convention, you shouldn't need it

Also, archetypes do the most basic setup. If you do want java code in the WAR, you can always create the java folder.



Hmm thanks for that answer. Can you point me to a sample project where business logic is kept seperate ie. developed as a new project all together and the JSP and JSF is kept separate ?

Also what maven archetype would you use when creating a project for the business logic ?
reply
    Bookmark Topic Watch Topic
  • New Topic