Menu

#28 XmlRpcServlet's init() method should call super.init()

open
nobody
None
5
2012-08-24
2012-08-24
fkal
No

XmlRpcServlet overrides the method "public void init( ServletConfig config ) throws ServletException" of javax.servlet.GenericServlet, but does not call super.init(). This will lead to multiple methods of GenericServlet, which depend on the ServletConfig being set in the config field, returning null, e.g. getServletConfig and getServletContext.

I went through the implementation of GenericServlet and HttpServlet and it seems like those methods are not used, but extendsion of XmlRpcServlet may do, so it makes sense to call super in my opinion.

Discussion

  • fkal

    fkal - 2012-08-30
     
  • fkal

    fkal - 2012-08-30

    Added a patch file as proposal for the fix.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.