edit.gsp
上传用户:steveyhw
上传日期:2019-05-13
资源大小:307k
文件大小:3k
源码类别:

PlugIns编程

开发平台:

Java

  1.   
  2. <html>
  3.   <head>
  4.     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  5.     <meta name="layout" content="main" />
  6.     <title>Edit Requestmap</title>
  7.   </head>
  8.   <body>
  9.     <div class="nav">
  10.       <span class="menuButton"><a href="${createLinkTo(dir:'')}">Home</a></span>
  11.       <span class="menuButton"><g:link action="list">Requestmap List</g:link></span>
  12.       <span class="menuButton"><g:link action="create">New Requestmap</g:link></span>
  13.     </div>
  14.     <div class="body">
  15.       <h1>Edit Requestmap</h1>
  16.       <g:if test="${flash.message}">
  17.         <div class="message">${flash.message}</div>
  18.       </g:if>
  19.       <g:hasErrors bean="${requestmap}">
  20.         <div class="errors">
  21.           <g:renderErrors bean="${requestmap}" as="list" />
  22.         </div>
  23.       </g:hasErrors>
  24.       <div class="prop">
  25.     <span class="name">Id:</span>
  26.     <span class="value">${requestmap?.id}</span>
  27.       </div>           
  28.       <g:form controller="requestmap" method="post" >
  29.         <input type="hidden" name="id" value="${requestmap?.id}" />
  30.         <div class="dialog">
  31.           <table>
  32.             <tbody>
  33.   <tr class='prop'>
  34.     <td valign='top' class='name'><label for='url'>URL:</label></td>
  35.      <td valign='top' 
  36.    class='value ${hasErrors(bean:requestmap,field:'url','errors')}'>
  37.   <input type="text" name='url' 
  38.      value="${requestmap?.url?.encodeAsHTML()}"/>
  39.  </td>
  40.   </tr>
  41.                        
  42.   <tr class='prop'>
  43.     <td valign='top' class='name'>
  44.       <label for='configAttribute'>Roles(split by a comma):</label>
  45.     </td>
  46. <td valign='top' 
  47.   class='value ${hasErrors(bean:requestmap,field:'configAttribute','errors')}'>
  48.   
  49.   <%
  50.                     String[] configAttrs=
  51.                         org.springframework.util.StringUtils.
  52.                         commaDelimitedListToStringArray(requestmap.configAttribute);
  53.                      
  54.                     String roles="";
  55.                   %>
  56.       <g:each var="role" in="${configAttrs}">
  57.         <g:if test="${role.startsWith('ROLE_')}">            
  58.                     <%roles+=role.substring(5).toLowerCase()+",";%>
  59.                  </g:if>
  60.                  <g:else>
  61.                     <%roles+=role;%>
  62.                  </g:else>
  63.                   </g:each>
  64.   <input type="text" name='configAttribute' 
  65.      value="${roles?.encodeAsHTML()}"/>
  66. </td>
  67.   </tr>
  68.                        
  69.             </tbody>
  70.           </table>
  71.         </div>
  72.         <div class="buttons">
  73.           <span class="button"><g:actionSubmit value="Update" /></span>
  74.           <span class="button"><g:actionSubmit value="Delete" /></span>
  75.         </div>
  76.       </g:form>
  77.     </div>
  78.   </body>
  79. </html>