Josh and Friends - A Real World Web Application Developed Using Netbeans Visual Web Pack
Hi all,
Winston Prakash has posted a great blog about the www.joshandfriends.com.au, www.gayscene.com.au and the new www.stratacentral.com.au series of sites on his block here:
http://blogs.sun.com/winston/entry/realworld_webapp_using_vwp
I’d like answer two posts in regards to the site:
______________________________________
A. Varela - Can you please elaborate a bit on how Josh is using converters on his website?
A. Varela - Can you please elaborate a bit on how Josh is using converters on his website?
Their are a couple of issues here. The main one is that I want the URLS to be SEO friendly. Something like http://www.joshandfriends.com.au/Events/Create
The issue with using a standard VWP faces component is it won’t generate SEO URLs. I use converters to examine an object and create a SEO URL from it. On the inbound side the Servlet Filter interprets these URLs and forwards them to the correct VWP jsps.
For example if i were to pass an object instance of Class “au.com.jaf.News” to a converter called converter.LinkConverter.
The output would be something like /News/VWP_5_5_1 _released_2345
… where 2345 is the id of the instance.
This also occurs with my Images which are surrounded by a href.. tags
I also find Converters very useful for fine grained control of the output. All my images have alt and title attributes. All the links have title attributes.
I didn’t use custom tags as I don’t really like configuring a tld each time i change something.
You can also use converters for generating HTML tags that aren’t realised in the VWP or MyFaces component libraries. UL and OL tags are an issue here.
______________________________________
JJ - Does the site load in the Visual Designer or does it have to entirely be updated in the jsp view? If it doesn’t load in the designer I don’t see the point.
You raise an excellent point. The answer depends on the following:
1) If you are using a static skin (via CSS) then the sites layout will show correctly.
1b) If you are NOT using a static skin i.e. the user can choose skins for the site (like in the case of my site). Then it will never display correctly in VWP designer view. — That being said you can still use the designer! Use the Outline Window to reach you components and the properties window to edit the components.
2) Dynamic images will never load so the Designer view will look kind of weird even if it does display.
So the question is why use the designer at all when it only correctly renders primarily static sites with dynamic text?
For many reasons:
1) The designer is very useful for prototyping up the page before you add dynamic content. I do use it for prototyping up pages which use relative positing i.e. a Dream Weaver generated html templates.
2) I often use the designer to configure properties/values of components rather than the docos. It is very easy to use (and see what’s available) via the VWP properties window and the Outline VWP window.
3) The designer does a great job of some useful code generation. A prime example is the actions for paging on outputTables. Without the designer I’d have to have done it myself.
4) For quicklky testing action event combinations. I often use simple designer pages to test combinations of auto-submit on changes and complex components. You can knock up a test on your code base asap.
Hope the responses were useful.
Thanks,
Josh
p.s. I’ll ask my web designer to post up some locations to download predefined stock HTML templates.

on June 27th, 2007 at 10:51 pm
Hey Josh,
Good writeup. Thanks for taking the time to do it!
I have been working with VWP for some time now. It has provided both headaches and headway.
I use eclipse for all of my java coding and VWP for the GUI stuff.
on June 27th, 2007 at 11:04 pm
I have also used Eclipse a fair bit. Their are pros and cons to both.
I think Eclipse works very well on plain java projects and also handles extremely large numbers of classes better. It also has excellent CVS support.
I find it (Eclipse) quite a pain when it comes to EJB/JEE/WEB projects though.
I often here the “Their is a plugin for that” from colleagues who are Eclipse fans and want to use JEE.
Netbeans it’s all built in! Hopefully with Netbeans 6 the editor will start to rival that of Eclipse.
I also like the netbeans file structure better than that of Eclipse.
I’m actually planning to write a Netbeans 6 vs Eclipse 3.3 pretty soon.