Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-2953

tiles:insert with beanName and tiles-defs.xml causes JspException

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.3.5
    • Fix Version/s: None
    • Component/s: Tiles 1 Plugin
    • Labels:
      None
    • Environment:
      Struts 1.3.5, Windows, Eclipse, Weblogic, Intel
    • Flags:
      Important

      Description

      The tutorial is wrong !?

      On page http://struts.apache.org/1.3.5/struts-tiles/examples.html
      there is an example page built with a tile definition in a tiles-defs.xml file
      which uses

      <tiles:insert beanName="templateDefinition" />

      This causes an exception

      javax.servlet.jsp.JspException: Error - Tag Insert : No value defined for bean 'tiles.login' with property 'null' in scope 'null'.
      at org.apache.struts.tiles.taglib.InsertTag.processBean(Ljava.lang.String;Ljava.lang.String;Ljava.lang.String;)Lorg.apache.struts.tiles.taglib.InsertTag$TagHandler;(InsertTag.java:664)
      at org.apache.struts.tiles.taglib.InsertTag.createTagHandler()Lorg.apache.struts.tiles.taglib.InsertTag$TagHandler;(InsertTag.java:480)
      at org.apache.struts.tiles.taglib.InsertTag.doStartTag()I(InsertTag.java:438)
      at jsp_servlet._login._jspService(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(_login.java:144)
      at weblogic.servlet.jsp.JspBase.service(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;)V(JspBase.java:33)
      at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run()Ljava.lang.Object;(ServletStubImpl.java:996)
      at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;Lweblogic.servlet.internal.FilterChainImpl;)V(ServletStubImpl.java:419)
      at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;Lweblogic.servlet.internal.FilterChainImpl;)V(ServletStubImpl.java:463)
      at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;)V(ServletStubImpl.java:315)
      at weblogic.servlet.internal.RequestDispatcherImpl.forward(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;)V(RequestDispatcherImpl.java:312)
      at weblogic.servlet.jsp.PageContextImpl.forward(Ljava.lang.String;)V(PageContextImpl.java:150)
      at jsp_servlet._index._jspService(Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)V(_index.java:122)
      at weblogic.servlet.jsp.JspBase.service(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;)V(JspBase.java:33)
      at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run()Ljava.lang.Object;(ServletStubImpl.java:996)
      at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;Lweblogic.servlet.internal.FilterChainImpl;)V(ServletStubImpl.java:419)
      at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;Lweblogic.servlet.internal.FilterChainImpl;)V(ServletStubImpl.java:463)
      at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax.servlet.ServletRequest;Ljavax.servlet.ServletResponse;)V(ServletStubImpl.java:315)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run()Ljava.lang.Object;(WebAppServletContext.java:6452)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic.security.subject.AbstractSubject;Ljava.security.PrivilegedAction;)Ljava.lang.Object;(AuthenticatedSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(Lweblogic.security.acl.internal.AuthenticatedSubject;Lweblogic.security.acl.internal.AuthenticatedSubject;Ljava.security.PrivilegedAction;)Ljava.lang.Object;(SecurityManager.java:118)
      at weblogic.servlet.internal.WebAppServletContext.invokeServlet(Lweblogic.servlet.internal.ServletRequestImpl;Lweblogic.servlet.internal.ServletResponseImpl;)V(WebAppServletContext.java:3661)
      at weblogic.servlet.internal.ServletRequestImpl.execute(Lweblogic.kernel.ExecuteThread;)V(ServletRequestImpl.java:2630)
      at weblogic.kernel.ExecuteThread.execute(Lweblogic.kernel.ExecuteRequest;)V(ExecuteThread.java:219)
      at weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:178)
      at java.lang.Thread.startThreadFromVM(Ljava.lang.Thread;)V(Unknown Source)

      BUT !!! it works if you replace beanName with definition like this:

      <tiles:insert definition="templateDefinition" />

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              dumitru Husleag Dumitru
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: