我写了个登录页,按下登录按钮又完全没有反应,页面也不跳转,
我看了,数据库应该是连上了.
请帮我看看,下面这段提示是什么意思呀?
2007-7-30 13:29:59 org.apache.struts.util.PropertyMessageResources <init>
信息: Initializing, config='org.apache.struts.taglib.LocalStrings', returnNull=true
2007-7-30 13:29:59 org.apache.struts.util.PropertyMessageResources <init>
信息: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
2007-7-30 13:29:59 org.apache.struts.util.PropertyMessageResources <init>
信息: Initializing, config='org.apache.struts.taglib.LocalStrings', returnNull=true
2007-7-30 13:29:59 org.apache.struts.util.PropertyMessageResources <init>
信息: Initializing, config='org.apache.struts.taglib.LocalStrings', returnNull=true
2007-7-30 13:29:59 org.apache.struts.util.PropertyMessageResources <init>
信息: Initializing, config='org.apache.struts.taglib.LocalStrings', returnNull=true
2007-7-30 13:29:59 org.apache.struts.util.PropertyMessageResources <init>
信息: Initializing, config='org.apache.struts.taglib.LocalStrings', returnNull=true
----------------解决方案--------------------------------------------------------
你是用的Struts吗??
应该是你的ACTION没设置跳转 这里应该是启动服务器的时候出现的配置文件信息吧
----------------解决方案--------------------------------------------------------
是用struts写的,也是启动服务器的时候出现的配置文件信息,没错.
我表单里的action是这样写的
<html:form action="/index">
有什么问题吗?
----------------解决方案--------------------------------------------------------
恩`
那个启动信息是没有错误的``
你改成这样试一下<html:form action="/index.do">
----------------解决方案--------------------------------------------------------
还是没有反应,又出现这样的错了,
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSConnection.<init>(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Source)
at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown Source)
at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)
at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
----------------解决方案--------------------------------------------------------
Gramary,我觉得你很热心,也很有才,
你当版主吧.
我投了你一票,支持你.
----------------解决方案--------------------------------------------------------
呵呵
谢谢啊`` 太抬举了`
你这是数据库出现在的问题``
你把你的 index.do对应的Action类的方法给我看看``
----------------解决方案--------------------------------------------------------
这是IndexAction:
public class IndexAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
IndexForm indexForm = (IndexForm) form;
HttpSession session = request.getSession();
IndexOper op = new IndexOper();
if(op.getControlResult(indexForm))
{
User user = op.get_user(indexForm);
session.setAttribute("user",user);
String uname = request.getParameter("user");
session.setAttribute("uname",uname);
return mapping.findForward("success");
}
return mapping.findForward("fail");
}
}
//这是IndexOper
public class IndexOper {
public boolean getControlResult(IndexForm user)
{
boolean flag = false;
Connection con=null;
PreparedStatement st=null;
ResultSet rs=null;
DBdrive db=new DBdrive();
try
{
con = db.getDBdrive();
st = con.prepareStatement("select * from administrator where user_name=? and user_pwd=? ");
st.setString(1,user.getUser_name());
st.setString(2,user.getUser_pwd());
rs = st.executeQuery();
while(rs.next())
{
if(user.getUser_name().equals(rs.getString(1))&&user.getUser_pwd().equals(rs.getString(2)));
flag=true;
}
return flag;
}
catch(Exception e)
{
return false;
}
finally
{
//db.CloseDBdriver();
}
}
public User get_user(IndexForm user){
Connection con=null;
PreparedStatement st=null;
ResultSet rs=null;
User us = new User();
DBdrive db=new DBdrive();
try
{
con = db.getDBdrive();
st = con.prepareStatement("select * from administrator where user_name=? and user_pwd=? ");
st.setString(1,user.getUser_name());
st.setString(2,user.getUser_pwd());
rs = st.executeQuery();
if(rs.next()){
us.setU_id(rs.getInt("user_id"));
us.setU_name(rs.getString("user_name"));
}
}catch(Exception e){
}
finally
{
//db.CloseDBdriver();
}
return us;
}
}
----------------解决方案--------------------------------------------------------
你有没有确定代码执行到哪里就报异常了啊````
你这种连接数据库的方式我没用过``一下子看不出来是什么问题
你要先确定程序执行到哪里``才出现的问题,这样就容易解决....
----------------解决方案--------------------------------------------------------
我试了好多次,
后台也不报错,
我在DBdriv(数据库连接文件)中的后台提示也没出来,
我想就是数据库连接的错误,
可又找不出到底是哪错了.
----------------解决方案--------------------------------------------------------