在eclipse當(dāng)中如何做一個(gè)jsp的helloWorld?
jsp的helloWorld:
做jsp的實(shí)驗(yàn)步驟非常簡(jiǎn)單。在eclipse當(dāng)中,右鍵點(diǎn)擊代表你WebModule的根目錄的WebContent。new/jsp 即可。
馬克- to-win:馬克 java社區(qū):防盜版實(shí)名手機(jī)尾號(hào): 73203。
例 1.1
<%@ page contentType="text/html; charset=GBK"%>
<html>
<%!private int accessCount = 0;%>
<%!double called() {
return Math.random();
}%>
<%=++accessCount%>
<%
if (called() < 0.5) {
%>
天氣好
<%
} else {
%>
天氣不好
<%
}
%>
</body>
</html>