Grails

Can't use <c:import...> to import gsp under /WEB-INF

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.0.1
  • Fix Version/s: 1.0.2
  • Component/s: Commons
  • Labels:
    None

Description

<c:import ...> can't be used to import a gsp file located under WEB-INF: it is looked at the wrong place under grails-app/views

with web-app/test.jsp containing:
-----------------
<%@ taglib uri="/tags/core" prefix="c" %>
<c:import url="/WEB-INF/test.gsp" />
-----------------

and for instance an empty web-app/WEB-INF/test.gsp, following errors is generated

org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: I/O error reading stream for resource [file [/home/marc/EWorkspace/junetz/grails-app/views/WEB-INF/test.gsp]]: grails-app/views/WEB-INF/test.gsp (No such file or directory)
at org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireString(ImportSupport.java:296)
at org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTag(ImportSupport.java:161)
at org.apache.jsp.test_jsp._jspx_meth_c_import_0(org.apache.jsp.test_jsp:86)
at org.apache.jsp.test_jsp._jspService(org.apache.jsp.test_jsp:60)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
Caused by: java.io.FileNotFoundException: grails-app/views/WEB-INF/test.gsp (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
... 16 more

Activity

Hide
Graeme Rocher added a comment -

I wouldn't call this a blocker, scheduled for 1.0.2. Please attach a sample app that reproduces the problem.

Show
Graeme Rocher added a comment - I wouldn't call this a blocker, scheduled for 1.0.2. Please attach a sample app that reproduces the problem.
Hide
Marc Guillemot added a comment -

I agree, it is not blocker: it is critical when you try to convince people to migrate a Struts 1 app to Grails

Show
Marc Guillemot added a comment - I agree, it is not blocker: it is critical when you try to convince people to migrate a Struts 1 app to Grails
Hide
Marc Guillemot added a comment -

Demo app demonstrating the bug. Only 2 resources matters:
web-app/test.jsp
and
web-app/WEB-INF/test.gsp

Browsing to /test,jsp produce following error:

org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: I/O error reading stream for resource [file [/home/marc/fmr/bugCImport/grails-app/views/WEB-INF/test.gsp]]: grails-app/views/WEB-INF/test.gsp (No such file or directory)
at org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireString(ImportSupport.java:296)
at org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTag(ImportSupport.java:161)
at org.apache.jsp.test_jsp._jspx_meth_c_import_0(org.apache.jsp.test_jsp:81)
at org.apache.jsp.test_jsp._jspService(org.apache.jsp.test_jsp:54)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
Caused by: java.io.FileNotFoundException: grails-app/views/WEB-INF/test.gsp (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
... 8 more

Show
Marc Guillemot added a comment - Demo app demonstrating the bug. Only 2 resources matters: web-app/test.jsp and web-app/WEB-INF/test.gsp Browsing to /test,jsp produce following error: org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: I/O error reading stream for resource [file [/home/marc/fmr/bugCImport/grails-app/views/WEB-INF/test.gsp]]: grails-app/views/WEB-INF/test.gsp (No such file or directory) at org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireString(ImportSupport.java:296) at org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTag(ImportSupport.java:161) at org.apache.jsp.test_jsp._jspx_meth_c_import_0(org.apache.jsp.test_jsp:81) at org.apache.jsp.test_jsp._jspService(org.apache.jsp.test_jsp:54) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) Caused by: java.io.FileNotFoundException: grails-app/views/WEB-INF/test.gsp (No such file or directory) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.<init>(FileInputStream.java:106) ... 8 more
Hide
Graeme Rocher added a comment -

the attached zip doesn't contain the jsp or gsp, grails bug-report doesn't zip this up. Please zip up and attach one including jsp/gsp resources

Show
Graeme Rocher added a comment - the attached zip doesn't contain the jsp or gsp, grails bug-report doesn't zip this up. Please zip up and attach one including jsp/gsp resources
Hide
Marc Guillemot added a comment -

web-app/test.jsp

Show
Marc Guillemot added a comment - web-app/test.jsp
Hide
Marc Guillemot added a comment -

web-app/WEB-INF/test.gsp

Show
Marc Guillemot added a comment - web-app/WEB-INF/test.gsp
Hide
Graeme Rocher added a comment -

Bulk closing bunch of resolved issues

Show
Graeme Rocher added a comment - Bulk closing bunch of resolved issues

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: