MY mENU


Wednesday 23 May 2012

JSP Standard Actions


JSP Standard Actions

JSP actions are special XML tags which control the behavior of servlet engine. JSP actions allow you to insert a file dynamically, reuse external JavaBean components, forward the request to the other page and generate HTML for JavaApplet plugin.

jsp:include action

JSP include action allows you to include a file at runtime. The syntax of jsp include action is as follows:
In the page attribute you insert a relative URL of a file which could be an HTML file or another JSP page. Unlike the include directive, the jsp include action insert a file at the time page is being requested.

jsp:useBean action

jsp useBean action lets you load a JavaBean component into the page and use it later. jsp useBean action allows you to reuse other Java classes. The syntax of jsp useBean action is as follows:
By using the jsp:useBean action, you create an new object with the object nameobjectName of the class package.class. Later on you can access the properties of this object by using either jsp:setProperty or jsp:getProperty. Let's take a look at an example. First we have a JavaBeans call Message:
public class Message {

    private String text;

    /**
     * @return the text
     */
    public String getText() {
        return text;
    }

    /**
     * @param text the text to set
     */
    public void setText(String text) {
        this.text = text;
    }
}
Then we create a JSP page which uses the jsp:useBean action to access JavaBean Message inside that page.

We use jsp:setProperty to set the text property of the JavaBean Message and then we call jsp:getProperty to get that message and print it out. Here is the output screenshot:

jsp:forward Action

jsp:forward action allows you to forward a request to the other page. The syntax of the jsp:forward action is listed as below. There is one attribute called page which value is a page you want to forward the request to. You can specify the page statically or dynamically by using expression.
jsp:plugin Action 
jsp:plugin action allows you to embeded Java Applet into a page. Suppose you have an applet which demonstrates the JSP page lifecycle called com.jsp.jspapplet. Here is the way we use jsp:plugin action to embeded that applet into a page:

Banning Programs from “Most Frequently Used” list:



Banning Programs from “Most Frequently 
Used” list:

Take a look at this for it is very interesting. If any of the following words or phrases is included in the program's shortcut name, the program will be excluded from the list: Documentation, Help, Install, More Info, Readme, Read me, Read First, Setup, Support, and What's New. Additionally, the following executables are excluded from the list: Setup.exe, Install.exe, Isuninst.exe, Unwise.exe, Unwise32.exe, St5unst.exe, Rundll32.exe, Explorer.exe, Icwconn1.exe, Inoculan.exe, Mobsync.exe, Navwnt.exe, Realmon.exe, and Sndvol32.exe.

Run the Registry Editor and go to HKEY_CLASSES_ROOT\Applications. Underneath this
key, you'll find a series of subkeys, each representing an application. The primary purpose of
these su-keys is to determine whether the program appears on the Open With dialog box that
appears whenever you try to open an unknown file type. But you can also add a value to any
of the subkeys which will ban programs from appearing on the Most Frequently Used Programs List. Look for a subkey that is the executable name of the application you want to ban from the
list; for example, visio.exe for the Visio business illustration program. Once you find the application's subkey, create a new String value for that subkey, named NoStartPage. Leave
the value blank. Exit the Registry. You might have to reboot for the setting to take effect and the program to be banned from the list.
 Change the Number of Programs That Appear on the List
By default, the Most Frequently Used Programs List has room for six programs, but you can
change that default and have more or fewer programs appear. Right-click the Start button and
choose Properties. Then choose the tab “Start Menu”. Under this tab, choose Start Menu
Customize General. To customize the number of programs to include on the list, edit the
"Number of programs on Start menu" box. You can choose any number between 0 and 30.
No matter how high your resolution is, don't expect there to be room for 30 programs