Welcome to the Web Developer and Business Applications Forum

Here's how you can participate: Below are the general forums where you can post. Select the one that best fits the topic you wish to address.

To create a new discussion thread/topic: click on the forum link below where you'd like to add your thread, such as Tips and Tricks Exchange. Then, once you've logged in, click on the New Topic link at the top. This will allow you to create a new thread.

To respond to a current thread or post: click on the forum where the post resides, then click on the link to the thread you are responding to, and at the top click the Reply link.

If you have any questions, please feel free to call us at 630-916-0662.



A Message Board, Guestbook, or Poll hosted for your website.
Register Login New Posts Chat
 
mrc > Forums > m-Power Tips and Tricks > mrc Tip: servlet 'pageName' parameter
 
Username:  
Password:  
 
   
 


Thread Tools Search This Thread 
Reply
 
Author Comment
 
JoeStangarone
Moderator
Registered: 11/30/05
Posts: 26

    04/25/06 at 10:53 AMReply with quote#1

A little used feature of the servlets produced by m-Power and the mrc-Productivity Series is the pageName parameter. In a nutshell, what this parameter does is to tell the servlet what .html page to use for the presentation.

This can have a myriad of uses, including but not limited to:
  1. Different function for different users (they can't do what's not on the page).
  2. Different looks or identities for different companies sharing a code base - interesting applications in a web-hosting or service bureau type environment.
  3. Multinationals can use different pageNames for different languages while sharing the same code base.
  4. Minimize cloning of similar applications because, oftentimes the differences between two similar applications can be addressed in the presentation tier.
Let's take a look at one. In this first link, we will leave off the pageName parameter which will default the servlet to use XXXXXXs.html for its presentation where XXXXXX is the servlet name.

http://www.crazybikes.com/mrcjava/servlet/MRCWEBDEMO.I00220s?CUSNO=4&slnk=1&action_mode=UVK&one_step=0

The second two links, use the pageName parameter to give completely different looks to the same application.

http://www.crazybikes.com/mrcjava/servlet/MRCWEBDEMO.I00220s?CUSNO=4&pageName=I00220SL1.html&slnk=1&action_mode=UVK&one_step=0

http://www.crazybikes.com/mrcjava/servlet/MRCWEBDEMO.I00220s?CUSNO=4&pageName=I00220SL3.html&slnk=1&action_mode=UVK&one_step=0

This is just a simple example where the looks use different style sheets and headers only. Of course, you can change absolutely anything in the .html tier.

charliehlouis
Registered: 11/29/05
Posts: 22

    07/05/06 at 10:04 AMReply with quote#2

I tried the &pageName parameter and it worked great for everything but reports.  When I try to use it to paint a report, it acts like it doesn't find it and I get the painting from the original Rxxxxx.html file.  Am I doing something wrong?
JoeStangarone
Moderator
Registered: 11/30/05
Posts: 26

    07/05/06 at 01:33 PMReply with quote#3

Excellent question! I am glad to see that not only are people reading these posts, but they are also using them.

As you know, reports have two presentation layers: RXXXXX.html is the actual report layout, RXXXXXs.html is the report prompt screen layout. The &pageName parameter refers to the prompt screen. So, if you were calling the report and skipping the prompt screen (with an &run=1 parameter), it would not even look for the &pageName parameter (because you are skipping the prompt page)..

But, do not despair. What you wish to do works fine for reports. The &rptPage parameter is the equivalent of the &pageName parameter for the RXXXXX.html file. See the next "mrcTip:  Going Wireless with Your Servlets" for an example.

Previous Thread | Next Thread
Reply

  Bookmarks  
Digg Diggdel.icio.us del.icio.usStumbleUpon StumbleUponGoogle Google

mrc (US)
555 Waters Edge
Suite 120
Lombard, IL 60148
630-916-0662
mrc (UK)
Argyle House
1 Dee Road
Richmond, Surrey
TW9 2JN
+44-20-8322-7720