开发者

javax.servlet.ServletException: null

Recieved the following error whilst testing a small apache strut based web application ive been working on, the crux of the matter is that somehow a null httpservletrequest request parameter was passed to an Actionforward Execute function within an extened Action class??

My knowledge of struts usage is limited so, an explainition of this erranous behaviour is beyond me, any help greatly appreciated. Exception included below..

javax.servlet.ServletException: null
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)    

org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

java.lang.NumberFormatException: null
java.lang.Integer.parseInt(Unknown Source)
java.lang.Integer.parseInt(Unknown Source)

org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)

org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


note The full stack trace of the root cause开发者_开发问答 is available in the Apache
Tomcat/5.5.4 logs.


Apologies for not getting back to this sooner..

The error described was caused by a missing serviceForm Bean specification within an action mapping in struts-config.xml. The first time the user navigated to the offending web page the ServiceForm bean did not exist, so was created to store relative actionForm values (no errors occured).

However when the user tried to navigate back to the web page after being elsewhere, access was attempted to the created serviceForm bean data, which hadn't been specified in the strut.. hence the null pointer crash..

Eg. name="serviceForm" was missing.

<action path="/pages/networkconfig/listUIServices"
        type="com.UIServiceListAction"
        name="serviceForm" 
        scope="request"
        validate="false">
    <forward name="view" path="/pages/networkconfig/uiservices_list.jsp"/>
</action>   

Hope this explainition is helpful..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜