诚意请Struts各级程序员帮助在下解决一个问题。

lovepower1982 2004-08-26 02:30:42
在下有这样一个Struts问题,我在一个类中写好了一个SQL语句,然后在一个action中调用它,结果却一直报这样的错误:
2004-8-26 10:07:16 org.apache.struts.util.PropertyMessageResources <init>

信息: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true

2004-8-26 10:07:16 org.apache.struts.util.PropertyMessageResources <init>

信息: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true
请问是什么意思?
在下的源代码是这样的:
SQL语句的那个方法是:
package com.QMPower.project;

import java.sql.*;
import com.QMPower.base.*;


public class AtuOst {

private String getAtResultSQL = "";
private String setAtResultSQL = "";
private Connection cn = null;
private PreparedStatement setAtResultStmt = null;
private PreparedStatement getAtResultStmt = null;

public String getAtResult(String aLogid){
String atResult = "";
ResultSet rs = null;

try{
String getAtResultSQL ="select LOGID from USERMANAGE";
// 得到数据库连接
cn = DBManager.getConnection();
getAtResultStmt = cn.prepareStatement(getAtResultSQL);
rs = getAtResultStmt.executeQuery();
System.out.println("111111111111111");
}
catch(SQLException e){
e.printStackTrace();
}
return atResult;
}
}

调用这个SQL语句的Action是:
package com.QMPower.project;

import org.apache.struts.action.*;
import javax.servlet.http.*;
import com.QMPower.project.AtuOst;


public class UserAction extends Action {
public ActionForward execute(ActionMapping actionMapping,
ActionForm actionForm,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse) {

ActionForward forward = new ActionForward();
UserForm theForm = (UserForm) actionForm;
AtuOst load = new AtuOst();
String str = load.getAtResult("1");

if (theForm.getUsername().equals(str)) {
return actionMapping.findForward("success");
}
else {
forward = actionMapping.findForward("errors");
}
return (forward);
}
}

我的Config-xml是:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
<struts-config>
<form-beans>
<form-bean name="UserForm" type="mystruts.UserForm" />
</form-beans>
<action-mappings>
<action name="UserForm" type="com.QMPower.project.UserAction" validate="true" input="/logon.jsp" scope="request" path="/logon">
<forward name="success" path="/index.jsp" />
<forward name="errors" path="/error.jsp" />
</action>
</action-mappings>
</struts-config>
请问是不是因为没有在action中调用datasource导致错误?如果需要调用这个datasource,应该怎么写入?
...全文
70 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
lovepower1982 2004-08-26
  • 打赏
  • 举报
回复
我也不知道,在下确确实实无法运行……
swiminthesea 2004-08-26
  • 打赏
  • 举报
回复
我觉得这可能不是错误
swiminthesea 2004-08-26
  • 打赏
  • 举报
回复
2004-8-26 10:07:16 org.apache.struts.util.PropertyMessageResources <init>

信息: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true

2004-8-26 10:07:16 org.apache.struts.util.PropertyMessageResources <init>

信息: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true

我也常常遇到这个,但是好像并没有什么影响,程序能正常执行

67,549

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧