Archive for July, 2007

There are around 25 separate tag libraries in (Hosting web)

Sunday, July 22nd, 2007

There are around 25 separate tag libraries in the Taglibs project, each of which provides some unique functionality that most web applications need to perform sooner or later. The tag libraries are free and provide the source code, which allows you to not only get a better understanding of how to develop JSP tags but also to modify or extend the tags as your application dictates. There’s no sense in listing the available tags, as new ones are added regularly. The best idea is to check the site itself. You can find the Taglibs project on the Jakarta site at http://jakarta.apache.org/taglibs/. 8.9.2 JSPTags.com Another useful web site that contains many JSP tags is http://jsptags.com. This site has been around for several years and has many tag libraries that you can use for free. It’s also a great resource for other web application information. Make sure to check this site as well before setting off to create your own tag. Somebody may have already created the tag you need, saving you the development and testing time always a good thing. 8.10 The JSP Standard Tag Library (JSTL) The intent of the early JSP specification group members was to define a set of standard JSP tags within the specification. This would allow vendors to generate their own versions of the standard tags but also allow developers to count on this set of standard tags to be available in all compliant containers. However, due to time constraints, that feature of the early JSP specification was not included. Since then, many vendors have created their own versions of commonly used tag libraries, but these versions are different enough that developers can’t easily port their JSP pages from one container to another without having to modify the pages. JSR 52, the JSP Standard Tag Library (JSTL), aims to fix that problem. JSR 52 defines a set of standard tags that should be present in any compliant container. The first version of the specification has been finalized and approved, and the group has released a reference implementation of the tag library. The tags provided in the first release can be grouped into four distinct areas: Core tags Internationalization tags XML tags SQL tags 8.10.1 JSTL Core Tags The core tags include those related to expressions, flow control, and a generic way to access URL- based resources whose content can then be included or processed within the JSP page. They include tags such as if, forEach, import, redirect, and many more. 8.10.2 JSTL Internationalization Tags The internationalization tags are divided into two groups: messaging and formatting.
Please visit our professional web hosting services to find out about cheap and reliable webhost service that will surely answer all your demands.

put Create a request-scope bean that specifies the (Web design rates)

Sunday, July 22nd, 2007

put Create a request-scope bean that specifies the content to be used by the get tag. Content can be printed directly or included from a JSP or HTML file. get Retrieve content from a request-scope bean, for use in the template layout. Again, the Tiles components provide much more functionality than these standard template tags. Although some organizations still use them, many developers are moving over to the Tiles library. 8.8 Nested Tags The Struts custom tag libraries provide a great deal of power and flexibility to the developer. The freedom to access properties of a bean at any level using nested properties is very powerful. There are some restrictions in how this technique can be deployed, however. When attempting to nest one tag inside another, the inside tag has certain dependencies on the outside tag that may make it cumbersome or impossible to cleanly render the dynamic data. There are workarounds, but these usually involve using scriptlets with Java within the JSP page. “Nested” tags were created to solve this problem and to enrich the Struts tag libraries. The Nested tag library was created by Arron Bates to make it easier to nest Struts tags inside one another and to match the ability of the model layer to nest beans inside one another. The nested tags have become so popular that they have been added to the core libraries. Nested tags parallel the current tags supported by the Struts framework. For example, there are HTML nested tags, Logic nested tags, and Bean nested tags. There is no need for nested Template tags, so those don’t exist. The major difference is that nesting is better supported in the nested versions. The tags within the Nested tag library are used in the same way that the non-nested versions are. Minor differences exist to allow for tags to know when they are nested within one another and therefore can access properties of the parent tag. Other than these small differences, they are very similar. You can find more information on the nested tags in the Struts API documents. Tutorials and more information on the nested tags are available at http://www.keyboardmonkey.com/struts/index.html. 8.9 Other Useful Tag Libraries The Struts custom tags aren’t the only tag libraries that work with Struts applications. Although some of the Struts tags make it very easy to use certain facets of the framework, other tags can assist you in developing applications and help to reduce the development time for a project. We will mention only two of the more popular locations at which you can find additional tag libraries, but many other sites and vendors provide free or low-cost tag libraries too. You should always check to see if the tag you need already exists or if there’s one that’s close enough for you to simply extend or modify. 8.9.1 The Jakarta Taglibs Project One of the best resources is another Jakarta project named Taglibs. The goal of the Taglibs project is to provide an open source repository for JSP custom tag libraries and web publishing tool extensions.
We highly recommend you visit web and email hosting services if you need stable and cheap web hosting platform for your web applications.

Free web space - This tag calls the method using the name

Sunday, July 22nd, 2007

This tag calls the method using the name attribute. The name attribute must start with a “/”. 8.6.7 The write Tag The write tag is another important tag within the Bean tag library, and it gets a great deal of use. It retrieves the value of the specified bean property and renders it to the page output as a String. The write tag uses the following rules: If the format attribute is specified, the value will be formatted based on the format string and the default locale. The formatKey attribute can also be used. It should specify the name of a format string from the message resource bundle. The formatKey attribute is used to specify a format string from the resource bundle. The specific resource bundle and locale can also be specified. If the bundle and locale are not specified, the default resource bundle and current user locale will be used. Otherwise, the usual toString( ) conversions will be applied. The following is an example of using the write tag: Hello

If the attribute is set to trueand the bean specified by the name and attributes is not found, the tag will not throw an exception. If not set, or set to false, a runtime exception will be thrown. 8.7 Template Tags The concept of templates has not been discussed yet in this book. The Template library supplies tags that are useful for creating dynamic JSP templates for pages that share a common format. These tags provide capabilities similar to stylesheets or the standard include directive in JSP technology, but they can be dynamic. With the advent of the Tiles framework, which we’ll discuss in Chapter 14, the template tags become less widely used. Thus, I’ll provide a list of the tags within the library, but won’t go into detail about them. If you require more information on the tags within the Template tag library, you can find it in the Struts API at http://jakarta.apache.org/struts/api/. The tags within the Template library are listed in Table 8-10. Table 8-10. Custom tags within the Template tag library Tag name Description insert Retrieve (or include) the specified template file, and then insert the specified content into the template’s layout. By changing the layout defined in the template file, any other file that inserts the template will automatically use the new layout.
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision J2ee Web Hosting services.

Web server extensions - The URL used to access the specified application

Saturday, July 21st, 2007

The URL used to access the specified application component is calculated based on which of the following attributes you specify (you must specify exactly one of them): forward Use the value of this attribute as the name of a global ActionForwardto be looked up, and use the application-relative or context-relative URI found there. href Use the value of this attribute unchanged (as this might link to a resource external to the application, the session identifier is not included). page Use the value of this attribute as an application-relative URI to the desired resource. This value must start with a “/”. 8.6.4 The message Tag The message tag is one of the most widely used tags within the Struts tag libraries. It retrieves an internationalized message for the specified locale, using the specified message key, and writes it to the output stream. You can supply up to five parametric replacements (such as “{0}”). The message key may be specified directly, using the key attribute, or indirectly, using the name and property attributes to obtain it from a bean. The bundle attribute allows you to specify the name of an application-scope bean under which a MessageResources object can be found. If no locale attribute is specified, the Locale will be retrieved from the session using the key Action.LOCALE_KEY. The following is an example of the message tag: :

8.6.5 The parameter Tag This tag retrieves the value of the specified request parameter and defines the result as a page-scope attribute of type String. If any non-null value is specified for the multiple attribute, the result will be a String[] obtained from calling getParameters( ) instead of getParameter( ). 8.6.6 The resource Tag This tag retrieves the value of the specified web application resource and makes it available as either an InputStreamor a String, depending on the value of the input attribute. If the input attribute contains any non-null value, an InputStream will be created. Otherwise, the resource will be loaded as a String.
If you are looking for cheap and quality webhost to host and run your website check Jboss Web Hosting services.

cookie Define a scripting variable based on the (Christian web host)

Saturday, July 21st, 2007

cookie Define a scripting variable based on the value(s) of the specified request cookie. define Define a scripting variable based on the value(s) of the specified bean property. header Define a scripting variable based on the value(s) of the specified request header. include Load the response from a dynamic application request and make it available as a bean. message Render an internationalized message string to the response. page Expose a specified item from the page context as a bean. parameter Define a scripting variable based on the value(s) of the specified request parameter. resource Load a web application resource and make it available as a bean. size Define a bean containing the number of elements in a Collectionor Map. struts Expose a named Struts internal configuration object as a bean. write Render the value of the specified bean property. Many of the tags in this tag library throw a JspException at runtime when they are used incorrectly (e.g., when you specify an invalid combination of tag attributes). JSP allows you to declare an “error page” in the <%@ page %> directive. If you want to process the actual exception that caused the problem, it is passed to the error page as a request attribute under key org.apache.struts.action.EXCEPTION. 8.6.1 The define Tag This tag retrieves a specified bean property and defines it as an attribute that is accessible to the remainder of the current page. No type conversion is performed on the returned property value unless it is a Java primitive type, in which case it is wrapped in the appropriate wrapper class (e.g., intis wrapped by java.lang.Integer). The property value is stored in the scope defined by the toScope variable. 8.6.2 The header Tag This tag retrieves the value of the specified request header and defines the result as a page-scope attribute of type String. If no header with the specified name can be located and no default value is specified in the value attribute, a request-time exception will be thrown. If the attribute multiple is set to any non-null value, the idattribute will contain the result of the call to HttpServletRequest.getHeaders() rather than a call to HttpServletRequest.getHeader( ). 8.6.3 The include Tag This tag performs an internal dispatch to the specified application component (or external URL) and makes the response data from that request available as a bean of type String. The value is stored into the id attribute. This tag has a function similar to that of the standard tag, except that the response data is stored in a page-scope attribute instead of being written to the output stream. This allows you to position the output as needed. If the current request is part of a session, the generated request for the include will also include the session ID.
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.

Apache web server - iterations performed. name The name of the JSP

Saturday, July 21st, 2007

iterations performed. name The name of the JSP bean containing the collection to be iterated over (if property is not specified), or the JSP bean whose property getter returns the collection to be iterated over (if property is specified). offset The zero-relative index of the starting point at which entries from the underlying collection will be iterated through. This can be either an integer that directly expresses the desired value, or the name of a JSP bean (in any scope) of type java.lang.Integerthat defines the desired value. If not present, zero is assumed (meaning that the collection will be iterated from the beginning). property The name of the property of the JSP bean specified by name whose getter returns the collection to be iterated. scope The bean scope within which to search for the bean named by the name property, or “any scope” if not specified. type The fully qualified class name of the element to be exposed through the JSP bean named from the idattribute. If not present, no type conversions will be performed. The elements of the collection must be assignment-compatible with this class, or a request-time ClassCastException will occur. 8.5.5 Messages and Errors The messagesPresentand messagesNotPresent tags evaluate the body content, depending on whether an ActionMessagesor ActionErrors object is present in the request scope. Table 8-8 lists the attributes of these two tags. Table 8-8. Attributes of the messagesPresent and messagesNotPresent tags Name Description name The parameter key to retrieve the message from request scope. propertyThe name of the property for which messages should be retrieved. If not specified, all messages (regardless of property) are retrieved. message By default the tag will retrieve the request-scope bean it will iterate over from the Action.ERROR_KEY constant string, but if this attribute is set to true, the request-scope bean will be retrieved from the Action.MESSAGE_KEY constant string. Also, if this is set to true, any value assigned to the name attribute will be ignored. 8.6 Bean Tags The tags that are part of the Bean tag library are used for accessing JavaBeans and their associated properties as well as for defining new beans that are accessible to the remainder of the page via scripting variables and page-scope attributes. Convenient mechanisms to create new beans based on the values of request cookies, headers, and parameters are also provided. Table 8-9 lists the tags within the Bean tag library. Table 8-9. Custom tags within the Bean tag library Tag name Description
We recommend cheap and reliable webhost to host and run your web applications: Coldfusion Web Hosting services.

page Use the value of this attribute as (Web page design)

Friday, July 20th, 2007

page Use the value of this attribute as a context-relative URI, and generate a server-relative URI by including the context path. The forward tag is responsible for either redirecting or forwarding to a specified global ActionForward. The forward tag has one attribute, name, which is the logical name of the ActionForward from the configuration file. 8.5.4 Collection Utilities One of the most useful and most widely used tags within the Struts tag libraries is the iterate tag. The iterate tag is responsible for executing its body content once for every element inside the specified collection. It has one required attribute: id The name of a page-scope JSP bean that will contain the current element during an iteration. An example is the best way to understand how to use the iterate tag: Here, the iterate tag will get the collection of addresses by calling the getAddresses( ) method on the userSummary bean. During each iteration, an individual address will be assigned to the address variable. This variable can be used inside the body of the iterate tag as if you had assigned it directly. During the next iteration, the next address object will be assigned to the address variable. This continues until the entire collection of addresses has been traversed. The iterate tag is very flexible in terms of where it gets the collection to iterate over. The attributes that control how the iterate tag performs this behavior are listed in Table 8-7. Table 8-7. Attributes of the iterate tag Name Description collectionA runtime expression that evaluates to a collection (conforming to the requirements listed above) to be iterated over. id The name of a page-scope JSP bean that will contain the current element of the collection on each iteration, if it is not null. indexed The name of a page-scope JSP bean that will contain the current index of the collection on each iteration. length The maximum number of entries (from the underlying collection) to be iterated through on this page. This can be either an integer that directly expresses the desired value, or the name of a JSP bean (in any scope) of type java.lang.Integerthat defines the desired value. If not present, there is no limit on the number of
Searching for affordable and proven webhost to host and run your servlet applications? Go to Linux Web Hosting services and you will find it.

Finally, here’s how to compare (Web site) a number value

Friday, July 20th, 2007

Finally, here’s how to compare a number value against a property within an ActionForm: 8.5.2 Substring Matching The substring-matching tags take all the same arguments as the value-comparison tags. You compare the string specified by the value attribute to any of the comparison values you give it, specified by cookie, header, parameter, property, or name. Matching tags also have an additional location attribute that informs the tag where to start matching from (either “start” or “end”). In this example, the matchTag is being used to determine whether the request parameter action begins with the string “processLogin”: Processing Login…. If the location attribute is not specified, a match between the variable and the value may occur at any position within the variable string. 8.5.3 Redirecting and Forwarding The forwardand redirect tags within the Logic tag library might have been better suited to the HTML tag library. However, the fact that they are in the Logic tag library doesn’t make them any less valuable. In fact, combined with one of the other Logic tags, these two tags become extremely useful. The redirect tag is responsible for sending a redirect to the client’s browser, complete with URL- rewriting if the container supports it. Its attributes are consistent with the Struts HTML link tag. The base URL is calculated based on which of the following attributes you specify (you must specify exactly one of them): forward Use the value of this attribute as the name of a global ActionForwardto be looked up, and use the context-relative URI found there. href Use the value of this attribute unchanged.
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.

Affordable web design - redirect Render an HTTP redirect. The tags within

Friday, July 20th, 2007

redirect Render an HTTP redirect. The tags within the Logic tag library can be divided into four separate categories based on how they are used: Value comparison Substring matching Redirecting and forwarding Collection utilities This division into categories is done for the purpose of explanation. The tags are not packaged or arranged into these categories; they all belong to the Logic package. 8.5.1 Value Comparison The value-comparison tags print out the body of the tag if and only if the comparison evaluates to true. There are several different types of comparison tags that you can use, depending on your specific needs. Each of the value-comparison tags takes a value and compares it to the value of a comparison attribute. If the value given can be successfully converted to a number, a number comparison is performed; otherwise, a string comparison is performed. The comparison tags share the common attributes listed in Table 8-6. Table 8-6. Common attributes of the comparison tags Name Description name The name of a bean to use to compare against the value attribute. If the property attribute is used, the value is compared against the property of the bean, instead of the bean itself. parameterThe name of a request parameter to compare the value attribute against. property The variable to be compared is the property (of the bean specified by the name attribute) specified by this attribute. The property reference can be simple, nested, and/or indexed. scope The scope within which to search for the bean named by the name attribute. All scopes will be searched if not specified. value The constant value to which the variable, specified by another attribute(s) of this tag, will be compared. A few examples will help solidify how these comparison tags can be used. To check whether a particular request parameter is present, you can use the Logic present tag: To check whether a collection is empty before iterating over it, you can use the notEmpty tag:
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision J2ee Web Hosting services.

Web site optimization - Table 8-4. Attributes for the keyboard navigational support

Thursday, July 19th, 2007

Table 8-4. Attributes for the keyboard navigational support Attribute Description acesskey The keyboard character used to move focus immediately to this element. tabindex The tab order (ascending positive integers) for this element. 8.5 Logic Tags The Logic tag library contains tags that are useful for managing conditional generation of output text, looping over object collections for repetitive generation of output text, and application flow management. Table 8-5 lists the tags available within the Logic tag library. Table 8-5. Custom tags within the Logic tag library Tag name Description empty Evaluate the nested body content of this tag if the requested variable is either null or an empty string. equal Evaluate the nested body content of this tag if the requested variable is equal to the specified value. forward Forward control to the page specified by the ActionForward entry. greaterEqual Evaluate the nested body content of this tag if the requested variable is greater than or equal to the specified value. greaterThan Evaluate the nested body content of this tag if the requested variable is greater than the specified value. iterate Repeat the nested body content of this tag over a specified collection. lessEqual Evaluate the nested body content of this tag if the requested variable is less than or equal to the specified value. lessThan Evaluate the nested body content of this tag if the requested variable is less than the specified value. match Evaluate the nested body content of this tag if the specified value is an appropriate substring of the requested variable. messagesNotPresentGenerate the nested body content of this tag if the specified message is not present in this request. messagesPresent Generate the nested body content of this tag if the specified message is present in this request. notEmpty Evaluate the nested body content of this tag if the requested variable is neither null nor an empty string. notEqual Evaluate the nested body content of this tag if the requested variable is not equal to the specified value. notMatch Evaluate the nested body content of this tag if the specified value is not an appropriate substring of the requested variable. notPresent Generate the nested body content of this tag if the specified value is not present in this request. present Generate the nested body content of this tag if the specified value is present in this request.
We highly recommend you visit web and email hosting services if you need stable and cheap web hosting platform for your web applications.