当前位置: 代码迷 >> J2EE >> 语法异常,将“}”插入到完整 MethodBody 中
  详细解决方案

语法异常,将“}”插入到完整 MethodBody 中

热度:709   发布时间:2016-04-19 22:46:55.0
语法错误,将“}”插入到完整 MethodBody 中

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ page isELIgnored="false" %> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
      <script type="text/javascript">
         function admin()
         {
            var url="<%=path %>/login.jsp";
            window.open(url,"_blank");
         } 
         function myXinxi(user)
         {
            if(user == null)
            { 
             alert("请先登录");  
            }        
            else
            {
                var url="<%=path %>/qiantai/userinfo/userXinxi.jsp";
                var n="";
                var w="480px";
                var h="500px";
                var s="resizable:no;help:no;status:no;scroll:yes";
    openWin(url,n,w,h,s);
}
         } 
         function reg()
         {
var url="<%=path %>/qiantai/userinfo/userReg.jsp";
var n="";
var w="480px";
var h="500px";
var s="resizable:no;help:no;status:no;scroll:yes";
openWin(url,n,w,h,s);
         }
         function liuyanAll(user)
         {
            if(user == null)
            {
             alert("请先登录");
            }
            else
            {
                var url="<%=path %>/liuyan?type=liuyanAll";
var targetWinName="newWin";
var features="width="+screen.width-200+" ,height="+screen.height-150+" ,toolbar=no, top=0, left=0, menubar=no, scrollbars=no, resizable=no,location=no, status=no"
var new_win=window.open(url,targetWinName,features);
            }
         } 
      </script>
  </head>
  <body>
       &nbsp;&nbsp;&nbsp;
       <A href="<%=path %>/chuzu?type=chuzuAll">出租信息</A> &nbsp;&nbsp;
       <A href="<%=path %>/chushou?type=chushouAll">出售信息</A> &nbsp;&nbsp;
       <a href="#" onclick="reg()">免费注册</A> &nbsp;&nbsp;
       <a href="#" onclick="myXinxi(${sessionScope.user})">我的信息</A> &nbsp;&nbsp;
       <a href="#" onclick="liuyanAll(${sessionScope.user})">系统留言板</A> &nbsp;&nbsp;
   <a href="#" onclick="admin()">后台管理</a> &nbsp;&nbsp;
  </body>
</html>

------解决方案--------------------
这个错误应该是类里的方法快缺少}异常。和你贴的代码没关系。
------解决方案--------------------
找找那里缺少 的。 
------解决方案--------------------
看看哪里是不是少了}