0

I'm trying to embed my jsp script 'test.jsp' into iframe in my Magnolia application using Vaadin 7' BrowserFrame:

browser = new BrowserFrame("", new ExternalResource("../VAADIN/test.jsp"));

File 'test.jsp' looks like:

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>My JSP page.</title>
</head>
<body>

Current time: <%= new java.util.Date() %>

</body>
</html>

The output is:

<%@ page contentType="text/html;charset=UTF-8" language="java" %> Current time: <%= new java.util.Date() %> 

So as you can see it isn't rendered at all.

I'm using Magnolia 5.2.5 which runs on Tomcat 7.0.47.

Tomcat web.xml jsp config:

<servlet>
    <servlet-name>jsp</servlet-name>
    <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
    <init-param>
        <param-name>fork</param-name>
        <param-value>false</param-value>
    </init-param>
    <init-param>
        <param-name>xpoweredBy</param-name>
        <param-value>false</param-value>
    </init-param>
    <load-on-startup>3</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>jsp</servlet-name>
    <url-pattern>*.jsp</url-pattern>
    <url-pattern>*.jspx</url-pattern>
</servlet-mapping>

magnoliaAuthor web.xml jsp config:

<jsp-config>
    <jsp-property-group>
      <url-pattern>*.jsp</url-pattern>
      <page-encoding>UTF-8</page-encoding>
    </jsp-property-group>
</jsp-config>

And I believe my topic is linked with this but author didn't specified detailed solution.

Does anyone know the solution for my problem? Thanks in advance.

Community
  • 1
  • 1
Superior
  • 21
  • 1

2 Answers2

0

Your problem is not related to the one you linked. Person there was trying to build a template to render on Magnolia powered web, you are building resource that you want to be rendered in Magnolia's UI. His problem was solved by specifying {renderType=jsp} in his template configuration. You don't seem to even have template, just JSP. Try to render that JSP directly. Is it rendered? I don't think so, I think you get plain JSP content back. If I'm not mistaken your JSP is located at the place where JSP compiler is not expecting it and thus it is not getting compiled. In the very least you will need to configure bypass for this page in Magnolia's filter chain to make sure Magnolia doesn't try to render your JSP itself.

HTH, Jan

Jan
  • 4,369
  • 14
  • 25
0

Don't change web.xml Try to add jsp file to /docroot and invoke http://host/docroot/test.jsp