LDD Today

Tips from LDD
Using Web Site Rules to generate URLs to JSPs

Tip submitted by
Jurgen Van De Moere

Level: Intermediate
Works with: Notes/Domino 6
Updated: 03-Feb-2003

When you create links to JavaServer Pages (JSPs) that are stored in Domino databases, you must omit the NSF file extension in the URL. But it's easy to forget to omit the file extension, so why not avoid this problem use Web site rules.

Suppose you have a Web site http://www.domain.tld which is hosted in a db at http://www.domain.tld/dir1/dir2/db.nsf.

Normally, you build links as follows:

Domino URL: http://www.domain.tld/dir1/dir2/db.nsf/xyz?command
JSP (omit the nsf): http://www.domain.tld/dir1/dir2/db/xyz.jsp

Let's automate this and shorten the URLs at the same time by creating two simple Web site rules.
With these rules, instead of creating a link with a long URL like:

http://www.domain.tld/dir1/dir2/db.nsf/xyz?command

you can use nice short URL:

http://www.domain.tld/xyz?command

And for JSPs, instead of using:

http://www.domain.tld/dir1/dir2/db/xyz.jsp

you can use:

http://www.domain.tld/xyz.jsp

That's all! No more differentiating between building links to Domino design elements and to JSPs. And all your URLs are short and easier to remember.



SUBMIT YOUR TIPS!
We encourage you to send us your tips (You can also click the "Would you like to submit a tip?" graphic below.) Your tips can be anything you've discovered about any Lotus product. The most important thing is that your tip be interesting, useful, or handy. And be sure to include complete information about how your tip works. For ideas, take a look at our tip archives. If we publish your tip, we'll send you the IBM Redbooks Lotus Collection on CD.