By double-clicking the JSP icon, file->new...->web-> The Create JSP Wizard dialog box, as shown in Figure 3 below:
· Web module: If there is more than one Web module in a project, you can specify the Web modules to which the JSP will join, because there is only one webmodule in our project, so the wizard defaults to Webmodule.
· Name: Type the JSP filename, you can type the. jsp suffix, or you can type login directly without writing a suffix.
Figure 3 Creating login.jsp with wizards
After the Generate sample bean option is checked, JBuilder generates an example bean and introduces the bean in the JSP. For starters, this option allows you to see how the JSP references a bean, and the Generate Error page option automatically creates a companion error-handling JSP file for the JSP, which we do not select.
Click Finish to create a login.jsp,login.jsp file appears in the compiler for the content pane, as shown in the following illustration:
Figure 4 The JSP file created by the wizard
The JSP compilation window has a vertical bar on both sides that can be controlled by and buttons, and the left column is a panel that places JSP tags and HTML tags, and can be dragged into the JSP file in the same way as the visual UI designer, as shown above, We select the HTML tab of the form from the panel and place it in the login.jsp file.
The right vertical bar is the property compiler for the label of the current cursor in the JSP file, as shown in the following illustration:
Figure 5 Setting the JSP Tag Property editor
The property editor is dynamic, and the cursor moves to a different label, and the property editor displays all of the properties that the label can set. As the corresponding in the figure above is the HTML form tag's property editor, we set its Action property to switch.jsp, specifying that the request data be sent by post.
We provide a user name pull box, a password entry box, and a login submit button in login.jsp, with the following code:
Code Listing 4 login.jsp
1. <% @page contenttype= "text/html; CHARSET=GBK "%>
2. The 3. The 4. <title> Login </title>
5. The 6. <body bgcolor= "#ffffff"
7. Form Name= "Form 1" method= "POST" action= "switch.jsp"
8. User name: <select name= "UserId" >
9. <option value= "" selected>--logged in user--</option>
<option value= "100000" > Bloomer </option>
<option value= "100001" > Baoshu tooth </option>
<option value= "100002" > vertical teeth </option>
</select>
14. Password: <input name= "password" type= "password"
<input type= "Submit" name= "submit" value= "Login"
16. </Form
-</body>
A. A form label represents a form in a Web page, which can contain multiple components that are processed by a JSP file specified by the HTTP protocol to the action attribute when the Web page form is submitted. The form's data is typically sent as post, and post is sent in a way that has no limits on the amount of data and is more secure.
The login.jsp effect page is shown in the following illustration:
Figure 6 Login.jsp Entry page
Practical experience:
The JSP file code contains both static and dynamic parts, that is, part of the HTML code, and the other part is the JSP tag and the Scriptlet code. JSP is generally dynamic logic of the Web page, JBuilder JSP tags and scriptlet These dynamic code part of the support is very good, you can use Codeinsight and taginsight tools such as fast and correct coding, but also can be compiled to debug JSP. In JSP static HTML code writing and visual design, JBuilder is powerless, Dreamweaver in static code and visual design is significantly better than JBuilder.
The complexity of things to promote the division of labor, the fine division of Labor to promote professional development, in the preparation of JSP, not once you have jbuilder have no request. Han Xinshan, Ho Hoshan, if you can combine Dreamweaver and JBuilder, with Dreamweaver development JSP visualization part, with JBuilder development JSP dynamic code part, both complementary have no, complement each other, JSP development work will become more flowing.