Stripes

EmptyStack exception occurs when layout-render name doesn't start with a slash

Details

Description

When a layout-render tag's name attribute doesn't start with a slash a StackEmpty exception occurs which gives no indication of the actual problem. If the name doesn't start with a slash the tag should throw an exception which clearly indicates the actual problem.

Activity

Hide
Frederic Daoud added a comment - 27/Sep/08 8:06 PM

Aaron, can you give a specific example to reproduce this problem? When I try rendering a layout with a name that doesn't start with a slash, I get this message:

net.sourceforge.stripes.exception.StripesJspException: Attempt made to render a layout that does not exist. The layout name provided was 'WEB-INF/jsp/layout.jsp'. Please check that a JSP/view exists at that location within your web application.

Thanks,
Freddy

Show
Frederic Daoud added a comment - 27/Sep/08 8:06 PM Aaron, can you give a specific example to reproduce this problem? When I try rendering a layout with a name that doesn't start with a slash, I get this message: net.sourceforge.stripes.exception.StripesJspException: Attempt made to render a layout that does not exist. The layout name provided was 'WEB-INF/jsp/layout.jsp'. Please check that a JSP/view exists at that location within your web application. Thanks, Freddy
Hide
Frederic Daoud added a comment - 13/Oct/08 8:21 PM

Still could not reproduce this problem. With Jetty, I get the exception above, and with Tomcat, I get javax.servlet.ServletException: File "/WEB-INF/jsp/WEB-INF/jsp/layout.jsp" not found.

Any hints on how to reproduce the problem? Maybe it's a specific version of a specific servlet container? Maybe the name in the <s:layout-render> tag is particular?

Show
Frederic Daoud added a comment - 13/Oct/08 8:21 PM Still could not reproduce this problem. With Jetty, I get the exception above, and with Tomcat, I get javax.servlet.ServletException: File "/WEB-INF/jsp/WEB-INF/jsp/layout.jsp" not found. Any hints on how to reproduce the problem? Maybe it's a specific version of a specific servlet container? Maybe the name in the <s:layout-render> tag is particular?
Hide
Frederic Daoud added a comment - 03/Nov/08 9:20 AM

I was finally able to reproduce the problem. Indeed, paths that do not start with a slash cause hard-to-decipher exceptions.

My question is, should paths in the name= attribute of the layout-render tag be required to start with a slash? If so, should we check for that and throw an exception with a clear message? If we do that, we'll break existing apps that use paths that do not start with a slash. But, does the layout-render tag ever work if the path doesn't start with a slash? I tried a simple test and it didn't work.

Show
Frederic Daoud added a comment - 03/Nov/08 9:20 AM I was finally able to reproduce the problem. Indeed, paths that do not start with a slash cause hard-to-decipher exceptions. My question is, should paths in the name= attribute of the layout-render tag be required to start with a slash? If so, should we check for that and throw an exception with a clear message? If we do that, we'll break existing apps that use paths that do not start with a slash. But, does the layout-render tag ever work if the path doesn't start with a slash? I tried a simple test and it didn't work.
Hide
Frederic Daoud added a comment - 21/Jan/09 8:51 AM

Fixed in build 1032 (trunk) and 1033 (1.5.x). An exception is thrown if the name= attribute of the layout-render tag does not start with a forward slash. Absolute paths should always be used in layouts.

Show
Frederic Daoud added a comment - 21/Jan/09 8:51 AM Fixed in build 1032 (trunk) and 1033 (1.5.x). An exception is thrown if the name= attribute of the layout-render tag does not start with a forward slash. Absolute paths should always be used in layouts.
Hide
rajani goteti added a comment - 21/Mar/11 2:39 PM

Hi All,

I'm new to Stripes and was trying to run the samples from the Stripes book.I get the below exception when running the email2 example. I'm using Stripes- 1.5.6. Please let me know if I'm missing anything.

org.apache.jasper.JasperException: javax.servlet.ServletException: net.sourceforge.stripes.exception.StripesJspException: An exception was raised while invoking a layout. The layout used was '/WEB-INF/jsp/common/layout_main.jsp'. The following information was supplied to the render tag: LayoutContext{component names=[body], parameters={title=Contact List}}

Thanks for your help in advance.

Thanks,
Rajani.

Show
rajani goteti added a comment - 21/Mar/11 2:39 PM Hi All, I'm new to Stripes and was trying to run the samples from the Stripes book.I get the below exception when running the email2 example. I'm using Stripes- 1.5.6. Please let me know if I'm missing anything. org.apache.jasper.JasperException: javax.servlet.ServletException: net.sourceforge.stripes.exception.StripesJspException: An exception was raised while invoking a layout. The layout used was '/WEB-INF/jsp/common/layout_main.jsp'. The following information was supplied to the render tag: LayoutContext{component names=[body], parameters={title=Contact List}} Thanks for your help in advance. Thanks, Rajani.

People

Vote (0)
Watch (0)

Dates

  • Created:
    11/Jul/08 11:31 AM
    Updated:
    21/Mar/11 2:39 PM
    Resolved:
    21/Jan/09 8:51 AM