<% if(numGuess.getSuccess())%> <% { %> Congratulation! You got it And after just<%=numGuess.getNumGuesses()%>tries.<p> <% numGuess.setInit(); %> Care to <a href="numGuess.jsp">try again</a>? <% } %> <% else if(numGuess.getNumGuesses()==0)%> <% { %> Welcome to the Number Guess game.<p> I'm thinking of a number between 1 and 100.<p> <form method="get"> What's your guess?><input type="text" name="guess"> <input type="submit" value="Submit"> </form> <% }else{ %> Good guess,but nope. Try<b><%=numGuess.getHint()%></b> You have made<%=numGuess.getNumGuesses()%>guesses.<p> I'm thinking of a number between 1 and 100.<p> <form method=get> What's your guess?<input type=text name=guess> <input type=submit value="Submit"> </form> <% } %>
怎么总是报错呀
[javac] C:\Tomcat 4.1\work\Standalone\localhost\test\numGuess_jsp.java:81: 'else' without 'if' [javac] else if(numGuess.getNumGuesses()==0) [javac] ^ [javac] C:\Tomcat 4.1\work\Standalone\localhost\test\numGuess_jsp.java:91: 'else' without 'if' [javac] }else{ [javac] ^ [javac] 2 errors
----------------解决方案--------------------------------------------------------
重复发帖,所以有点不爽,不想帮你哎~
----------------解决方案--------------------------------------------------------