在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
<%@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
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";
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行
Duplicate local variable strType
一模一样的错误,你修改下
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的啊,是不是还有什么地方自己没有注意啊