Grails

jsp:include doesn't work

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.1-beta3
  • Fix Version/s: None
  • Component/s: TagLib
  • Labels:
    None

Description

In 1.1 beta 2, JSP tag are supposed to be supported. 1.1 beta 3 should support server side include. so, jsp:include should work?!

the following is displayed in HTML

<jsp:include page="test.gsp" flush="true"/>

i didn't put any <%@ taglib tag on top, maybe all <jsp: tag won't work

Activity

Hide
Graeme Rocher added a comment -

Can you not use the new <g:include> tag?

Show
Graeme Rocher added a comment - Can you not use the new <g:include> tag?
Hide
Mingfai Ma added a comment -

first of all, i'm in fact trying to include a php page which is served by a servlet outside grails.

i wasn't sure if g:include support including a page by url. tried the following and it doesn't work:

<g:include page="test.php"/>
<g:include url="test.php"/>

in a JSP, <jsp:include page="test.php"/> does work and can include the PHP rendered content.

so the 1.1 beta 2 JSP tag support actually support all JSP tags except <jsp: ...

Show
Mingfai Ma added a comment - first of all, i'm in fact trying to include a php page which is served by a servlet outside grails. i wasn't sure if g:include support including a page by url. tried the following and it doesn't work:
<g:include page="test.php"/>
<g:include url="test.php"/>
in a JSP, <jsp:include page="test.php"/> does work and can include the PHP rendered content. so the 1.1 beta 2 JSP tag support actually support all JSP tags except <jsp: ...
Hide
Mingfai Ma added a comment -

as a workaround, assume there is a web-app/incl.php

<p><%=application.getResource('/incl.php').text%></p>

Notice that the above line make a separated http socket connection from the server to itself. it is non-scalable and is a bad practice

Show
Mingfai Ma added a comment - as a workaround, assume there is a web-app/incl.php
<p><%=application.getResource('/incl.php').text%></p>
Notice that the above line make a separated http socket connection from the server to itself. it is non-scalable and is a bad practice
Hide
Franki Sans added a comment -

You can import the core taglib on the GSP page

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

and use the import tag:

<c:import url="/prova1.php" charEncoding="ISO-8859-1" />

The charEncoding is useful when the encoding of the PHP pages is diferent from the GSP encoding.

Show
Franki Sans added a comment - You can import the core taglib on the GSP page <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> and use the import tag: <c:import url="/prova1.php" charEncoding="ISO-8859-1" /> The charEncoding is useful when the encoding of the PHP pages is diferent from the GSP encoding.

People

Vote (3)
Watch (1)

Dates

  • Created:
    Updated:
    Last Reviewed: