IBM®
Skip to main content
    Country/region select      Terms of use
 
 
   
     Home      Products      Services & solutions      Support & downloads      My account     
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Technical Library
developerWorks



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: 02/03/2003

Related link:
More Tips from LDD


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.
  1. Open your Domino Directory in your Lotus Notes client.
  2. Go to the Servers - Internet Sites view.
  3. Open a Web site document, then click the Web Site button, then click Create Rule from the menu.
  4. In the Web Site Rule document, select Substitution in the Type of rule field.
  5. In the Incoming URL pattern field, enter:

    /*
  6. In the Replacement pattern field, enter:

    /dir1/dir2/db.nsf/*

    Note that the path reflects the previous example, so should be changed to reflect your environment.
  7. Save and close the document.
  8. Repeat Steps 3 to 7 for a second Web Site Rule document, enter the following:
    - In the Type of rule field, select Substitution.
    - In the Incoming URL pattern field, enter:

    /*.jsp

    - In the Replacement pattern field, enter

    /dir1/dir2/db/*.jsp

    Note that the directory path reflects the previous example, so should be changed to reflect your environment.
  9. Close the directory.

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.






Would you like to submit a tip?
    About IBM Privacy Contact