May 17

Nowadays having SEO friedly links is very important if you want to list higher on the search engines. And with JSF this can be a big pain in the a**. There is an extension available called prettyfaces. For my applicaiton i thought of first using prettyfaces rather then developing my own enhancement to save me some time. But then i ended up developing my own prettyfaces:) as i wanted some extra functionality specific to my application which wasn’t possible using prettyfaces.

So i have my own custom tag called this tag along with some other params takes in the href paramter and rewrites it to a SEO friendly link and outputs it.

Then when this link is clicked you need to convert it back to the normal link for example with parameters. For that you need to have a servlet defined in your web.xml which gets the SEO friendly URL rewrites it to a normal url and then dispatches it to your faces servlet.

If you want to have a look at my application using this enhancement to convert the links to SEO friendly links visit www.usedgaadi.in, its running on JSF!

Tagged with:
May 17

If you are using hibernate or ejb, am sure you cache your entities using either ehcahce or JTreeCache or some other cache available. But to boost the performance you could also cache your pages or some fragments like some includes.

For my application i have used ehcache .. and for that everything is explained in detail here

The only problem i encountered was that it also cached my post request .. in order to exclude all my post request from being cached i overrode the methode caclulatekey to return null for post requests .. Am sure there is some configuration variable which one could set in the web.xml or ehcache.xml but i was to lazy to search ;) ..

protected String calculateKey(HttpServletRequest httpRequest) {
        if (httpRequest.getMethod().equals("POST"))
            return null; ...

You could then use some custom tag for caching some parts of your page. for e.g seam has a tag you could also have a tag similar to that and cache your page fragments.

Tagged with:
preload preload preload