在jsp7.0中有如下代码:
<%@page language="java" contentType="text/html;charset=GBK"%>
<%@page import="kjb.main.DealString"%>
<%
    DealString ds = new DealString();
在Tomcat运行以下错误:An error occurred at line: 5 in the jsp file: /frame.jsp
Duplicate local variable ds

解决方案 »

  1.   

    http://blog.csdn.net/hhy62011980/article/details/5690906
      

  2.   

    http://blog.csdn.net/hhy62011980/article/details/5690906
      

  3.   

    DealString ds = new DealString();ds名字换下,应该是有一个变量名叫ds了。
      

  4.   

    我把变量改为dss,也不行,还是报错.
      

  5.   

    An error occurred at line: 5 in the jsp file: /frame.jsp
    Duplicate local variable strType
    2: <%@page import="kjb.main.DealString"%>
    3: <%
    4:     DealString dss = new DealString();
    5:  String strType = dss.toString(request.getParameter("txt_type"));
    6:  String strType1 = dss.toString(request.getParameter("txt_type1"));
    7:  String strSearch = dss.toString((String)request.getParameter("txt_search"));//新加入
    8:  if(strType.equals(""))strType = "0";
      

  6.   

    An error occurred at line: 5 in the jsp file: /frame.jsp
    Duplicate local variable strType
    2: <%@page import="kjb.main.DealString"%>
    3: <%
    4:     DealString dss = new DealString();
    5:  String strType = dss.toString(request.getParameter("txt_type"));
    6:  String strType1 = dss.toString(request.getParameter("txt_type1"));
    7:  String strSearch = dss.toString((String)request.getParameter("txt_search"));//新加入
    8:  if(strType.equals(""))strType = "0";
    第5行
      

  7.   

    An error occurred at line: 5 in the jsp file: /frame.jsp
     Duplicate local variable strType

    一模一样的错误,你修改下
      

  8.   

    An error occurred at line: 5 in the jsp file: /frame.jsp
    Duplicate local variable strType
    2: <%@page import="kjb.main.DealString"%>
    3: <%
    4:     DealString dss = new DealString();
    5:  String strType = dss.toString(request.getParameter("txt_type"));
    6:  String strType1 = dss.toString(request.getParameter("txt_type1"));
    7:  String strSearch = dss.toString((String)request.getParameter("txt_search"));//新加入
    8:  if(strType.equals(""))strType = "0";
    第5行
    你是不是用了什么导入的jsp呢?看你这代码是ok的啊,是不是还有什么地方自己没有注意啊