今天进行了Javaweb连接HBASE实现增查的任务测试
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="layui/css/layui.css">
<script src="layui/layui.js"></script>
<title>重大技术征集</title>
<base href="http://localhost:8080/tech/">
<style type="text/css">
</style>
</head>
<body>
<div class="layui-layout layui-layout-admin">
<div class="layui-header">
<div class="layui-logo layui-hide-xs layui-bg-green">河北省重大技术征集系统</div>
<!-- 头部区域(可配合layui 已有的水平导航) -->
<ul class="layui-nav layui-layout-left">
<!-- 移动端显示 -->
<li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-header-event="menuLeft">
<i class="layui-icon layui-icon-spread-left"></i>
</li>
<li class="layui-nav-item layui-hide-xs"><a href=""></a></li>
<li class="layui-nav-item layui-hide-xs"><a href=""></a></li>
<li class="layui-nav-item layui-hide-xs"><a href=""></a></li>
<li class="layui-nav-item">
<a href="javascript:;"></a>
<dl class="layui-nav-child">
<dd><a href=""></a></dd>
<dd><a href=""></a></dd>
<dd><a href=""></a></dd>
</dl>
</li>
</ul>
<ul class="layui-nav layui-layout-right">
<li class="layui-nav-item layui-hide layui-show-md-inline-block">
<a href="javascript:;">
<img src="//tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg" class="layui-nav-img">
Rensaihang
</a>
<dl class="layui-nav-child">
<dd><a href="">Your Profile</a></dd>
<dd><a href="">Settings</a></dd>
<dd><a href="">Sign out</a></dd>
</dl>
</li>
<li class="layui-nav-item" lay-header-event="menuRight" lay-unselect>
<a href="javascript:;">
<i class="layui-icon layui-icon-more-vertical"></i>
</a>
</li>
</ul>
</div>
<div class="layui-side layui-bg-black">
<div class="layui-side-scroll">
<!-- 左侧导航区域(可配合layui已有的垂直导航) -->
<ul class="layui-nav layui-nav-tree" lay-filter="test">
<li class="layui-nav-item layui-nav-itemed">
<a class="" href="javascript:;">技术需求管理</a>
<dl class="layui-nav-child">
<dd><a href="index.jsp">添加</a></dd>
<dd><a href="query.jsp">查询</a></dd>
<dd><a href="">修改</a></dd>
<dd><a href=""></a></dd>
</dl>
</li>
<li class="layui-nav-item">
<a href="javascript:;"></a>
<dl class="layui-nav-child">
<dd><a href="javascript:;"></a></dd>
<dd><a href="javascript:;"></a></dd>
<dd><a href=""></a></dd>
</dl>
</li>
<li class="layui-nav-item"><a href="javascript:;"></a></li>
<li class="layui-nav-item"><a href=""></a></li>
</ul>
</div>
</div>
<div class="layui-body">
<!-- 内容主体区域 -->
<div style="padding: 15px;">
<form action="techServlet?action=add" class="layui-form" method="post">
<div class="layui-form-item">
<label class="layui-form-label">*机构全称</label>
<div class="layui-input-inline">
<input type="text" name="jgmc" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
</div>
<label class="layui-form-label">归口管理部门</label>
<div class="layui-input-inline">
<input type="text" name="gkglbm" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">通信地址</label>
<div class="layui-input-inline">
<input type="text" name="txdz" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
</div>
<label class="layui-form-label">所在地域</label>
<div class="layui-input-inline">
<input type="text" name="szdy" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">网址</label>
<div class="layui-input-inline">
<input type="text" name="dwwz" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
</div>
<label class="layui-form-label">电子邮箱</label>
<div class="layui-input-inline">
<input type="text" name="dzyx" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">邮政编码</label>
<div class="layui-input-inline">
<input type="text" name="yzbm" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
</div>
<label class="layui-form-label">法人代表</label>
<div class="layui-input-inline">
<input type="text" name="frdb" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">联系人</label>
<div class="layui-input-inline">
<input type="text" name="lxr" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">固定电话</label>
<div class="layui-input-inline">
<input type="text" name="gddh" class="layui-input">
</div>
<label class="layui-form-label">移动电话</label>
<div class="layui-input-inline">
<input type="text" name="yddh" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">传真</label>
<div class="layui-input-block">
<input type="text" name="cz" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">机构属性</label>
<div class="layui-input-block">
<input type="radio" name="jgsx" value="企业" title="企业">
<input type="radio" name="jgsx" value="高等院校" title="高等院校">
<input type="radio" name="jgsx" value="研究机构" title="研究机构">
<input type="radio" name="jgsx" value="其他" title="其他">
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">机构简介</label>
<div class="layui-input-block">
<textarea name="jgjj" placeholder="机构简介(单位基本情况,研究基础等,限500字)" class="layui-textarea"></textarea>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">技术需求名称</label>
<div class="layui-input-block">
<input type="text" name="jsxqmc" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button type="submit" class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
</div>
</div>
<script>
//Demo
layui.use('form', function(){
var form = layui.form;
//提交
form.on('submit(formDemo)', function(data){
});
});
</script>
<div class="layui-footer">
<!-- 底部固定区域 -->
请认真填写表单
</div>
</div>
<script>
//JS
layui.use(['element', 'layer', 'util'], function(){
var element = layui.element
,layer = layui.layer
,util = layui.util
,$ = layui.$;
//头部事件
util.event('lay-header-event', {
//左侧菜单事件
menuLeft: function(othis){
layer.msg('展开左侧菜单的操作', {icon: 0});
}
,menuRight: function(){
layer.open({
type: 1
,content: '<div style="padding: 15px;">处理右侧面板的操作</div>'
,area: ['260px', '100%']
,offset: 'rt' //右上角
,anim: 5
,shadeClose: true
});
}
});
});
</script>
</body>
</html>
<%@ page import="bean.Pojo" %>
<%@ page import="java.util.ArrayList" %>
Created by IntelliJ IDEA.
User: 15251
Date: 2022/9/22
Time: 10:17
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<link rel="stylesheet" href="layui/css/layui.css">
<script src="layui/layui.js"></script>
<title>重大技术征集</title>
<base href="http://localhost:8080/tech/">
<style type="text/css">
</style>
</head>
<body>
<div class="layui-layout layui-layout-admin">
<div class="layui-header">
<div class="layui-logo layui-hide-xs layui-bg-green">河北省重大技术征集系统</div>
<!-- 头部区域(可配合layui 已有的水平导航) -->
<ul class="layui-nav layui-layout-left">
<!-- 移动端显示 -->
<li class="layui-nav-item layui-show-xs-inline-block layui-hide-sm" lay-header-event="menuLeft">
<i class="layui-icon layui-icon-spread-left"></i>
</li>
<li class="layui-nav-item layui-hide-xs"><a href=""></a></li>
<li class="layui-nav-item layui-hide-xs"><a href=""></a></li>
<li class="layui-nav-item layui-hide-xs"><a href=""></a></li>
<li class="layui-nav-item">
<a href="javascript:;"></a>
<dl class="layui-nav-child">
<dd><a href=""></a></dd>
<dd><a href=""></a></dd>
<dd><a href=""></a></dd>
</dl>
</li>
</ul>
<ul class="layui-nav layui-layout-right">
<li class="layui-nav-item layui-hide layui-show-md-inline-block">
<a href="javascript:;">
<img src="//tva1.sinaimg.cn/crop.0.0.118.118.180/5db11ff4gw1e77d3nqrv8j203b03cweg.jpg" class="layui-nav-img">
Rensaihang
</a>
<dl class="layui-nav-child">
<dd><a href="">Your Profile</a></dd>
<dd><a href="">Settings</a></dd>
<dd><a href="">Sign out</a></dd>
</dl>
</li>
<li class="layui-nav-item" lay-header-event="menuRight" lay-unselect>
<a href="javascript:;">
<i class="layui-icon layui-icon-more-vertical"></i>
</a>
</li>
</ul>
</div>
<div class="layui-side layui-bg-black">
<div class="layui-side-scroll">
<!-- 左侧导航区域(可配合layui已有的垂直导航) -->
<ul class="layui-nav layui-nav-tree" lay-filter="test">
<li class="layui-nav-item layui-nav-itemed">
<a class="" href="javascript:;">技术需求管理</a>
<dl class="layui-nav-child">
<dd><a href="index.jsp">添加</a></dd>
<dd><a href="query.jsp">查询</a></dd>
<dd><a href="">修改</a></dd>
<dd><a href=""></a></dd>
</dl>
</li>
<li class="layui-nav-item">
<a href="javascript:;"></a>
<dl class="layui-nav-child">
<dd><a href="javascript:;"></a></dd>
<dd><a href="javascript:;"></a></dd>
<dd><a href=""></a></dd>
</dl>
</li>
<li class="layui-nav-item"><a href="javascript:;"></a></li>
<li class="layui-nav-item"><a href=""></a></li>
</ul>
</div>
</div>
<div class="layui-body">
<!-- 内容主体区域 -->
<div style="padding: 15px;">
<form action="techServlet?action=query" class="layui-form" method="post">
<div class="layui-form-item">
<label class="layui-form-label">*机构全称</label>
<div class="layui-input-inline">
<input type="text" name="jgmc" placeholder="" autocomplete="off" class="layui-input">
</div>
<label class="layui-form-label">所在地域</label>
<div class="layui-input-inline">
<input type="text" name="szdy" placeholder="" autocomplete="off" class="layui-input">
</div>
<label class="layui-form-label">技术需求名称</label>
<div class="layui-input-inline">
<input type="text" name="jsxqmc" placeholder="" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">归口管理部门</label>
<div class="layui-input-inline">
<input type="text" name="jsxqmc" placeholder="" autocomplete="off" class="layui-input">
</div>
<label class="layui-form-label">邮政编码</label>
<div class="layui-input-inline">
<input type="text" name="yzbm" placeholder="" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<div class="layui-input-block">
<button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
</div>
</div>
</form>
<div>
<table class="layui-table">
<colgroup></colgroup>
<thead>
<th>机构全称</th>
<th>归口管理部门</th>
<th>通信地址</th>
<th>所在地域</th>
<th>网址</th>
<th>电子邮箱</th>
<th>邮政编码</th>
<th>法人代表</th>
<th>联系人</th>
<th>固定电话</th>
</thead>
<%
ServletContext servletContext = request.getServletContext();
Pojo pojo1 = (Pojo)servletContext.getAttribute("pojo");
ArrayList<Pojo> pojos = (ArrayList<Pojo>) servletContext.getAttribute("pojos");
System.out.println(pojos);
if(pojos!=null){
for(int i = 0;i < pojos.size();i++){
Pojo pojo = pojos.get(i);
%>
<tr>
<td><%=pojo.getJgmc()%></td>
<td><%=pojo.getGkglbm()%></td>
<td><%=pojo.getTxdz()%></td>
<td><%=pojo.getSzdy()%></td>
<td><%=pojo.getDwwz()%></td>
<td><%=pojo.getDzyx()%></td>
<td><%=pojo.getYzbm()%></td>
<td><%=pojo.getFrdb()%></td>
<td><%=pojo.getLxr()%></td>
<td><%=pojo.getGddh()%></td>
</tr>
<%
}}
if(pojo1!=null){
%>
<tr>
<td><%=pojo1.getJgmc()%></td>
<td><%=pojo1.getGkglbm()%></td>
<td><%=pojo1.getTxdz()%></td>
<td><%=pojo1.getSzdy()%></td>
<td><%=pojo1.getDwwz()%></td>
<td><%=pojo1.getDzyx()%></td>
<td><%=pojo1.getYzbm()%></td>
<td><%=pojo1.getFrdb()%></td>
<td><%=pojo1.getLxr()%></td>
<td><%=pojo1.getGddh()%></td>
</tr>
< <%}%>
</table>
</div>-
</div>
</div>
<script>
//Demo
layui.use('form', function(){
var form = layui.form;
//提交
form.on('submit(formDemo)', function(data){
});
});
</script>
<div class="layui-footer">
<!-- 底部固定区域 -->
请认真填写表单
</div>
</div>
<script>
//JS
layui.use(['element', 'layer', 'util'], function(){
var element = layui.element
,layer = layui.layer
,util = layui.util
,$ = layui.$;
//头部事件
util.event('lay-header-event', {
//左侧菜单事件
menuLeft: function(othis){
layer.msg('展开左侧菜单的操作', {icon: 0});
}
,menuRight: function(){
layer.open({
type: 1
,content: '<div style="padding: 15px;">处理右侧面板的操作</div>'
,area: ['260px', '100%']
,offset: 'rt' //右上角
,anim: 5
,shadeClose: true
});
}
});
});
</script>
</body>
</html>