if there is no operation, we set entity
added missing exception
added contextPath to javascript