MY mENU


Wednesday, 23 May 2012

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

Tuesday, 22 May 2012

JSP Declarations


JSP Declarations

The JSP you write turns into a class definition.  All the scriptlets you write are placed inside a single method of this class. You can also add variable and method declarations to this class.  You can then use these variables and methods from your scriptlets and expressions. To add a declaration, you must use the <%! and %> sequences to enclose your declarations, as shown below.
The example has been created a little contrived, to show variable and method declarations.
Here we are declaring a Date variable theDate, and the method getDate.  Both of these are available now in our scriptlets and expressions.

But this example no longer works!  The date will be the same, no matter how often you reload the page.  This is because these are declarations, and will only be evaluated once when the page is loaded!  (Just as if you were creating a class and had variable initialization declared in it.)

Exercise:  Modify the above example to add another function computeDate which re-initializes theDate.  Add a scriptlet that calls computeDate each time.

Note: Now that you know how to do this -- it is in general not a good idea to use variables as shown here. The JSP usually will run as multiple threads of one single instance. Different threads would interfere with variable access, because it will be the same variable for all of them. If you do have to use variables in JSP, you should use synchronized access, but that hurts the performance. In general, any data you need should go either in thesession object or the request object (these are introduced a little later) if passing data between different JSP pages. Variables you declare inside scriptlets are fine, e.g. <% int i = 45; %> because these are declared inside the local scope and are not shared.
 

Monday, 21 May 2012

JSP Directives


JSP Directives

JSP directives instruct the JSP container on how to work with JSPs. There are three directives in the JSP specification: page, include and taglib. The directive form usualy follows the following form:
<%@ directive attribute1 = "value 1" 
              attribute2 = "value 2"
              ...
              %>

page Directive

The page directive allows you to define one or more following attributes:
import Option
import="package.class"
import="package.class1,...,package.classN"
Import option allows you to specify which classes or packages are used in the page. for example, you can import all the classes in the package java.util as follows: 
<%@ page import="java.util.*" %>
You can use  import option multiple times in the page directive.
contentType option
contentType="MIME-Type"
 contentType="MIME-Type; charset=Character-Set".
The contentType option allows you specify the MIME type of the output page. The default istext/html you can also use other values such as text/plain for outputing text format  such as
<%@ page contentType="text/plain" %>
IsThreadSafe Option
isThreadSafe="true|false". 
isThreadSafe option allows you to indicate the page is being processed as thread-safe. The default value of the isThreadSafe is true therefore all JSPs are considered thread-safe. IfisThreadSafe is set to false, JSP engine ensures that only one thread at a time is executing the current JSP page 
.session Option
session="true|false". 
By using session option, you are telling JSP compiler that you want to use session or not. The default value of the session attribute is true, indicating that there is an implicit variable called session is available for your use.

buffer and autoFlush Options

buffer and autoFlush options let you control the JSP buffering. 
You can turn buffer on or off or even specify the buffer size by using buffer option such as:
<%@ page buffer="none" %>
<%@ page buffer="64kb" %>
 
autoFlush option controls whether the buffer is flushed automatically when it is full.  The default value of autoFlush is true means JSP automatically flush the buffer when it is full.

Info Option

Info option allows you to define the description of the servlet. Later on you can access this value by calling the method:
Servlet.getServletInfo(). 

extends Option

In some cases, you need to create your own superclass of JSP pages and using this supper class in different JSPs. In order to do so, first you need to create a super class first. This supper class normally inherits from the HttpServlet class. And in the JSPs you use theextends option to use that supper class in you JSP page.

isELIgnored Option

isELIgnored option provide the ability for you to disable the evaluation of the expression language (EL). You will learn more about expression language in the later tutorial.

errorPage Option

errorPage option allows you to indicate the error page to be displayed when the error occurs in the current executing page. For example:
<%@ page errorPage="error.jsp" %>

isErrorPage Option

isErrorPage option indicates that the current JSP page can be used as an error page for other JSP page. When you set isErrorPage equal true, JSP engine creates an implicit exception object which contains the Throwable object that caused the error page to be called. By using this excpetion object, you can print out the error message to the user, for example:

Include Directive: Include directive lets you to include a file (JSP or HTML) at the time JSP engine translate the JSP page into a servlet.  The syntax of include directive is as follows:
<%@ include file="relative url" %>
The filename you specify in the include directive is a relative URL. If you provide a file name without associated path, the JSP compiler always assumes that the file is in the same directory as the JSP page.
Normally the include directive is used to include common sections of  a JSP page in a webapplication or website such as header, navigation bar, footer... to make those section reusable in every JSP page.

taglib Directive

JSP has a set of standard tags for you to use. JSP also provide a possibility to allow you to create new custom tags look like HTML and XML tag. In this case, you can use taglib directive to use your custom tag in your JSP page. For using custom tag, you can refer to the custom tag tutorial. The syntax of using taglib directive is as follows:
<%@ taglib uri="http://localhost/jsptutorial/taglib/mytaglib"
   prefix="jsptutorial" %>