JBuilder2005 Practical JSP login page (1)

Source: Internet
Author: User
Tags html form html tags dreamweaver
js| page file->new...->web-> Double-click the JSP icon to eject the Create JSP Wizard dialog box, as shown in the following illustration:


Figure 3 Creating login.jsp with wizards
· 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.

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: 9. --logged in user-- Bloomer Baoshu tooth vertical teeth
14. Password: 16.

-</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.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.