Within web applications, it can be useful to perform URL rewriting in order to provide URLs in a more user-friendly and often shorter format. Typically, URLs are re-written to remove GET parameters, which can help us in making URLs more search engine friendly and ultimately resulting in a higher page ranking within search engines.
As we saw earlier in the book, the default file extension for a Seam web page is .seam
. We can use URL rewriting to remove this extension. For example, using Seam's default configuration, the URL for a customer details page may be:
http://localhost:8080/enterprise/customer.seam
With URL rewriting, we can change this to:
http://localhost:8080/enterprise/customer
There's not really that much benefit in simply removing the .seam
suffix from a URL. The major benefit occurs when we have HTTP GET parameters in the URL. URL rewriting allows us to remove these parameters and make them part of the URL.
Consider again our URL to access a customer's details. To access...