<body>
<%
try{
String strip="";
strip=session.getAttribute("str_ip").toString();
request.setAttribute("str_ip",strip);
String nam=(request.getParameter("nme").trim()+".jsp").toString().trim();
String sendr=infof.Infoo2(strip,in_show,nam).toString().trim();
response.sendRedirect("iindex.jsp");
return;
}
catch(Exception err){
System.out.println(err.getLocalizedMessage());
}
%>
<%
try{
String strip="";
strip=session.getAttribute("str_ip").toString();
request.setAttribute("str_ip",strip);
String nam=(request.getParameter("nme").trim()+".jsp").toString().trim();
String sendr=infof.Infoo2(strip,in_show,nam).toString().trim();
response.sendRedirect("iindex.jsp");
return;
}
catch(Exception err){
System.out.println(err.getLocalizedMessage());
}
%>
应该是index.jsp吧
我对它进行try捕捉。err.getLocalizedMessage()结果输出是:null
我晕死了,为这个问题难住了,高手们帮帮忙啊!
这是我号的所有集分了,全送出。
这个是什么????
另外
String nam=(request.getParameter("nme").trim()+".jsp").toString().trim();
最好改成:
String temp1 = (String)request.getParameter("nme");
temp1 = temp1.trim();
temp1 = temp1+".jsp";
nam = temp1;如果页面没有跳转说明在sendRedirect前就出错了。
这是一个方法返回一个值,这正常。我可以打印出来
<%
try{
String strip="";
strip= (String)session.getAttribute("str_ip");
request.setAttribute("str_ip",strip);
String nam = (String)request.getParameter("nme");
nam = nam.trim()+".jsp";
String sendr=infof.Infoo2(strip,in_show,nam).toString().trim();
response.sendRedirect("iindex.jsp")
}
catch(Exception err){
System.out.println(err.getLocalizedMessage());
}
%>
勿慌,涉及保密不?不涉及的话把这个文件的上个文件和这个文件发给我:
[email protected]
应该是try{}catch{}的问题。
<a href="annal.jsp?nme=ivm&info_temp=0">银行重要空白凭证管理软件</a>
<a href="annal.jsp?nme=fix&info_temp='1'">固定资产综合管理系统</a>
<a href="annal.jsp?nme=gpsw&info_temp=2">银行光盘缩微系统</a>
。。
try{
String strip="";
strip= (String)session.getAttribute("str_ip");
request.setAttribute("str_ip",strip);
String nam = (String)request.getParameter("nme");
nam = nam.trim()+".jsp";
//String sendr=infof.Infoo2(strip,in_show,nam).toString().trim();
response.sendRedirect("iindex.jsp");
out.print(nam);
}
catch(Exception err){
System.out.println(err.getLocalizedMessage());
}
%>试试这段。我把
String sendr=infof.Infoo2(strip,in_show,nam).toString().trim();
这行注释了(在我这运行不了)。结果就没什么问题了。可以跳转。不知道你这行是用来做什么的。
这句是调用一个java文件把有用的信息保存数据库
我发给你的文件收到了吗?我这边还是不行。
改为:target="_blank"试试
<%
try{
String[] te=new String[]{"这里的东西我去掉了"};
String in_show=request.getParameter("info_temp");
for(int i=0;i<te.length;i++){
String j=i+"";---->这里想干什么?i是整形,你想把它赋给String么?如果是的话可以这么做:String j = ""+i+"";
if(in_show.equals(j)){
in_show=j;
out.print(in_show);
out.print("<br>");
break;
}
}
String strip="";
strip=session.getAttribute("str_ip").toString();
String nam=request.getParameter("nme")+".jsp";
//String sendr=(infof.Infoo2(strip,in_show,nam)).toString().trim();
//response.sendRedirect("");
}
catch(Exception err){}
%>可能是:
String sendr=(infof.Infoo2(strip,in_show,nam)).toString().trim();
出问题了。不知道这个javabean函数返回的是什么类型。如果建议把".toString()" ".trim()'
拆开,一步一步做。
也可以先把
String sendr=(infof.Infoo2(strip,in_show,nam)).toString().trim();
单独测试一下。直接在这个页面对infof.Infoo2()函数赋参数,看返回结果对不对。我把这行注释了后就没报错。
这一行session.getAttribute返回的是OBJECT,你用toString来返回STRING 类型的话会调用OBJECT的toString()方法,不能返回你所要求的字符串,改成(String)session.getAttribute("str_ip");
把这个去掉试试。
另外,在跳转前有什么输出么?如果有也先去掉试试。
看看执行到哪一步了撒,晕 这应该不是个复杂的问题
if(2>1)response.sendRedirect("iindex.jsp");
因为我是在.net里碰到的,所以不确定你会不会是相同原因引起的。
提供一个建议,可以找一下是不是页面设置了什么特别的属性造成的。
或者把try『』catch『』去掉试试
我是这么解决的,仅供参考response.sendRedirect("iindex.jsp");的作用无非就是跳转页面,
你可以把这一句去掉,改用另一外一种方式实现
在页面上加上html的跳转语句
如:
<meta http-equiv="refresh" content=1;url="iindex.jsp">
如果你找到了另外的解决方法也告诉我。
是不是还应该传递个什么参数到这个页啊?=======================================================