⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 providermanager.jsp

📁 一个简单的数据连接例子
💻 JSP
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=GBK"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<f:view>
  <html>
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=GBK"/>
      <link href="./css/styles.css" rel="stylesheet" type="text/css"/>
      <title>供货商信息</title>
    </head>
    <body background="image/background.gif"><h:form>
        <h2 align="center">
          <font face="华文新魏" color="#5a9400">供货商信息表</font>
        </h2>
        
        <table cellspacing="0" style="font-size: 9pt" cellpadding="0" border="1"
               width="100%">
          <tr>
            <td width="10%">供货商代码</td>
            <td>
              <h:inputText size="20" value="#{providerInfo.providerCode}"/>
            </td>
            <td width="10%">供货商名称</td>
            <td width="23%">
              <h:inputText size="20" value="#{providerInfo.name}"/>
            </td>
            <td width="10%">供货品种</td>
            <td width="23%">
              <h:inputText size="20" value="#{providerInfo.category}"/>
            </td>
          </tr>
          <tr>
            <td width="10%">电子邮件</td>
            <td width="24%">
              <h:inputText size="20" value="#{providerInfo.email}"/>
            </td>
            <td width="10%">地址</td>
            <td width="23%">
              <h:inputText size="20" value="#{providerInfo.address}"/>
            </td>
            <td width="10%">邮编</td>
            <td width="23%">
              <h:inputText size="20" value="#{providerInfo.postCode}"/>
            </td>
          </tr>
          <tr>
            <td width="10%">电话</td>
            <td width="24%">
              <h:inputText size="20" value="#{providerInfo.tel}"/>
            </td>
            <td width="10%">联系人</td>
            <td width="24%">
              <h:inputText size="20" value="#{providerInfo.linkMan}"/>
            </td>
            <td width="10%">手机</td>
            <td width="24%">
              <h:inputText size="20" value="#{providerInfo.mobile}"/>
            </td>
          </tr>
          <tr>
            <td align="right" colspan="6">
              <h:commandButton action="#{providerController.queryItem}"
                               value="查询"/>
              <h:commandButton action="#{providerController.insertItem}"
                               value="保存"/>
              <h:commandButton type="#{providerController.Reset}" value="清空"/>
            </td>
          </tr>
        </table>
        <div style="overflow:auto; height:300px;font-size: 9pt">
          <h:dataTable value="#{providerController.model}" var="provider"
                       styleClass="customers" headerClass="customersHeader"
                       rowClasses="oddRows,evenRows"
                       columnClasses="customersCol" width="100%">
            <!--oracle-jdev-comment:Faces.RI.DT.Class.Key:javax.faces.model.DataModel-->
            <h:column>
              <f:facet name="header">
                <h:outputText value="选择"/>
              </f:facet>
             <f:verbatim>
                <input type="checkbox" name="aa" value="1" />
              </f:verbatim>
             
            </h:column>
            <h:column>
              <f:facet name="header">
                <h:outputText value="供货商代码"/>
              </f:facet>
              <h:outputText value="#{provider.providerCode}"/>
            </h:column>
            <h:column>
              <f:facet name="header">
                <h:outputText value="供货商名称"/>
              </f:facet>
              <h:outputText value="#{provider.name}"/>
            </h:column>
            <h:column>
              <f:facet name="header">
                <h:panelGroup>
                  <h:outputText value="供货品种"/>
                </h:panelGroup>
              </f:facet>
              <h:outputText value="#{provider.category}"/>
            </h:column>
            <h:column>
              <f:facet name="header">
                <h:outputText value="电子邮件"/>
              </f:facet>
              <h:outputText value="#{provider.email}"/>
            </h:column>
            <h:column>
              <f:facet name="header">
                <h:outputText value="供货商地址"/>
              </f:facet>
              <h:outputText value="#{provider.address}"/>
            </h:column>
            <h:column>
              <f:facet name="header">
                <h:outputText value=" 邮编 "/>
              </f:facet>
              <h:outputText value="#{provider.postCode}"/>
            </h:column>
            <h:column>
              <f:facet name="header">
                <h:outputText value=" 电话 "/>
              </f:facet>
              <h:outputText value="#{provider.tel}"/>
            </h:column>
            <h:column>
              <f:facet name="header">
                <h:outputText value="联系人"/>
              </f:facet>
              <h:outputText value="#{provider.linkMan}"/>
            </h:column>
            <h:column>
              <f:facet name="header">
                <h:outputText value="手机"/>
              </f:facet>
              <h:outputText value="#{provider.mobile}"/>
            </h:column>
            <h:column>
              <f:facet name="header">
                <h:outputText value=" 操 作"/>
              </f:facet>
              <h:commandLink action="#{providerController.updateItem}">
                <h:graphicImage url="image/edit.gif" style="border: 0px"
                                width="16" height="16" alt="编辑"/>
              </h:commandLink>
              <!--onmousedown="javascript:confirm('真的要删除吗?');"-->
              <h:commandLink immediate="true"
                             action="#{providerController.deleteItem}">
                <h:graphicImage style="border: 0px" width="16" height="16"
                                url="image/delete.gif" alt="删除"/>
              </h:commandLink>
            </h:column>
          </h:dataTable>
        </div>
        <table cellspacing="0" style="font-size: 9pt" cellpadding="0" border="1"
               width="100%">
          <tr>
            <td>
              <h:outputLabel value="#{providerController.sumPage}"/>
              页 第
              <h:outputLabel value="#{providerController.currentPage}"/>
              页 共计
              <h:outputLabel value="#{providerController.sumRecord}"/>
              条记录,当前页有
              <h:outputLabel value="#{providerController.currentCount}"/>
              条记录
            </td>
            <td>
              <h:commandButton id="FirstPage" value="起始页"
                               action="#{providerController.FirstPageList}"/>
              <h:commandButton id="PrePage" value="上一页"
                               action="#{providerController.PrePageList}"/>
              <h:commandButton value="下一页"
                               action="#{providerController.NextPageList}"/>
              <h:commandButton value="末尾页"
                               action="#{providerController.LastPageList}"/>
            
              <h:inputText id="goPage" value="#{providerController.gotopage}" size="5"/>
           
              <h:commandButton value="查 看" action="#{providerController.GotoPageList}"/>
            </td>
            <td>
              <h:commandButton value="刷新"
                               action="#{providerController.getAll}"/>
            </td>
          </tr>
        </table>
      </h:form></body>
  </html>
</f:view>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -