空指针错误解决不了了 ssi框架 就想写在页面里输入内容 提交到表里 结果表单一提交 就这样了 沾了部分代码 求高手帮忙 菜鸟小弟多谢了
错误如下
严重:
Servlet.service() for servlet default threw exceptionjava.lang.NullPointerException at com.javasky.action.addWeapons.add(addWeapons.java:87)
at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)
at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)
at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:229)
at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
。。。。。。。。。。
我的配置如下
applicationContext如下
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" >
<property name="driverClassName">
<value>oracle.jdbc.driver.OracleDriver</value>
</property>
<property name="url">
<value>jdbc:oracle:thin:@localhost:1521:MYORACLE</value>
</property>
<property name="username">
<value>MYD</value>
</property>
<property name="password">
<value>12345</value>
</property>
</bean>
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation">
<value>classpath:SqlMapConfig.xml</value>
</property>
<property name="dataSource">
<ref local="dataSource"/>
</property>
</bean>
<bean id="weapons" class="com.javasky.bean.weapons"></bean>
<bean id="wdaoimpl"
class="com.javasky.dao.impl.weaponsDaoImpl">
<property name="sqlmapclient" ref="sqlMapClient"/>
<property name="gun" ref="weapons"/>
</bean>
<bean id="wserviceimpl"
class="com.javasky.service.impl.weaponserviceimpl">
<property name="weapons" ref="wdaoimpl"/>
<property name="gun" ref="weapons"/>
</bean>
<bean id="waddweapons" class="com.javasky.action.addWeapons">
<property name="ws" ref="wserviceimpl"></property>