jobform2.jsp

来自「Java的框架」· JSP 代码 · 共 91 行

JSP
91
字号
<%@ include file="/common/taglibs.jsp"%>


<c:if test="${param.method == 'add'}">
	<c:set var="title"><fmt:message key="addJob.title"/></c:set>
	<c:set var="heading"><fmt:message key="addJob.heading"/></c:set>
	<c:set var="message"><fmt:message key="addJobParam.message"/></c:set>
</c:if>
<c:if test="${param.method == 'edit'}">
	<c:set var="title"><fmt:message key="editJob.title"/></c:set>
	<c:set var="heading"><fmt:message key="editJob.heading"/></c:set>
	<c:set var="message"><fmt:message key="editJobParam.message"/></c:set>
</c:if>
<html>
	<head>
		<title><c:out value="${title}"/></title>
		<content tag="heading">
			<c:out value="${heading}"/>
		</content>
    <script type="text/javascript" src="<c:url value='/scripts/selectbox.js'/>"></script>
	</head>
 	<body>
 		<c:choose>
 			<c:when test="${param.method == 'edit' && !empty job && empty job.name}">
		    <div class="error">	
					<img src="<c:url value="/images/iconWarning.gif"/>"
               alt="<fmt:message key="icon.warning"/>" class="icon" />
          <fmt:message key="errors.job.notfound">
					 	<fmt:param value="${param.jobName}"/>
					 	<fmt:param value="${param.jobGroup}"/>
					</fmt:message><br>
		    </div>
				<a href="<c:url value="/jobs.action"/>">&#171; Back</a>
 			</c:when>
 			<c:otherwise>
				<span id="message"><c:out value="${message}"/></span>
				<div class="separator"></div>
				<spring:bind path="job.*">
				    <c:if test="${not empty status.errorMessages}">
				    <div class="error">	
				        <c:forEach var="error" items="${status.errorMessages}">
				            <img src="<c:url value="/images/iconWarning.gif"/>"
				                alt="<fmt:message key="icon.warning"/>" class="icon" />
				            <c:out value="${error}" escapeXml="false"/><br />
				        </c:forEach>
				    </div>
				    </c:if>
				</spring:bind>
				<c:set var="pageButtons">
					<tr>
						<td width="20%" valign="top">&nbsp;
						</td>
						<td class="buttonBar" width="80%" valign="top">
				      <input type="submit" class="button" name="_target0" onclick="bCancel=false" value="<fmt:message key="button.previous"/>" />		
				      <input type="submit" class="button" name="_finish" onclick="bCancel=false" value="<fmt:message key="button.finish"/>" />		
			   			<input type="submit" class="button" name="_cancel" onclick="bCancel=true" value="<fmt:message key="button.cancel"/>" />
						</td>
					</tr>
				</c:set>
				<form method="post" action="<c:url value="/jobForm.action"/>" id="jobForm" name="jobForm">
					<input type="hidden" name="method" value="<c:out value="${param.method}"/>" />
					<input type="hidden" name="from" value="<c:out value="${param.from}"/>" />
					<input type="hidden" name="jobName" value="<c:out value="${param.jobName}"/>" />			
					<input type="hidden" name="groupName" value="<c:out value="${param.groupName}"/>" />			
					<table class="detail">
					<c:if test="${empty job.parameters}">
						<fmt:message key="job.parameters.notrequired"/>
					</c:if>
					<c:if test="${not empty job.parameters}">
				 		<c:forEach var="item" items="${job.parameters}">		  		
							<tr>
								<td width="20%"><c:out value="${item.key}"/> :</td>
								<td width="80%">
									<input type="text" id="_<c:out value="${item.key}"/>" 
										name="_<c:out value="${item.key}"/>" 
							  		value="<c:out value="${item.value}"/>"  size="60" >					
		        			<span class="fieldError"><c:out value="${status.errorMessage}"/></span>
								</td>
					  	</tr>	
					  </c:forEach>
					</c:if>
					</table>	
					<div class="separator"></div>
					<table width="100%">
						<c:out value="${pageButtons}" escapeXml="false" />
					</table>	
				</form>	
			</c:otherwise>
		</c:choose>
	</body>
</html>

⌨️ 快捷键说明

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