weblogic.servlet.jsp.CompilationException错误

wqfwuliao 2009-08-12 09:22:38
weblogic.servlet.jsp.CompilationException: Failed to compile JSP /bigP.jsp
bigP.jsp:17:1: Expression expected (found '<' instead)
<%
^
bigP.jsp:17:1: Illegal use of an expression as a statement.
<%
^-
String id = request.getParameter("id");
-----^
bigP.jsp:17:2: Expression expected (found '%' instead)
<%
^
bigP.jsp:18:1: No variable or field with this name could be found at this locati
on.
String id = request.getParameter("id");
^----^
bigP.jsp:18:8: No variable or field with this name could be found at this locati
on.
String id = request.getParameter("id");
^^
bigP.jsp:18:8: Syntax error: expected ; (found 'id' instead)
String id = request.getParameter("id");
^^
bigP.jsp:20:2: No variable or field with this name could be found at this locati
on.
id = URLDecoder.decode(id, "UTF-8");
^^
。。。。。。。。。。。。。。。

function bigPhoto(obj){
window.open ('bigP.jsp?id='+encodeURI(encodeURI(obj)), '', 'toolbar=no,scrollbars=yes');
}

...全文
739 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
wqfwuliao 2009-08-12
  • 打赏
  • 举报
回复
问题解决了,原来发的版本跟我本地的有点不一样,代码没错~
wqfwuliao 2009-08-12
  • 打赏
  • 举报
回复
<body>

<%
String id = request.getParameter("id");
try {
id = URLDecoder.decode(id, "UTF-8");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println(id);
%>
<img alt="<%=id.trim()%>的原始图片" src="Zphote?id=<%=id.trim()%>"/>
</body>
就这么点代码
wqfwuliao 2009-08-12
  • 打赏
  • 举报
回复
混合在一起就不可以了?
南方孤雁 2009-08-12
  • 打赏
  • 举报
回复
都是一些语法错误,JSP中Java脚本与html格式混合在一起,还有一些变量错误等等!

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧