jsp新手請教一下
因為兩個bean的變數名一樣 所以兩個都會被設成TextValue
有辦法只指定給其中一個嗎?
謝謝
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<jsp:useBean id="BeanID" scope="session" class="PackageName.ClassName" />
<jsp:useBean id="BeanID2" scope="session" class="PackageName.ClassName2" />
<title>JSP Page</title>
</head>
<body>
<h1>Hello World!</h1>
<form name="FormName" action="index.jsp" method="POST">
<input type="text" name="memString" value="TextValue" />
<input type="submit" value="ButtonLabel" name="ButtonName" />
</form>
<jsp:setProperty name="BeanID" property="memString" />
<jsp:getProperty name="BeanID" property="memString" />
<jsp:setProperty name="BeanID2" property="memString" />
<jsp:getProperty name="BeanID2" property="memString" />
</body>
</html>
OA
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.171.188.109
※ 文章網址: http://www.ptt.cc/bbs/java/M.1397730377.A.1F9.html