I won't make a IDE recommendation, but I can tell you that a jsp can be loaded (i.e. compiled at JBOSS startup. attached is a web.xml file that does just that.
you will know the entry in the file, because it has a
<jsp-file> tag. Servlets can be loaded at startup, but not compiled.
oops I forgot to tell you that to make the precompile work, you have to put four, files in your JBOSS_CLASSPATH they are:
get them from you default deploy ... directories
Hi J, and thanks for the Hint!
But please let me ask one thing regarding that: My understanding is, that I get Jboss to compile my JSPs, when it starts up - which otherwise will happen on the first request of the JSP.
That's interesting for production servers but what about development?
OR does it mean, that all files get compiled also on change?
Sorry, I didn't notice your second question right away.
In production and development a request will start a recompile(if new), behind the scenes. Also, note that this behavior is configurable, so you can make it different, if you desire.
while precompiling jsps on deploy is a step in the good direction I think it is more interesting to compile at development time (notice compile problems sooner, no need for JSP compiler on server (security), quicker (no server load) etc...)
I explained how to do this here:
note: you should not drop your welcome files from the bundle, just leave those JSPs in the WAR, the server will pick up the compiled versions but the validation of web.xml will otherwise fail at deploy time since the file(s) referenced cannot be found
as for the IDE I strongly recommend IntelliJ IDEA from jetbrains (www.jetbrains.com) it's a commercial tool, but IMHO the best one out there, but that you should figure out yourself...
some like eclipse better, but most people that gave it an honest try stick with IDEA
[typical flame bait, I know; this is just my personal experience so keep this thread clean please, thanks :-)]
as for Struts, I would recommend getting into that too, it looks heavy at first but it's quite straightforward once you get the idea and understand how they applied MVC
to make things easier you could visit http://andromda.sf.net, AndroMDA lets you generate EJB/Hibernate/Struts/XML code from a UML diagram
the generated boiler-plate code should put you on track as it typically reflects the experience/best practices of many developers in the open-source community, it should at least give you some ideas. there is a new module called 'bpm4struts' that will handle generation of Struts code, it's not yet in any release but a first version is fully functional and documented (with sample) in CVS
Hi draftdog ,
Great tutorial on how to get those JSPs compiled before deployment. I think this can really save a considerable amount of time!
I think I'll try IDEA, I've read several good comments on it. Otherwise, I'll just integrate the ant tasks in eclipse.
Regarding the team development: As I said, I come from PHP and with 3 developers it was no problem to work with one server and a shared webserer root.... I can see that this isn't applicable for J2EE, so every developer should run his own container and commit his work to a 'commulated one' - what do you think?
well, you could always explode your WAR bundle:
suppose your webapp is bundled in appname.war (you would normally copy this into /deploy), remove this bundle and create a directory in /deploy with exactly that same name 'appname.war', unzip your WAR bundle in there
you can then transparently use you webapp as though it was deployed as a bundle
you can update files at runtime by copying and overwriting, these new ones will be picked up by the container, I am not sure if this works for precompiled JSPs (never tried it), but it definately works for regular JSPs
this is a JBoss specific feature although other app servers might implement it also
on the other hand, it's probably more comfortable to run your local server (if you have enough RAM, I have 1,5GB on an AMD Athlon, I paid less than 100 euros for this RAM, so it was an easy decision to make)