Monday, July 26, 2010

Some knowledge of JSP syntax



1.JSP instructions

Use JSP directives (including) to specify a scripting language used, Servlet implementation interface, Servlet extension classes, Servlet import packages. The general command syntax of JSP form:. One effective instruction, called:

(1) language: documents used in the scripting language. At this point the Java programming language, Java is only valid values and default values. The Directive on the whole document. When the repeated use of the instruction, only the first time to be effective. Examples are as follows:.

(2) Method: from the embedded Java code (scriptlet) generated method name. Generated code will be designated the main method name. The default is service. When the repeated use of the instruction, only the first time to be effective. Examples are as follows:.

(3) Import: Servlet into the Java language package name or class name list, the list is separated by commas. In the JSP file, you can specify the command to import many different packages. Examples are as follows:.

(4) content_type: MIME type of response generated. The default value is text / html. When the repeated use of the instruction, only the first time to be effective. The directive can be used to specify the page in which the character set encoding. Examples are as follows:.

(5) mplements: Servlet implementation used to generate a list of Java language interfaces, the list is separated by commas. In a JSP file using the command several times to achieve different interfaces. Examples are as follows:.

(6) extends: Servlet extended Java language class name. Class must be effective, and can not be a Servlet class. The directive effect on the entire JSP file. When the repeated use of the instruction, only the first time to be effective. Examples are as follows:.

2.class-wide variables and methods

Use

Markers to illustrate Servlet class class-wide variables and class-wide approach. General syntax is as follows:




Attribute runat = server is required, it indicates that the tag is used for server-side processing. Specified class-wide variables and methods example are as follows:




3. Access JavaBean

JavaBean JSP syntax support enables you to reuse components through the Web site. JavaBean class file or can be serialized Bean, Servlet may also be dynamically generated. Please use the tags to create a Bean instance, to make the JSP file from anywhere can access the instance. Tag syntax is:



One of the attributes and their meanings are as follows:

(1) name: for in the appropriate range (specified by the scope attribute) within the look Bean's name. For example, this may be used to store Bean's session (session) key value. The value is case-sensitive.

(2) varname: JSP file is used in reference Bean name anywhere. This property is optional. The default value name attribute value. The value is case-sensitive.

(3) type: Bean class file name. The code name used to description Bean instance. The default value of Object type. The value is case-sensitive.

(4) Introspect: When the value is true, JSP processor checks all the request attributes, and call and request attributes set attribute method of matching sets (the property is passed in the BeanInfo). The default value of the property is.

(5) BeanName: Bean's. Class file name, Bean Bean package name or contains the serial of file (. Ser file) of the file name. (The name is an instance of the program to the Bean). Only when the Bean is not specified range, and attribute is set to be created only when the use of the property. The value is case-sensitive. File path to the Java application server class path specified, unless the file applicationserver_rootservlets directory.

(6) Create: When the value is true, if the processor is not found within the specified Bean, the JSP will create a Bean instance. The default value is true.

(7) Scope: Bean's life cycle. This property is optional, its default value is request. Valid values are:

request - the Servlet request to Bean set the context, the use of the Servlet API JSP API is described in notes

With the JSP file. If the Bean is not part of the request context, it will create the Bean, and stores it in the context of the request, unless the create attribute is set to No.

session - if the current dialogue exists Bean, the Bean has been reused. If there is no Bean, and create a property set

Is yes, then it has been created and stored as part of the session.

userprofile - retrieval by the Servlet request object, shape into the specified type, and for introspection user Jian Yaobiao file. (In

IBM WebShere application server, the default type com.ibm.servlet.personalization.userprofile.UserProfile).

(8) param: list of attributes and value pairs. Bean property is automatically set using introspection. Bean instantiated only when in the best attribute set.

In addition to using attributes to set Bean properties, but also can use the other three methods: first, the request contains the Bean's Web page (JSP file) of the URL, specify the query parameters. Must be introspective property set to "yes." The examples are as follows: http://www.myserver.com/signon.jsp?name=jones&password=d13x, Bean property which is set to star jones. The second method, the property designated as submitted by the HTML tag parameters. Mothod property must be set to post. The action attribute set to call the JSP Bean file URL. Introspect attribute must be set to "yes." The examples are as follows:




The third method is to use the JSP syntax to set Bean properties.

In the specified tag, you can anywhere in the JSP file to access Bean. There are three ways to access Bean properties: use JSP scriptlet, JSP expression is used, use the tag (as variable data, HTML template syntax described). Please refer to the JSP example (DisplayData.jsp file) to get the three access methods for each method the sample Bean.

4. Directly into the Java code (scriptlet)

JSP documents can be directly embedded into any valid markers of Java language code. This embedded code is called scriptlet. If no method directive, the generated code will be the main service methods. The scriptlet for Servlet can use a predefined set of variables, the set of variables consistent with the basic Servlet, output and input categories:

(1) request: a request by the javax.servlet.http.HttpServletRequest class defines the Servlet

(2) responses: Servlet response defined by the javax.servlet.http.HttpServletRequest class

(3) out: the definition of the output from the java.io.PrintWriter class transcription program

(4) in: defined by the java.io.BufferedReader input reader class

The examples are as follows:



5. Variable data, HTML template syntax

When the page is returned to the browser, application server, HTML template syntax so you can put HTML page variable field, and to Servlet and JavaBean can be used to replace the database the value of the dynamic variables. This feature is an IBM extension JSP, it makes reference to the variable data becomes very easy. The syntax is only for JSP files. HTML template syntax, including:

Basic HTML template syntax;

Alternative HTML template syntax;

Tag.

These tags by HTML authoring tools are designed to deliver interoperability mark. Each tag has a corresponding end tag. Each tag is case-sensitive, some of their properties are case-sensitive. IBM WebSphere Studio allows developers to JSP file to include the HTML template syntax easier.

(1) basic HTML template syntax

Tag is used to specify variable field of the basic mark. General syntax is:



One of the attributes and their meanings are as follows:

requestparm: To request a visit within the parameters of the object. The property is sub-case, and can not be used with Bean and property attributes.

Requestattr: To request a visit to the property within the object. Property should be set using setAttribute method. The property is sub-case, and can not be used with Bean and property attributes.

Bean: the marker described in the JavaBean JSP file name. Please refer to the JavaBean to get the tags to access the explanation. The attribute value is case-sensitive. When the specified Bean property, but did not specify the property attribute, will be used in replacement of the complete Bean. For example, if a type of String Bean and did not specify the property value string will be replaced.

Property: Access replacement Bean property. The value of the property is sub-case, and is the property of the independent site name. The property can not be used in conjunction with the requestparm property.

Default: When the Bean attribute value is empty, display an optional string. If the string contains multiple words, then the string must be included in a pair of double quotes (eg "HelpDesk number"). The attribute value is case-sensitive. If you do not specify a value, then when the property value is empty, replace with an empty string.

Examples of the basic JSP syntax is as follows:



In most cases, property value of the property is the property name. However, you can specify the property attribute to access the properties of the whole format of a property (a property). The whole format is also available to you to select items of a specified index property index. The optional index can be a constant (for example 2) or set the HTML tags as described in the repeated index. All formats use the property tag example is as follows:



(2) to replace HTML template syntax

HTML standard does not allow HTML tags embedded in HTML tags. Thus, HTML tags can not be embedded in another tag. Instead, please use the alternative HTML template syntax. To use the alternative syntax:

Please use and to include HTML tags in the tag that alternative content.

Bean and property attributes specified:

Bean and attributes to specify features, please use the following format: $ (bean = b property = p default = d), where b, p and d

As described in the value of basic grammar.

To specify requestparm property, please use the following format: $ (requestparm = r default = d), where r and d as

Describe the basic syntax of the value.

To specify requestattr property, please use the following format: $ (requestattr = r default = d), where r and d, as described

The value of the basic JSP syntax.

Alternative HTML template syntax examples are as follows:

Show map of city

(3) mark

Tag syntax is:



Of which:

index: is used to identify the duplicate data block an optional name. The value is case-sensitive.

Start: duplicate data blocks for the start of an optional index value. The default value is 0.

End: duplicate data block for the end of an optional index value. Maximum value is 2,147,483,647. If the end of the property value of the property value is less than the beginning, the end attribute is ignored.

The following examples 1,2 and 3 show how to use the mark. If all of the index properties have 300 or fewer elements, these examples will produce the same output. If you have more than 300 elements, Example 1 and Example 2 will show all the elements, while Example 3 will only show the first 300 elements. Example 1 with the default start and end of the index shows the implicit index: using the minimum number of bean indexed properties restricts the number of cycle to repeat.





Example 2 shows the index, starting index and ending index:


Example 3 starting with the implicit explicit index shows the index and end index. Although the index attribute is specified, the index still had the property of the city on the implicit index, because without (i).





Data blocks can be nested. Separate index for each block of data. The ability to cross the staggered two bean properties or properties with sub-attributes is very useful. In the example, the two data blocks nested, to show the user shopping cart with a compressed disc of each song list.






6. Variable data Java expression

When dealing with JSP files, to specify the decomposition of a Java language expression, use the JSP expression tags. The expression is evaluated and converted into a string, and display them. Primitive types such as int and float are automatically converted to string representation. In this example, foo is



Translation Welcome.

When access to JSP files, text: Translation Welcome Hello.

Some knowledge of the JSP syntax introduced here.









Recommended links:



Mars text input text input V2.7.2 version of EASY Fun



Baidu Key words after switching price inflation Phoenix Nest 8 times



Facebook registration. Cn DOMAIN name eagerly want to move into China



Ramada Pearl Hotel



Tencent in 2007, Beijing ad: tech conference on the show "Tencent MIND



Wizard Religion



how to convert Flv to 3gp



Convert flv to 3gp



Tyson Foods to ELIMINATE non-value-added production processes



avi to ipod TOUCH



Games Simulation Infomation



Photoshop To Create Beauty Facial Skin Texture



Terminal And Telnet Clients introduction



REVIEW Password Managers



Convert Mkv To Avi Free



Wednesday, July 21, 2010

Dual disc engraved with me


Author: Zhou Dongfei

Do not know if you have not noticed, a lot of study and class are often advertised CD-ROM, CD-ROM that call themselves players, computer "dual-use CD-ROM." Wonderful it, this CD-ROM in real life but very useful, want to learn a moment? Follow me!

Hardware Requirements I do not have winded the bar, if you do not have burners, this article can first cut, left to be run. Software recommended Nero5, in the burning area does not know it almost does not, you can easily download to its Chinese version.

"Dual Disc" in substance, is a VCD compatible format and common data formats of mixed mode. Most burning software have given a "music CD with the data" mixed mode, but no "VCD and data" mixed mode. It does not matter, we burn a normal VCD from the beginning. Assumptions needed to burn MPG files and data files are ready to pay attention to the size of the two combined can not exceed 650MB. Start Nero5, into the burn VCD interface (Figure 1). In order to facilitate the following presentation, we assume that: 鈶?the hard disk data area, 鈶?for the CD-ROM data area, 鈶?for the video track area.



From the right side of "hard data area" to find you want to burn the MPG file, drag and drop by the order to "video track area", be careful not to put "CD-ROM data area". A new document will be out of the window, on the MPG file to verify treatment. Disposed of, the top left window, right-click "New" CD-ROM icon in the pop-up menu, select "Properties", on the detailed properties of the disc VCD set. For example, you can create a beautiful VCD Start menu.

Add VCD set is completed, we can start adding data files. When I first burn a VCD with Nero, I use it specifically related to a window to the folder listed is incorrect, who cares what these folders? In fact, this is the Nero of the Superman of the Department. If you can not see CD-ROM content, which will not be able to add data files. From "hard disk data area" to choose your data file ready, drop them to the "CD-ROM Data Area" in the. Note that one should not put "video track area", the second is not to put "CD-ROM data area" VCD relevant folder. Data files can be a good multimedia presentation documents the development, but also can be any common data file. If you need to have self-running CD-ROM features, you can also write a autorun.inf file on the CD-ROM root directory. These are not elaborate, please refer to related information.

Well, choosing a burner, start burning it. To ensure that the video image quality, the best use of low-speed recording. Upon completion of the first try on the DVD machine, and then back into the computer CD-ROM drive to try, is not a modern discovery of the "dual-use CD-ROM?"






相关链接:



McNealy: Sun China's embrace open source



Simple Business



JSP tag Library analysis



C language library function (K class letters)



Bliss CD Sound MP2 to OGG RIPPING



SuperBurner DVD to Flash



mov video



MP3 Burner Plus



Blackberry Video Format



convert avi TO wmv



Chrome OS Is Outdated? Look Jolicloud!



Adventure And Roleplay Reviews



Convert Aac To Mp3



e-cology in the Pan Micro Series 22



Picked Printer



Expert Backup And Restore



Thursday, July 1, 2010

Youtube to Xbox 360 Professional

Hot popluar youtube video Converter + download + player tool. With YouTube tool you can also convert downloaded YouTube videos to a format compatible with your favorite portable device; including - iPod Video, iPod Touch, iPod Nano, iPhone, Zune, PSP, as well as video capable MP3 players, video capable mobile phones, and Pocket PC, And finally... YouTube tool's embedded player will allow you to watch all your favorite YouTube videos off-line. So now you can enjoy any .flv and .swf videos anytime!
Easily Convert all popular video formats. Provides the highest speed to download YouTube video. Support unlimited simultaneous downloading tasks. Supports auto-name your downloaded video title as the YoutTube page shows. Offers you the most convenient task management and the easiest control capability. About Conversion Features. - is the most powerful YouTube assistant on the planet.



Recommand Link:



Video to GIF Converter



Youtube Movie to Treo Pro



Articles about Access Control



Picked Recreation



Christmasgift VOB to AVI



Youtube to DVD Today



.Tansee IPod Transfer II Platinum



EVALUATE Online Gaming



DVD Clipper And Joiner



2008 Best DVD to Zune Converter



How to convert DVD to Archos 5 IT



Happiness DVD 3GPP to RM



wmv



Youtube Movie to M4V Mixer



WorldCup DVD to PSP



Lohan DVD Copy



Merry CDA MP2 AMR To CD-R Editor