skip to Main Content

In the official doc by Apache Struts, they mentioned this:

“In your Java IDE create a Java web application with a project name of
basic_struts that follows the standard Maven project folder structure”

What does that mean?

  1. Does it mean, create a Maven project? (but that doesn’t seemlike a web project)
  2. Create a Dynamic Web Project? (But how do I use Maven? I’ll be using a pom.xml file as mentioned in the guide)

How to create Struts 2 application using Maven?

2

Answers


  1. Create a dynamic web project and then convert it to maven project in eclipse IDE.

    [[1]: https://i.stack.imgur.com/R4jSA.png%5D%5B1%5D

    Login or Signup to reply.
  2. You can create struts2 project by choosing this archetype

    org.apache.struts:struts2-archetype-starter
    

    You can get more information about Maven archetypes on the struts site.

    The Starter Archetype (struts2-archetype-starter)
    The Starter archetype creates a more featured application using several common technologies used in production applications.

    Features

    Sitemesh integration

    Action example (instantiated both through Spring and Struts)

    Spring integration

    Validation example (action and action-alias level)

    Conversion example (global and action level)

    Resource bundle (both global, action and package level)

    mvn archetype:generate -B -DgroupId=com.mycompany.mysystem
    -DartifactId=myWebApp
    -DarchetypeGroupId=org.apache.struts
    -DarchetypeArtifactId=struts2-archetype-starter

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search