How do you specify the root context in your tags in web.xml?

This can’t be done in an appserver agnostic way. Context root isn’t part of the standard web.xml file. It’s either specified when you deploy the app or in an appserver specific descriptor. Glassfish: sun-web.xml; JBoss: jboss-web.xml; Weblogic: weblogic.xml; Tomcat: context.xml; WebSphere: ibm-web-ext.xml. Note: the above applies to deploying WAR files. EAR files are a different … Read more

How do I stop jetty server in clojure?

I usually have a line in my Ring app that looks like the following: (defonce server (run-jetty #’my-app {:port 8080 :join? false})) This prevents locking up the REPL. It also allows me to recompile this file without worrying that my server will get redefined. It also lets you interact at the REPL like so: user=> … Read more

websocket closing connection automatically [closed]

In answer to your third question: your client wants to be able to cope with temporary network problems anyway, e.g. let’s say the user closes their laptop between meetings which hibernates it, or the network simply goes down temporarily. The solution is to listen to onclose events on the web socket client and when they … Read more

How to have Jetty redirect http to https

Speaking for Jetty 9… Here’s how you can do it provided that your SSL connector already works: Step 1: Make sure everything goes through SSL by adding this to your web.xml. If you try to access a resource through HTTP, this will return a 403 !SECURE error <security-constraint> <web-resource-collection> <web-resource-name>Everything</web-resource-name> <url-pattern>/*</url-pattern> </web-resource-collection> <user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> … Read more

Is there a way to pass JVM args via command line to Maven? [duplicate]

I think MAVEN_OPTS would be most appropriate for you. See here: http://maven.apache.org/configure.html In Unix: Add the MAVEN_OPTS environment variable to specify JVM properties, e.g. export MAVEN_OPTS=”-Xms256m -Xmx512m”. This environment variable can be used to supply extra options to Maven. In Win, you need to set environment variable via the dialogue box Add … environment variable … Read more

Debugging Scala code with simple-build-tool (sbt) and IntelliJ

There’s a very convenient -jvm-debug flag in the official SBT packages for Mac, Linux & Windows. You can use the flag to specify the debug port: sbt -jvm-debug 5005 Under the covers, this starts the JVM for SBT with the typical verbose debugging incantation: -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 You now can run your code as normal, for … Read more