蔭按鈕單擊新建JSP和我運行腳本似乎無法弄清楚如何運行的代碼只有當在button..here的我的代碼在用戶點擊:僅在JSP
$
<form action="list_computers.jsp" method="post">
Search:
<input type="text" name="FromTextBox1"/>
<input type="submit" value="Search it!" >
<%
String TheSearch = (String)request.getParameter("FromTextBox1");
String GetIt = Searcher(TheSearch);
out.println(GetIt);
%>
</form>
Searcher()是我在此之上聲明的一個函數。任何幫助將非常感激。
這段代碼的作用是調用函數搜索器()在頁面加載時,並因此拋出異常的小例子。 –
[請勿使用scriptlets](http://stackoverflow.com/questions/3177733/how-to-avoid-java-code-in-jsp-files)。 –
感謝您的建議。 –