Archive for October, 2007

Starting a web site - Table 14-4 lists the attributes for the put

Wednesday, October 31st, 2007

Table 14-4 lists the attributes for the put tag. Table 14-4. Attributes for the put tag Attribute name Description beanName The name of the bean used to retrieve the value. The bean is retrieved from the specified context, if any. Otherwise, the pageContext.findAttribute( )method is used. If beanProperty is specified, retrieve the value from the corresponding bean property. beanPropertyThe property name in the bean. If specified, the value is retrieved from this property. beanScope The scope used to search for the bean. If not specified, the pageContext.findAttribute( )method is used. The scope can be any JSP scope, “tile”, “component”, or “template”. In the three later cases, the bean is searched in the tile/component/template context. content Content that’s put into tile scope. This attribute is equivalent to the value attribute and was added for compatibility with the JSP template tags. direct How the content is handled: truemeans content is printed directly; false means content is included. false is the default. This is another way to specify content type. If direct=”true”, content is “string”; if direct=”false”, content is “page”. This attribute was added for compatibility with the JSP template tags. name The name of the attribute. role If the user is in the specified role, the tag is taken into account. Otherwise, the tag is skipped and the content is not written out. type The content type. Valid values are “string”, “page”, “template”, or “definition”. value The attribute value can be a String or an Object. The value can come from a direct assignment (value=”aValue”) or from a bean. One of value, content, or beanNamemust be present. 14.4.4 The putList Tag The putList tag creates a list that will be passed as an attribute to a tile. The list elements are added using the add tag. This tag can be used only inside the insertor definition tag. Table 14-5 lists the attribute for the putList tag. Table 14-5. Attribute for the putList tag Attribute name Description name The name of the List. This attribute is required.
If you are looking for cheap and quality webhost to host and run your website check Jboss Web Hosting services.

Best web hosting - page URL of the template/component to insert. Same

Tuesday, October 30th, 2007

page URL of the template/component to insert. Same as template. role The role to check before inserting this definition. If the role is not defined for the current user, the definition is not inserted. Checking is done at insertion time, not during the definition process. scope The variable scope in which the newly defined bean will be created. If not specified, the bean will be created in page scope. template A string representing the URL of a tile/component/template (a JSP page). The following fragment illustrates how to use the definition tag in a JSP page: A complete example is shown later, in Section 14.5.1 of this chapter. 14.4.3 The put Tag The puttag is used to pass attributes to a tile component. This tag can be used only inside the insertor definition tags. The value (or content) of the put tag is specified using the value attribute or the tag body. It is also possible to specify the type of the value: string Content is literally translated. pageor template Content is included from specified URL. Name is used as URL. definition Content comes from specified definition (from factory). Name is used as definition name. If the typeattribute is used, it is taken into account by the getor insert tags inside the inserted tile. If the type attribute is not specified, the content is untyped, unless it comes from a typed bean. Setting direct=”true” is equivalent to setting type=”string”.
Check Tomcat Web Hosting services for best quality webspace to host your web application.

Crystaltech web hosting - Only one of controllerUrlor controllerClass should be used.

Monday, October 29th, 2007

Only one of controllerUrlor controllerClass should be used. controllerClass The class type of a controller called immediately before the page is inserted. The controller is used to prepare data to be rendered by the inserted tile. Only one of controllerUrlor controllerClass should be used. The class must implement or extend one of the following: org.apache.struts.tiles.Controller, org.apache.struts.tiles.ControllerSupport, or org.apache.struts.action.Action. definition The name of the definition to insert. Definitions are defined in a centralized file. For now, only definitions from a factory can be inserted with this attribute. To insert a definition defined with the definition tag, use beanName=”". flush trueor false. If true, the current page output stream is flushed before tile insertion. ignore If this attribute is set to true and the attribute specified by the name does not exist, simply return without writing anything. The default value is false, which will cause a runtime exception to be thrown. name The name of an entity to insert. The search is done in this order: definition, attribute, then page. page A string representing the URI of a tile or template. The template, page, and component attributes have exactly the same behavior. role If the user is in the specified role, the tag is taken into account; otherwise, the tag is skipped and the content is not written out. template A string representing the URI of a tile or template. The template, page, and component attributes have exactly the same behavior. Several examples of the insert tag were shown earlier in this chapter. 14.4.2 The definition Tag The definition tag is used to create a tile (template) definition as a bean. The newly created bean will be saved under the specified id, in the requested scope. The definition tag has the same syntax as the insert tag. The new definition can extend a definition described in the definition factory (XML file) and may overload any previously defined parameters. Table 14-3 lists the attributes supported by the definition tag. Table 14-3. Attributes for the definition tag Attribute name Description extends The name of a parent definition that is used to initialize this new definition.The parent definition is searched in the definitions factory. id The name under which the newly created definition bean will be saved. This attribute is required.
From our experience, we can recommend PHP Web Hosting services, if you need affordable webhost to host and run your web application.

get Get the content from (Bulletproof web design) request scope that

Sunday, October 28th, 2007

get Get the content from request scope that was put there by a put tag. getAsString Render the value of the specified tile/component/template attribute to the current JspWriter. importAttribute Import a tile’s attribute into the specified context. initComponentDefinitionsInitialize a tile definitions factory. insert Insert a tiles component. put Put an attribute into a tile context. putList Declare a list that will be passed as an attribute. useAttribute Use an attribute value inside a page. 14.4.1 The insert Tag The insert tag is responsible for inserting content into a page. In a layout tile, the insert tag prescribes where the content will go using attribute values. In a regular, non-layout tile, the insert tag is used to retrieve a layout and allow content to be passed to the layout using put tags. Table 14-2 lists the attributes for the insert tag. Table 14-2. Attributes for the insert tag Attribute name Description attribute The name of an attribute in the current tile/component context. The value of this attribute is passed to the name attribute. beanName The name of the bean used as a value. The bean is retrieved from the specified context, if any. Otherwise, the pageContext.findAttribute( )method is used. If the beanProperty attribute is also specified, retrieve the value from the corresponding bean property. If the bean (or bean property value) is an instance of one of the Attribute classes (Direct, Instance, etc.), the insertion is done according to the class type. Otherwise, the toString( ) method is called on the bean, and the returned String is passed to the name attribute. beanProperty The name of the bean property. If specified, the value is retrieved from this property. beanScope The context scope the bean can be found within. If not specified, the pageContext.findAttribute( )method is used. The scope can be any JSP scope, component, or template. In the two latter cases, the bean is searched in the tile/component/template context. component A string representing the URI of a tile or template. The template, page, and component attributes have exactly the same behavior. controllerUrl The URL of a controller called immediately before the page is inserted. The URL usually denotes a Struts action. The controller (action) is used to prepare data to be rendered by the inserted tile.
We recommend cheap and reliable webhost to host and run your web applications: Coldfusion Web Hosting services.

themselves. In any case, you need to develop (Dedicated web hosting)

Saturday, October 27th, 2007

themselves. In any case, you need to develop the layout (or layouts) well ahead of any actual development. The default layout for the Storefront application was presented in Example 14-2. This layout will be used as an example throughout this chapter. 14.3.4 Passing Parameters to the Layout The layout tile shown in Example 14-2 is generic. It doesn’t know anything about the itemdetail.jsp content or any of the other pages, for that matter. This is intentional, as it allows us to reuse this layout for many pages. Instead of being hardcoded within the layout page, the content is supplied or “passed” as parameters to the layout page at runtime. Let’s look at the signin.jsp tile for the Storefront application, shown in Example 14-5. Example 14-5. The signin.jsp tile for the Storefront application <%@ taglib uri="/WEB-INF/tiles.tld" prefix="tiles" %> The purpose of the put tags in Example 14-5 is to supply the layout tile, which is specified in the enclosing insert tag, with content. The values of the name attributes in Example 14-5 (as in the other tiles shown in Examples Example 14-3 and Example 14-4) must match the ones that the layout tile is expecting. The insert tag optionally can include an attribute that will cause the tag to not write out anything when it can’t find a value for an expected attribute. By default, a runtime exception is thrown when an attribute has not been supplied. 14.4 The Tiles Tag Library This section introduces the JSP custom tags used by the Tiles framework. Table 14-1 lists the tags available to the framework. The tags are very similar to the ones provided in any template-based framework, but Tiles contains more functionality. Table 14-1. Tags within the Tiles tag library Tag name Description add Add an element to the surrounding list. definition Create a tile component definition.
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision J2ee Web Hosting services.

14.3.2 Using a Layout Tile In the Tiles (Web hosting compare)

Friday, October 26th, 2007

14.3.2 Using a Layout Tile In the Tiles world, a layout is what we have been referring to as a template. A layout serves the exact same purpose as a template that is, to assemble a group of tiles to specify the format of a page. Example 14-2 is, in fact, a Tiles layout. The syntax between Tiles and a template library like the one included with Struts is almost identical. The Tiles framework provides a superset of the functionality included with the standard Struts template tags defined by David Geary, but it takes the concept of templates even further by providing additional functionality. Layouts also are considered tiles. JSP pages and even entire applications can reuse layouts, and it’s common to build a library of layouts that are used in many different projects. The Tiles framework comes with several prebuilt layout tiles that you can reuse or modify as needed. The included layouts are: Classic layout Renders a header, left menu, body, and footer Columns layout Renders a list of tiles in multiple columns, each of which renders its tiles vertically stacked Center layout Renders a header, left tile, right tile, body, and footer Menu layout Renders a menu with links Tabs layout Renders several tiles in a tabs-like fashion Vertical box layout Renders a list of tiles in a vertical column Because one of the main goals of Tiles is reusability, you can reuse these layouts within your application with little or no modifications. You also have the freedom to customize the layouts in any way you need. 14.3.3 Planning Your Layout It’s very important that you plan your layout requirements ahead of time. Trying to decide how your site is going to look after it’s already built is definitely not the right approach. This decision is typically made by a human factors team, product management, or possibly the web developers
We recommend high quality webhost to host and run your jsp application: christian web host services.

Dynamic page (Disney web site) construction and loading Screen

Thursday, October 25th, 2007

Dynamic page construction and loading Screen definitions Support for tile and layout reuse Support for internationalization Support for multiple channels There has been a Template tag library within the Struts framework for quite some time. These tags allow you to use a very basic templating approach to assemble your JSP pages in a web application. Although these tags are helpful in separating the content for a web application from its prescribed layout, the Tiles framework goes much further and actually provides a superset of the Template tag library’s behavior, as well as many other features. The Tiles framework was previously called Components, but the name was changed because that term is so overused. The Tiles documentation and source code still make reference to the old name in some places. Cedric Dumoulin created the Tiles framework to extend the concept of templates and provide developers with more flexibility and freedom when creating web applications built with JSP technology. The content for the web applications is still driven by JSP pages and JavaBeans. However, the layout is specified within a separate JSP page or, as we’ll see later, in an XML file. 14.3.1 What Is a Tile? A tile is an area or region within a web page. A page can consist of just one region or be broken up into several regions. Figure 14-1 illustrates an example from the Storefront application. Figure 14-1. The regions of the Storefront application A JSP page is typically made of several regions, or tiles. There’s nothing too special about the page, other than the fact that it’s designed to be used with the Tiles framework and makes use of the Tiles tag library. The most important aspect of a tile is that it is reusable. This is true for layouts as well as body content. Unlike most JSP pages, tile components are reused within an application and possibly across different applications. Other than that, there’s nothing that complicated about a tile. In fact, most of the examples we’ve seen so far can be classified as tiles, including Example 14-2 through Example 14-4.
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision J2ee Web Hosting services.

Within the plug-in element, you can specify one (Make web site)

Thursday, October 25th, 2007

Within the plug-in element, you can specify one or more set-property elements to pass additional parameters to the Plugin class. The definitions-config initialization parameter specifies the XML file or files containing Tile definitions. If multiple filenames are used, they must be comma-separated. The definitions-debugparameter specifies the debug level. The allowed values are: 0 No debug information is written out. 1 Partial debug information is provided. 2 Full debug information is provided. The default value is 0. The definitions-parser-details parameter indicates the required level of debugging information while the definition files are being parsed. This value is passed to the Commons Digester. The allowed values are the same as those for the definitions-debug parameter. The default value is 0. The definitions-parser-validate parameter specifies whether the parser should validate the Tiles configuration file. The allowed values are true and false. The default is true. There is an additional parameter, not shown, called definitions-factory-class. You can create a custom definitions factory and supply the class name here. The default is org.apache.struts.tiles.xmlDefinition.I18NfactorySet. 14.3 Overview of Tiles The Tiles framework provides a templating mechanism that allows you to separate the responsibilities of layout from those of content. As with the templates described earlier in this chapter, you have the ability to establish a layout and dynamically insert the contents of your pages into that layout at runtime. This is a powerful mechanism if you need to customize your site based on such things as internationalization, user preferences, or just the look-and-feel changes that occur in every web application sooner or later. The Tiles framework provides the following features: Template capabilities
If you are searching for cheap webhost for your web application, please visit MySQL5 Web Hosting services.

Don’t add the tiles.jar file to the classpath (Web hosting asp)

Wednesday, October 24th, 2007

Don’t add the tiles.jar file to the classpath of your servlet container in an attempt to avoid placing it in the WEB-INF/lib directory of each individual web application. Doing so will cause s to be thrown. You should put the tiles-config.dtd file in the WEB-INF directory, too. This DTD is used to validate Tiles definition files, which we’ll discuss later in this chapter. 14.2.3 Adding the Tiles Tag Library As with any other JSP tag library, you must add the Tiles library to the web application deployment descriptor before you can use it. Add the following taglibelement to the web.xml file: /WEB-INF/tiles.tld /WEB-INF/tiles.tld There should already be taglib elements present if you are using any of the standard Struts tag libraries. Each page that needs to use the Tiles tag library must include the following line at the top: <%@ taglib uri="/WEB-INF/tiles.tld" prefix="tiles" %> 14.2.4 Configuring Tiles to Work with Struts The Tiles framework can be used with or without Struts. Depending on how you use it, there are several options for configuring it for a web application. Because this book is about Struts, we’ll focus on how to bind it to a Struts application. With earlier versions of the Tiles framework, you had to configure a special ActionServlet called ActionComponentServlet in the web.xml file. It was also necessary to configure a special RequestProcessor in the Struts controller element. This is no longer true a Tiles plug-in is now available that will take care of all the initialization. The Tiles plug-in is really necessary only if you are planning on using Tiles definitions. It is possible to use the Tiles libraries with Struts without configuring the plug-in. However, it doesn’t hurt to configure it, and it may save you time later if you decide to use definitions. To add the Tiles plug-in to a Struts application, add the following plug-in element to the Struts configuration file:

Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.

Example 14-4. The itemdetail.jsp page for the Storefront (Geocities web hosting)

Tuesday, October 23rd, 2007

Example 14-4. The itemdetail.jsp page for the Storefront application <%@ taglib uri="/WEB-INF/tiles.tld" prefix="tiles" %> The only difference between the index.jsp page in Example 14-3 and the itemdetail.jsp page in Example 14-4 is the content supplied by the body-content attribute. If you are still not convinced of the value of using templates, notice that the index.jsp and itemdetail.jsp pages in Example 14-3 and Example 14-4 do not specify anything about how the content should be laid out. They both reference the storefrontDefaultLayout.jsp file, which has sole responsibility for displaying the content in a prescribed format. If we want to change the layout of the site, we have to modify only the storefrontDefaultLayout.jsp file. 14.2 Installing and Configuring Tiles Before you can use the Tiles framework, you must ensure that it’s installed and properly configured within your web container. The Tiles framework is not dependent on any specific container. You will need to obtain the required files and ensure that they are placed into their proper directories within the web application. 14.2.1 Downloading Tiles The Tiles framework is included with the Struts distribution. It previously was included in the contrib folder, but it is now part of the core distribution. You also can find the latest source and binary distribution, as well as other useful information, at http://www.lifl.fr/~dumoulin/tiles/index.html. 14.2.2 Installing the Required JARs and Misc Files The first step is to install the required files. For Tiles, the following files must be located in the WEBINF/lib directory: tiles.jar commons-digester.jar commons-beanutils.jar commons-collections.jar commons-logging.jar All of these binaries should already be present if you are using Struts. You will also need to install the Tiles TLD file, tiles.tld, in the WEB-INF directory for the application.
We recommend high quality webhost to host and run your jsp application: christian web host services.