views:

40

answers:

3

I am developing a web based java app, running on jboss and sql server.

I seem to find myself spending an inordinate amount of time recompiling/deploying just to tweak the interface in jquery/javascript/css/html.

Any tips for reducing the turnaround ?

Its deployed to an ear file, so I can not alter the jsps/javascript after deployment(?). Yes, I have created the a static version of the webpage frontends but they do not give me the full functionality - none of the data from db/jstl processing.

To clarify its not so much the actual compile time itself (30seconds) as the ant builds are set-uo well and are very modular; its the subsequent deployment to jboss and accessing the application that cause the real headache.

+1  A: 

when developing with application server i've used this product in the past: JRebel from zeroturnaround.

It will prevent having to restart and redeploy an application running within an application server. It works for most scenario's however i found that there were a few occasions when a server restart were required(in my case making changes to the application initialisation). But if you're only working on the interface this product will save you a great number of deployments and restarts.

I have not used Jrebel in combination with JBoss but they mention it as a supported container so thta shouldn't be a problem.

Marco Tolk
A: 

I am an average web designer (at best!) and writing complicated HTML and CSS is a pain for me. A lot of what I do with styles and layout is trial and error and involves a lot of tweaking. I also change my mind frequently about exactly what shade of color I want things. Basically, I'm in the same boat as you.

Long ago I abandoned the idea of the tweak-deploy-test iteration cycle (mvn clean tomcat:deploy takes 2 minutes on my current project) as by the 10th iteration trying to sort a simple layout problem and waiting for the deployment would drive me round the bend. I now use two strategies;

  1. Get a static copy of the HTML I want to work with. This usually means deploying the app, navigating to the page and saving it to a work directory somewhere. This saves the static HTML as well as any images. Next I copy the CSS files from my workspace into the work directory and hand edit the saved HTML file to point to these CSS files.

  2. Open the static HTML page in Firefox. Now I can tweak the CSS or HTML and simply refresh Firefox to show the changes. Iteration time is now down to about 1 second. I can further improve my tweaking using the Firebug addon. This allows you to manipulate the CSS and HTML from within Firefox. This is especially useful for getting margin and padding size right. Once I've tweaked it in Firebug I hand edit the saved HTML and CSS then refresh Firefox to make sure I'm happy with the result.

At certain key stages I then make the changes to my workspace to reflect my tweaking on the static files. I then redeploy and test to make sure I got it right. As I use Firefox for all my development I have to pay special attention to browser compatibility, especially with IE, but this usually comes at a later stage.

Edit: I didn't mention Javascript, but this process works great for JS too!

Qwerky
Yes I had been using this "static copy" method. it works quite well, however a lot my work is quite heavy on data processing using jstl - so is dependent on serverside processing. I will try the method mentioned above, directly editing the deployed jsps in my servers deployment directory. Also I sometimes lose track of the changes between the two versions. And of course getting it to work in firefox is only half the battle - ie6 is browser officially supported. Cheers!
NimChimpsky
also, if you haven't used them already"ie developer toolbar", and chrome developer tools, are excellent.
NimChimpsky
+1  A: 

If you do not work directly in an exploded war inside the hotdeploy folder of JBoss, then strongly consider it.

Thorbjørn Ravn Andersen
Would you care to elaborate ? The project is compiled to ear, via a client.jar, ejb.jar and web.war - I can access these via the tmp directory of my jboss server. However I could not see where I could edit the jsp's ... ?
NimChimpsky
oops, Yes it is there in my temp directory. Ok will try that. mkthxbai.
NimChimpsky