org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 176 in the jsp file: /encrypted.jsp
gn cannot be resolved
173: <input type="text" name="itt" value="" />
174: </label><br><br><br><br>
175: <label><b>Generated Key-</b>
176: <input type="text" name="Gnkey" value="<%=gn%>"/>
177: </label>
178: </td>
gn变量用于存储函数
的输出<%
String gn = generateKey(SelectedIndex, key, itt);
%>
如何解决此错误?
答案 0 :(得分:0)
将其放入pageContext
<%
pageContext.setAttribute("gn", gn);
%>
然后像${gn}
或强>
更改
<%
String gn = generateKey(SelectedIndex, key, itt);
%>
到
<!%
String gn = generateKey(SelectedIndex, key, itt);
%>
另见