Announcement Announcement Module
No announcement yet.
Embedded Jetty example with Spring MVC Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Embedded Jetty example with Spring MVC

    Is there an example of spring MVC with an embedded jetty instance?

    I would really appreciate if someone has a working example of how to create a main class with an embedded jetty instance using Maven.

  • #2
    I created a template project that uses embedded jetty with SpringMVC.. This is one I came up with after trial and error embedding Jetty in a few different ways. I've always run into problems with JSP/JSTL. Anyways, this template started with the SpringMVC template project created by STS. It has a few additions that I always do, like logback instead of log4j, but that should matter much..

    In its current form its basically a wrapper around a classic style web application. My main use for SpringMVC is bolting on a web interface to an existing application, so it will migrate that way in the next little while. Should still be useful.

    If all you really want to do is make an executable jar out of an existing war you might want to checkout the tomcat7 plugin:


    This will basically embed your war into jar that contains tomcat..

    Hope that helps.


    • #3
      I make a example to redirect any request to port 8080 and redirect to a new location.
      First "mvn package" and goto target folder to run "java -jar redirector.jar".