8000 GitHub - tayloryork/livereload-servlet: A java servlet compatible with LiveReload 2 (protocol). Can be used for development or deployed app.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

tayloryork/livereload-servlet

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

A java servlet usefull for dev ONLY :

  • serve static file
  • notify change to client via LiveReload protocol (over socket)

Usages

The default port is not 35729 (like define in the LiveReload protocol). Instead, it uses whatever port your personal webapp uses. If you change the port then you could not use the Browsers Extension for LiveReload, but it should works if you insert a JavaScript snippet in your pages.

Java Webapp Integration

This is an example WebApp web.xml that configures LiveReload to watch /src/main/webapp for changes.

    <display-name>Your Web Application</display-name>
    <description>Your Apps description</description>

    <servlet>
        <servlet-name>LiveReloadJSServlet</servlet-name>
        <servlet-class>co.tyec.livereloadservlet.LiveReloadJSServlet</servlet-class>
    </servlet>
    <servlet>
        <servlet-name>LiveReloadWebSocketServlet</servlet-name>
        <servlet-class>co.tyec.livereloadservlet.LiveReloadWebSocketServlet</servlet-class>
        <init-param>
            <param-name>watchDir</param-name>
            <param-value>src/main/webapp/</param-value>
        </init-param>
    </servlet>

    <servlet-mapping>
        <servlet-name>LiveReloadJSServlet</servlet-name>
        <url-pattern>/livereload.js</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>LiveReloadWebSocketServlet</servlet-name>
        <url-pattern>/livereload</url-pattern>
    </servlet-mapping>
</web-app>

Links

Alternatives

  • LiveReload-JVM This project was start with the LiveReload-JVM as the base. It used an embedded standalone jetty webserver instead of integrating with your own webserver.
  • LiveReload 2/3 the main tool (Mac & Windows only) include GUI
  • guard-livereload a LiveReload server-side for Guard (Ruby)
  • grunt-reload a LiveReload server-side for Grunt (javascript/nodejs)
  • LivePage an other way to "auto-reload"
  • without LiveReload : cd web/root/path && python -m http.server 8000 (python)

License

  • the project is under unlicense
  • the project (source and binaries) include [livereload.js], livereload.js is under MIT. livereload.js HAS BEEN SLIGHTLY MODIFIED

About

A java servlet compatible with LiveReload 2 (protocol). Can be used for development or deployed app.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 73.3%
  • Java 24.1%
  • Erlang 2.6%
0