gigaZhang / struts2-jquery

Automatically exported from code.google.com/p/struts2-jquery
0 stars 0 forks source link

Portlet Environment #949

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
It is impossible to upgrade struts2 jquery plugin from 3.3.3 to 3.5.1. 3.3.3 is 
working but in 3.5.1 I get this Stacktrace as you can see in attached file.

What steps will reproduce the problem?
1. Deploy portlet 
2. Try to show portlet

What is the expected output? What do you see instead?

The GUI as I saw in Plugin Version 3.3.3 and what I see instead is nothing.

Which struts2 version?
2.3.8

Which struts2-jquery plugin version?
3.5.1

Please provide any additional information below.
The portlet is written as liferay portlet and deployed to an instance of 
liferay-portal 6.1.0. 

In my web.xml I tried 3 configurations:
1.

<servlet id="Struts2PortletDispatcherServlet">
        <servlet-name>Struts2PortletDispatcherServlet</servlet-name>
        <servlet-class>org.apache.struts2.portlet.dispatcher.DispatcherServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>Struts2PortletDispatcherServlet</servlet-name>
        <url-pattern>*.action</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>Struts2PortletDispatcherServlet</servlet-name>
        <url-pattern>*.vsl</url-pattern>
    </servlet-mapping>
    <servlet-mapping>
        <servlet-name>Struts2PortletDispatcherServlet</servlet-name>
        <url-pattern>/struts/*</url-pattern>
    </servlet-mapping>

2.

<filter>
        <filter-name>strutsServletFilter</filter-name>
        <filter-class>org.apache.struts2.portlet.dispatcher.DispatcherServlet</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>strutsServletFilter</filter-name>
        <url-pattern>*.action</url-pattern>
    </filter-mapping>
    <filter-mapping>
        <filter-name>strutsServletFilter</filter-name>
        <url-pattern>*.vsl</url-pattern>
    </filter-mapping>
    <filter-mapping>
        <filter-name>strutsServletFilter</filter-name>
        <url-pattern>/struts/*</url-pattern>
    </filter-mapping>

3.

<filter>
        <filter-name>strutsServletFilter</filter-name>
        <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>strutsServletFilter</filter-name>
        <url-pattern>*.action</url-pattern>
    </filter-mapping>
    <filter-mapping>
        <filter-name>strutsServletFilter</filter-name>
        <url-pattern>*.vsl</url-pattern>
    </filter-mapping>
    <filter-mapping>
        <filter-name>strutsServletFilter</filter-name>
        <url-pattern>/struts/*</url-pattern>
    </filter-mapping>

but nothing worked. As I saig plugin Version 3.3.3 is working but I can't 
upgrade and I need some bugfixes and wan't to use menu-tag. Please help

Original issue reported on code.google.com by pascal.gehring@gmail.com on 19 Feb 2013 at 3:10

Attachments:

GoogleCodeExporter commented 9 years ago
Error is caused by line 34 in freemarker template file: 
"template/jquery/head.ftl".
<#assign schema=...

Reason is that a call to getRequestURL() is not allowed in a portlet (see 
javadoc for org.apache.struts2.portlet.servlet.PortletServletRequest).

I would suggest to use the getScheme() method as this seems to be OK in portlet 
context.

As a workaround replace the line in the mentioned file by:
<#assign schema="http">

Original comment by marzl....@gmail.com on 7 May 2013 at 8:36