当前位置:编程学习 > JAVA >>

求助在jsp 7.0中 路径问题,在线等待ing

在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
--------------------编程问答-------------------- http://blog.csdn.net/hhy62011980/article/details/5690906 --------------------编程问答-------------------- http://blog.csdn.net/hhy62011980/article/details/5690906 --------------------编程问答-------------------- DealString ds = new DealString();ds名字换下,应该是有一个变量名叫ds了。 --------------------编程问答--------------------
引用 3 楼 fangmingshijie 的回复:
DealString ds = new DealString();ds名字换下,应该是有一个变量名叫ds了。



我把变量改为dss,也不行,还是报错. --------------------编程问答-------------------- 你这报错的原因是你有两个ds的变量名,重复了。换个应该不会报这个错了。你好好看看 --------------------编程问答--------------------
引用 5 楼 Miklechun 的回复:
你这报错的原因是你有两个ds的变量名,重复了。换个应该不会报这个错了。你好好看看



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 楼 u011462174 的回复:
Quote: 引用 5 楼 Miklechun 的回复:

你这报错的原因是你有两个ds的变量名,重复了。换个应该不会报这个错了。你好好看看



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行 --------------------编程问答-------------------- An error occurred at line: 5 in the jsp file: /frame.jsp
 Duplicate local variable strType
一模一样的错误,你修改下 --------------------编程问答--------------------
引用 7 楼 podongxi777442156445 的回复:
Quote: 引用 6 楼 u011462174 的回复:

Quote: 引用 5 楼 Miklechun 的回复:

你这报错的原因是你有两个ds的变量名,重复了。换个应该不会报这个错了。你好好看看



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的啊,是不是还有什么地方自己没有注意啊 --------------------编程问答-------------------- 看不出来,哎!道行太浅呀
补充:Java ,  Web 开发
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,