Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-174

'page' JSP tag throws NPE when page accessed via multipart form submission

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Resolution: Won't Fix
    • 3.0
    • None
    • Framework
    • None
    • Operating System: Other
      Platform: Other
    • 29132

    Description

      I have an app that is half Tapestry and half (sigh...) Struts. On a common link
      bar I use the tapestry page tag to create some links to some tapestry pages, as
      follows:

      <tapestry:page servlet='/auth' page='ManageUsers'>Users</tapestry:page>

      If I have a JSP page which does a multi-part form post to an action, and then
      that action does a normal forward to the display page, which then includes the
      above tag definition, I get a null pointer exception, as Tapestry wants to use
      the DefaultMultiPartFormDecoder, but the submission was not actually from tapestry.

      I think this line returns null
      return (Map) request.getAttribute(PART_MAP_ATTRIBUTE_NAME);
      which then causes a NPE on attempted usage of the partMap.

      Very very nasty. Is there any easy workaround? Stack trace follows:

      2004-05-20 17:55:33,974 ERROR [org.jboss.web.localhost.Engine]
      ApplicationDispatcher[/qa-portal] Servlet.service() for servlet qaportal threw
      exception
      java.lang.NullPointerException
      at
      org.apache.tapestry.multipart.DefaultMultipartDecoder.cleanup(DefaultMultipartDecoder.java:120)
      at org.apache.tapestry.request.RequestContext.cleanup(RequestContext.java:506)
      at org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:285)
      at org.apache.tapestry.ApplicationServlet.doPost(ApplicationServlet.java:326)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
      at
      org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
      at
      org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:575)
      at
      org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:498)
      at org.apache.tapestry.jsp.URLRetriever.insertURL(URLRetriever.java:82)
      at org.apache.tapestry.jsp.AbstractLinkTag.doStartTag(AbstractLinkTag.java:105)
      at
      org.apache.jsp.jadmfeditor_jsp._jspx_meth_tapestry_page_0(jadmfeditor_jsp.java:1706)
      at
      org.apache.jsp.jadmfeditor_jsp._jspx_meth_authz_authorize_4(jadmfeditor_jsp.java:1679)
      at org.apache.jsp.jadmfeditor_jsp._jspService(jadmfeditor_jsp.java:255)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
      at
      org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
      at
      org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
      at
      org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
      at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
      at
      org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
      at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
      at
      org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
      at
      org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)

      Attachments

        Activity

          People

            Unassigned Unassigned
            colins Colin Sampaleanu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: