0

I have happily used Java Spark Framework (& j2html) as part of a standard Java application to provide a browser based UI, this has worked very well.

I would now like to build my website using the same technology instead of using Servlet/Jsps as I am currently. But the difference is that the website runs on AWS within a Tomcat container and Im not sure if Java Spark can be used to create a web archive (.war) file so I can continue to deploy it in the same way.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Paul Taylor
  • 13,411
  • 42
  • 184
  • 351

1 Answers1

1

It is not difficult.

From their documentation:

  1. You need to change your main class and implement spark.servlet.SparkApplication
  2. Add the specified filter to your web.xml changing <param-value>com.company.YourApplication</param-value> with the name of your class.
  3. Move your routes to the init method of your main class.

Hope this helps.

Xavier Ñauñay
  • 309
  • 2
  • 5
  • 15