voyent
Using ICEfaces with IntelliJ  XML
Forum Index -> Tools
Author Message
patrick.corless

Joined: 26/Oct/2004 00:00:00
Messages: 1970
Offline


ICEfaces and IntelliJ

Netbeans, MyEclipse and Eclipse are the tools of choice for most JSF developers but there is another option that is often overlooked. Developers who have done a lot of client side Swing development have likely come across IntelliJ in their travels. The good news is that the developers at JetBrains haven’t ignored the web space and version 6 and 7 of IntelliJ are excellent IDE’s for developing JSF application.

A considerable number of ICEsoft developers use IntelliJ 6 or 7 for day to day development. IntelliJ’s popularity likely stems from its excellent code completion and code analysis tools, as well as the ease at which it integrates with most application servers such as Tomcat and JBoss. The less time a developer spend deploying an application the more time they’ll have for actual application development.

IntelliJ currently lacks WYSIWUG JSF editor functionally but this is just fine for most IntelliJ users. It does however come with an excellent JSPX and CSS text editor that attempts to minimize any compile time errors. IntelliJ support JSF 1.1/1.2, Spring, Hibernate and a slew of other web technologies right out the box, often times not needing any custom configuration. Enough already about the virtues of IntelliJ, if your reading this your are likely already a IntelliJ fan and just want find out about the tricks we use when working with JSF and ICEfaces.

JSF /ICEfaces

All new projects in IntelliJ can be pre configured to support JSF 1.1 or JSF 1.2 by simply adding a check box on the new module wizard. Even if you miss this step when creating a new project IntelliJ will automatically figure out your web application as soon as a web.xml or faces-config.xml is created. Similarly when a new module is imported, IntelliJ will do a search for known web configuration files. For example Spring’s applicationContext.xml is automatically picked up.

Tag completion and Bean introspection have to be IntelliJ’s strongest features when working with JSF. Once the ICEfaces Component library TLD has been added to settings->resources, all ICEfaces component tags and Documentation as available in the JSPX editor. Standard JSF, JSTL and JSP tags are picked up automatically. Bean introspection is done automatically, the editor will resolve all Beans defined in the faces-config.xml plus any other definitions that are defined via the web.xml. Introspection will virtually eliminate Bean introspection syntax errors that usually only show up when the pages are compiled. That’s right, #{mybean.getProperty} will show up as an underlined error in the editor. If auto completion was used then the error would have never occur in the first place, #{mybean.property} would have been selected and no compile timer error would have occurred.

Unlike other IDE’s intelliJ behaves more like an XML editor then a JSP editor. Basically this means that you don’t have to start every page off with a <JSP:root/> tag to get the IDE to do tag completion. IntelliJ required you to load the name spaces of elements you plan to use but nothing else. This is great when using file includes in Facelets or JSP. If you are using Facelets in your project I strongly recommend you use the JSPX extension as XHTML extension doesn’t get associated with JSF in IntelliJ.

Build support

IntelliJ can be configured to build and deploy the entire web project. However we seldom do this in practise as every developer uses slightly different environment and or platform, making project setting sharing near impossible. Instead of letting IntelliJ build the project we usually opt for Ant and/or Maven, this allows for a build system that is a little more portable and reusable. IntelliJ doesn’t let us down if we use this options as it has great support for editing and running Ant and Maven scripts from within the IDE.

The ICEfaces sample application use a common base ant build script that is extended by each sample application. The common script is located in the ICEfaces bundle under bundle/samples/etc/build-common.xml. The sample applications are setup into following file hierarchy that maps nicely to the default layout of an IntelliJ project structure.

Image... see attached

The common Ant script do two important thing as far as IntelliJ is concerned. They copy all compiled source code into the “web/WEB-INF” directly making the “web” folder an exploded instance of the project. The main advantage of this is that JSPX files can be updated and saved without having to redeploy the web application but more on this in the next section. Second, the build script will also put a war file in the “dist” directly which can be deployed to your application server with or without IntelliJ.

Server integration

IntelliJ has great support for the major web servers from Glassfish to Tomcat all of which have their own particular merits. Running an application server through IntelliJ allows easy management of server log files and stack traces, supports IDE debug mode and integration/plug-ins for various profilers. For day to day development we often use Tomcat 6.0 because of its support for JSF 1.2 and its lightning quick start-up time. IntelliJ has module level configuration which allows the user to pick where their module will be exploded or where the compiled war file is located.

Using the exploded directory can be quite a time saver when combined with Tomcat. When the tomcat instance is started with IntelliJ the server web context is shifted to the exploded directory. In the previous section it was mentioned that our build script will automatically make the “web” directory the exploded directory. If IntelliJ is pointed to the “web” directly from our build scripts, live editing of the JSPX files is possible without the need to redeploy or restart the application server. This can be a huge time saver when building the JSF application. The only time the project needs to be redeployed will be if Java source code or resource files change. Any changes to CSS, component tags or EL will be refreshed the next time the page is refreshed in the browser.

[Thumb - directory-structure.png]
 Filename directory-structure.png [Disk] Download
 Description
 Filesize 5 Kbytes
 Downloaded:  1895 time(s)

[Email]
michelle2

Joined: 14/Nov/2007 00:00:00
Messages: 449
Offline


patrick.corless wrote:
ICEfaces and IntelliJ


 


I have intellij, I am a proffessional jsf developer, used Icefaces for some time And I find Intellij confusing. I've used other environments but using intelij with a 3rd party component library is somewhat painful, I realize Intellij has some powerful features and would love to use it a lot more, may be you or someone could provide a small sample icefaces project to get us all started ...

Also Intellij's lack of a spring webflow plugin is another, abiet smaller issue.

But I keep going back and looking at it... last thing I did was try to build one of the latest spring webflow builds, but I couldn't get maven and ivy configured properly under intellij.

[Email]
georges.goebel@pch.etat.l


Joined: 23/Jun/2007 00:00:00
Messages: 276
Offline


Hi,

intellij rocks !!
It's the best IDE ever. I use it since version 3.0 and I really like it.

I regularly try out the other IDE's (netbeans, eclipse) and in my opinion, IntelliJ is much better than these IDE's. But I have to admit that Netbeans made a lot of goof progessions with their last version

Georges
[Email]
averri

Joined: 25/Mar/2007 00:00:00
Messages: 33
Offline


Where is the Ice Faces integration support for IntelliJ?
ken.fyten

Joined: 26/Oct/2004 00:00:00
Messages: 1319
Offline


Hi,

There is no integration bundle for ICEfaces and IntelliJ. You simply follow the instructions at the top of this thread that explain how to manually configure IntelliJ to use ICEfaces in your projects, etc.

Regards,
Ken

Ken Fyten
VP Product Development
ICEsoft Technologies, Inc.
mabujaber

Joined: 15/Oct/2009 00:00:00
Messages: 7
Offline


you can check this article, show you step by step how to use ICEfaces with intellij.
http://mabujaber.wordpress.com/2011/06/24/icefaces-with-intellij/

regards,
Moayad
 
Forum Index -> Tools
Go to:   
Powered by JForum 2.1.7ice © JForum Team