初学SPRING框架,遇到点问题。。。 才学习框架,没一点头绪,在网络上找了本《SPRING入门》 夏昕的。。 但是上面第一个例子就运行不了。。 各位高手给点意见把 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 例子:package net.zhenwu.spring.qs;public class HelloAction implements Action { private String message; public String getMessage() { return message; } public void setMessage(String string) { message = string; } public String execute(String str) { return (getMessage() + str).toUpperCase(); } }测试类:public void testQuickStart() { ApplicationContext ctx=new FileSystemXmlApplicationContext("bean.xml"); Action action = (Action) ctx.getBean("TheAction"); System.out.println(action.execute("Rod Johnson")); }配置bean.xml<beans><description>Spring Quick Start</description><bean id="TheAction" class="net.zhenwu.spring.qs.HelloAction"><property name="message"><value>HeLLo</value></property></bean></beans>错误提示:java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory我加载了SPRING.JAR包和JDK 包 你光加载SPRING.JAR是不够的,还要加载日志相关的包 终于明白java是何等的垃圾 [新人求解]用GridBagLayout设计图形界面 windowListener是否放在setVisible之前才有效? 请教一个TimeTask的问题 java小程序,比较三个数大小,如何在页面实现输出 怎么读入数据到文件中?? Struts2 Action-validation.xml 参数设置 如何在swing的应用程序中实现图片导行 请教一个困惑我很久的问题?? 设置一个方法的最好方法? 如何让数组降序排列 字符串数组问题
package net.zhenwu.spring.qs;
public class HelloAction implements Action {
private String message;
public String getMessage() {
return message;
}
public void setMessage(String string) {
message = string;
}
public String execute(String str) {
return (getMessage() + str).toUpperCase();
}
}测试类:
public void testQuickStart() {
ApplicationContext ctx=new FileSystemXmlApplicationContext("bean.xml");
Action action = (Action) ctx.getBean("TheAction");
System.out.println(action.execute("Rod Johnson"));
}
配置bean.xml
<beans>
<description>Spring Quick Start</description>
<bean id="TheAction" class="net.zhenwu.spring.qs.HelloAction">
<property name="message">
<value>HeLLo</value>
</property>
</bean>
</beans>
错误提示:java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory我加载了SPRING.JAR包和JDK 包