I\'m beginning Javascript development and as a beginner in JavaScript I make a l
ID: 650950 • Letter: I
Question
I'm beginning Javascript development and as a beginner in JavaScript I make a lot of mistakes. The way I'm developing is very counter-productive because every mistake I fix I have to shutdown Glassfish, re-build the app and re-deploy it. My app is a Java back-end with REST services and the Html, JavaScript, CSS for the frontend. Everything is packed in a .ear file. As of right now, I'm just working with the frontend but I do have to make this whole process to update the files.
My question is ... is there a better way of doing this? Can somebody tell how do you guys work in a similar setup to do the everyday development?
Explanation / Answer
I do a couple of things that greatly increase my efficiency when debugging with javascript, HTML or CSS. One such method that I use is to separate all static web content into the root context of my web app such that it can be served by an Apache front-end. Using the mod_jk module of Apache allows this web server to link to a Java application server that serves the dynamic content on the webapp context.
The benefit this gives is that I can make a change in my IDE and run a simple shell script that copies the static web content to the root context of my web server allowing me to instantly see the results without having to compile or package a deployment file.
Another helpful tip would be to look into the Firebug tool for Firefox. It allows you to debug Javascript, inspect DOM elements, modify HTML, modify styles and also stylesheets on whatever page is currently being viewed in Firefox. It is an invaluable debug and prototype tool that will save you a lot of time. It is well worth learning how to use.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.