Using JSTL to realize rapid development of JSP application

Source: Internet
Author: User
Tags php and mysql database tomcat

In this article, I'll introduce a flexible and interesting technique based on JSP, that's JSTL. Jstl is all called the Java Server Pages Standard Tag Library. Although JSP has become very popular, but jstl in the SQL database based on the simple, rapid development of the front and back is not widely used. Once you get to know Jstl, you will learn about its advantages and find that it has been applied to many aspects of your day-to-day work as a programmer. I assume that you are familiar with HTML, understand basic SQL statements, and the basics of JSP. Because the following content involves this knowledge.

Jstl is a standardized collection of tag libraries that supports iterations, conditions, parsing of XML documents, internationalization, and the ability to interact with the database using SQL. At first, the JSTL specification has been developed by the JSR #52, organized by JCP (Java Community process program), "JCP shoulder the brunt of the development of Java Technology"-as the official web site evaluates. JCP as an open organization, he also absorbs both formal and informal members. JCP has played an important leading role in the formation and development of Java technical specifications. Jstl mainly includes four basic parts of the tag library: Core,xml, internationalization, and support for SQL. Since this article is primarily based on the SQL part of the application to quickly understand jstl, so our article only describes the core and SQL Tag library Some of the basic features.

The technology is simple and powerful enough to be high with PHP and ColdFusion. He has the ability to expand Java applications, not just for large, scalable Web applications, but for Web programs with simple home pages. This allows you to avoid the integration of XML that is often considered and the connection to the database when you build the site. As I mentioned earlier, the key point of jstl is simplicity and ease of use. And that is, Jstl is built on JSP, and he allows us to use all the Java technology, which we need to remember.

Before we start, we need to figure out how to run Jstl. Because it's based on JSP technology, we need a container that compiles the JSP, where we use a free JSP container: TOMCAT (http://jakarta.apache.org/ tomcat/index.html). How to install this product is beyond the scope of this article. There is no doubt that this software PRODUCT is now widely available, and there are many documentation on how to install it. This assumes that you have installed and successfully configured this container, you only need to install JSTL to run the required files, it can download from here http://jakarta.apache.org/taglibs/doc/standard-doc/ Intro.html you don't need to really install it, just take one of those. The jar file is included in the Web-inf/lib directory of your application, and I'll talk specifically about what to do later.

Because we're running a program on a database that supports standard SQL, you need to have a database installed on your computer. There are many types of databases, and I chose MySQL here. The reason why I chose him is that first, we need to demonstrate JSTL's role in constructing a simple and fast application domain, while comparing it to the Php+mysql, which has been in the dominant position in this field; 2nd, that's MySQL is free to download and contains a JDBC driver for Java. In short, in order to use the following example, you need to download a MySQL server (http://www.mysql.com/products/mysql/index.html; MySQL connector/j jdbc driver http://www.mysql.com/products/connector-j/index.html and MySQL control center http:// www.mysql.com/products/connector-j/index.html), this product can make it very easy for you to manipulate MySQL database files. After all the downloads are complete, you will need to install MySQL and MySQL control Center. There is also the MySQL JDBC driver that needs to be placed in the/web-inf/lib directory in your WEB application.

Before creating the program code, you need to create and fill in the database table. The topic of this article is also quite extensive, how the specific operation is beyond the scope of this article. Here I recommend a visual management tool that we mentioned above MySQL control Center. You can use him to create a test user to run a program, a database, and create a test table and fill out a few records. About login name and password database name these configuration environment parameters, you should remember them, later need to apply to our code.

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.