JavaWeb_20231028
https://jakarta.ee/specifications/tags/3.0/jakarta-tags-spec-3.0#multiple-tag-libraries
<dependency> <groupId>jakarta.servlet.jsp.jstl</groupId> <artifactId>jakarta.servlet.jsp.jstl-api</artifactId> <version>3.0.0</version> </dependency> <dependency> <groupId>org.glassfish.web</groupId> <artifactId>jakarta.servlet.jsp.jstl</artifactId> <version>3.0.0</version> </dependency>
-- 刪除訪客留言表
drop table if exists guestbook;
-- 建立訪客留言表
create table if not exists guestbook(
id int not null auto_increment,
username varchar(50) not null,
message varchar(255) not null,
createtime timestamp default current_timestamp,
primary key(id)
);
-- 建立訪客留言表預設資料
insert into guestbook(username, message) values('John', 'Hello 1');
insert into guestbook(username, message) values('Mary', 'Welcome 2');
insert into guestbook(username, message) values('海倫', '大家好 3');
-- 分頁 view
USE `demo`;
CREATE OR REPLACE VIEW `guestbook_page_info` AS
select 10 as records_of_page,
count(*) as count,
ceil(count(*)/10) as max_page
from guestbook;