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

📄 createdaoform.jsp

📁 Java Pattern Oriented Framework (Jt) 是为了实现Java快速开发的面向模式的框架。
💻 JSP
字号:


<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ page import = "org.apache.struts.config.*, org.apache.struts.action.*, Jt.DAO.*, Jt.wizard.struts.*, Jt.*" %>

<%--
<% response.setHeader("Cache-Control","no-cache"); //HTTP 1.1 
response.setHeader("Pragma","no-cache"); //HTTP 1.0 
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server 
%> 
--%>


<c:if test="${jtReply != null}">
  <c:set var="daoForm" value="${jtReply}" scope="session" />   
</c:if>




 <html:form action= "CreateDAO?jtMsgId=GENERATE_DESCRIPTOR" >
   <fieldset>
     <legend>DAO mapping</legend> 
     <br />
     <label for="name">*Class Name: </label>

     <html:text property="name" size="50" /> 
     <br />
     <br />
     <label>Table Name: </label>
     <html:text property="table" />
     <br />
     <br />


<%--
     <label>Key(s): </label>

     <html:select property="dbkeys" multiple="true" size="4">
     <html:optionsCollection property="attributes" value="value" label="label"/> 
     </html:select>
     <br />
     <br />

--%>
<table >

<thead>
<tr><th>key?</th><th>*attribute</th><th>column</th><th>sql type</th><th>not Null?</th><th>unique ?</th><th>enable?</th>
</tr>
</thead>
<tbody id="table">
       <logic:iterate id="dbmappings" name="daoForm" property="dbmappings" >

<c:if test="${!(empty dbmappings.attribute)}">
<tr>
       <td><html:checkbox name="dbmappings" property="keyAttribute" indexed="true"/></td>
       <td><html:text name="dbmappings" property="attribute" indexed="true"/></td>
       <td><html:text name="dbmappings" property="column" indexed="true"/></td>
       <td><html:text name="dbmappings" property="sql_type" indexed="true"/></td>
       <td><html:checkbox name="dbmappings" property="notNull" indexed="true"/></td>
       <td><html:checkbox name="dbmappings" property="unique" indexed="true"/></td>
       <td><html:checkbox name="dbmappings" property="enabled" indexed="true"/></td>
</tr>
</c:if>

       </logic:iterate>
</tbody>
</table>

     <br />
     <hr />
<table width="100%">
<tr>
<td>     
     <html:submit />
</td>
<td>
     <html:cancel />
</td>
<td align="right">
     <html:button value="Add Attribute" property="name" onclick="jtAddTableRow ('dbmappings', 50);"/>

</td>
</tr>
</table>

   </fieldset>
 </html:form>

<%
  int i;
  DAODefinitionForm daoForm = (DAODefinitionForm)
         session.getAttribute ("daoForm");
  JtMessage msg = new JtMessage (DAODefinitionForm.RESET);
  JtFactory factory = new JtFactory ();


//DAOMapping mappingArray[] = null;


  if (daoForm != null)
     factory.sendMessage (daoForm, msg);      

/*
  if (daoForm != null)
    mappingArray = (DAOMapping[]) daoForm.getDbmappings ();
  
  
  if (mappingArray != null)
    for (i=0; i<mappingArray.length ; i++) {
      mappingArray[i].setEnabled (false);
      mappingArray[i].setKeyAttribute (false);
    }
*/

%>


⌨️ 快捷键说明

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