[spring] refactor js code