请教JSP中一个变量的含义
请教JSP中一个变量的含义
JSP文件中,
<input type=text maxlength= "20 " size= "20 " name = "number "
value= " <c:if test= "${outstockone!=null} ">
<c:out value= "${outstockone.number} "/>
</c:if> "/>
请问:
test= "${outstockone!=null} "中的outstockone代表什么参数?
好像根JSP的文件名没关系。要单判断它是不是空,凭啥呀?都不知道它的来历和含义。迷糊了
相关原文件:
=========== outstockone.jsp ==============
<%@ taglib prefix= "spring " uri= "/spring " %>
<%@ taglib prefix= "c " uri= "http://java.sun.com/jstl/core " %>
<%@ taglib prefix= "fmt " uri= "http://java.sun.com/jstl/fmt " %>
<%@ taglib prefix= "tiles " uri= "http://jakarta.apache.org/struts/tags-tiles " %>
<html>
<head>
<%@ page
language= "java "
contentType= "text/html; charset=GB18030 "
pageEncoding= "GB18030 "
%>
<meta http-equiv= "Content-Type " content= "text/html; charset=GB18030 ">
<title> OutStock Step One </title>
<LINK href= "../theme/style.css " rel= "stylesheet " type= "text/css ">
</head>
<br>
<body>
<center>
<form method= "POST " action= "outstockbefore.htm ">
<h1> OutStock Step One </h1>
<hr>
<table>
<tr>
<td> OutStock Number: </td>
<td>
<input type=text maxlength= "20 " size= "20 " name = "number " value= " <c:if test= "${outstockone!=null} "> <c:out value= "${outstockone.number} "/> </c:if> "/>
</td>
</tr>
<tr>
<td> OutStock Type: </td>
<td>
<select name= "type ">
<OPTION value= "11 "
<c:if test= "${outstockone!=null&&outstockone.type== '11 '} "> selected </c:if>
> 材料出库 </OPTION>
<OPTION value= "12 " <c:if test= "${outstockone!=null&&outstockone.type== '12 '} "> selected </c:if>
> 销售出库 </OPTION>
</select>
</td>
</tr>
<tr>
<td> OutStock Date: </td>
<td> <input type=text maxlength= "20 " size= "20 " name = "time " value= " <c:if test= "${outstockone!=null} "> <c:out value= "${outstockone.time} "/> </c:if> "/> </td>
</tr>
<tr>
<td> Main Employee: </td>
<td>
<SELECT name= "wemployeeId ">
<c:forEach var= "feture " items= "${wemployee.fetures} ">
<OPTION value= " <c:out value= "${feture.name} "/> " <c:if test= "${outstockone.wemployeeId==feture.name} "> selected= "selected " </c:if> >
<c:out value= "${feture.mapedItems[ 'wemployeenum ']} ${feture.mapedItems[ 'username ']} " />
</OPTION>
</c:forEach>
</SELECT>
</td>
</tr>
<tr>
<TD colspan= "2 ">
<TABLE border= "0 " cellpadding= "0 " cellspacing= "0 " width= "100% ">
<TBODY>
<TR>
<TD width= "33% "> Material Name </TD>
<TD width= "33% "> Material Number </TD>
<TD width= "130 "> Amout of Material </TD>
<TD width= "44 "> Operation </TD>
</TR>
<c:forEach var= "feture " items= "${outstockone.materials.fetures} ">
<TR>
<TD> <c:out value= "${feture.mapedItems[ 'materialnum ']} "/> </TD>
<TD> <c:out value= "${feture.mapedItems[ 'rmname ']} "/> </TD>
<TD > <c:out value= "${feture.mapedItems[ 'amount ']} "/> </TD>
<TD > <a href= "./outstockbefore.htm?submitOne=Del&materialId= <c:out value= "${feture.name} "/> "> Del </a> </TD>
</TR>
</c:forEach>
<TR>
<TD>
<SELECT name= "materialId ">
<c:forEach var= "feture " items= "${materialList.fetures} ">
<option value= " <c:out value= "${feture.name} "/> "> <c:out value= "${feture.mapedItems[ 'materialnum ']} ${feture.mapedItems[ 'rmname ']} "/> </option>
</c:forEach>
</SELECT>
</TD>
<TD> <input type= "text " name= "amount "/> </TD>
<TD > </TD>
<TD > <input type= "submit " value= "Add " name= "submitOne "/> </TD>
</TR>
</TBODY>
</TABLE>
</TD>
</tr>
<tr>
<td> Remark: </td>
<td> <textarea name= "remark " cols= "50 " rows= "10 "> </textarea> </td>
</tr>
<tr>
<td colspan= "2 " align= "center ">
<input type= "submit " name= "submitOne " value= "Next "/>
<input type=reset value= "Reset "/>
</td>
</tr>
</table>
</form>
</center>
</body>
</html>
=========== rfid-servlet.xml ==============
<bean id= "simpleUrlMapping " class= "org.springframework.web.servlet.handler.SimpleUrlHandlerMapping ">
<property name= "mappings ">
<props>
key= "/outstockbefore.htm "> outstockBeforeOneController </prop>
<prop key= "/outstocktwo.htm "> outstockTwoController </prop>
<prop key= "/outstockthree.htm "> outstockThreeController </prop>
</props>
</property>
</bean>
<bean id= "outstockBeforeOneController " class= "edu.ss.rfid.mvc.controller.OutStockBeforeOneController ">
<property name= "WEmployeeServices ">
<ref bean= "wEmployeeServices "/>
</property>
<property name= "materialServices ">
<ref bean= "materialServices "/>
</property>
</bean>
新手看进销存系统的一个模块后跟着做,但设计的咚咚太多了,请高手救一把啊!!
[解决办法]
<input type=text maxlength= "20 " size= "20 " name = "number " value= "${outstockone} "> 不用写成的意思就是 if(outstockone!=null){outstockone}else{},所以所以不用写成 <input type=text maxlength= "20 " size= "20 " name = "number " value= " <c:if test= "${outstockone!=null} ">
[解决办法]
后台JAVA文件中定义了这个变量
[解决办法]
是后台传给jsp页面的变量