[
https://issues.apache.org/jira/browse/WW-3763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13214380#comment-13214380
]
Lukasz Lenart commented on WW-3763:
-----------------------------------
I think the problem is in PortletRenderUrl.java, line 71 in method renderUrl().
In the previous version [1], if portlet context was unavailable, renderer used
ServletUrlRenderer, but now that logic is missing.
Please add this to that method (PortletRenderUrl.java, line 71):
{code}
public void renderUrl(Writer writer, UrlProvider urlComponent) {
if (PortletActionContext.getPortletContext() == null ||
"none".equalsIgnoreCase(urlComponent.getPortletUrlType())) {
servletRenderer.renderUrl(writer, urlComponent);
return;
}
...
{code}
[1]
https://svn.apache.org/repos/asf/struts/archive/plugins/struts2-portlet-plugin/src/main/java/org/apache/struts2/components/PortletUrlRenderer.java
> Struts Portlet Plugin Version 2.3.1.2 Breaks Using Struts Project For Both
> Portlet and Standalone Application
> -------------------------------------------------------------------------------------------------------------
>
> Key: WW-3763
> URL: https://issues.apache.org/jira/browse/WW-3763
> Project: Struts 2
> Issue Type: Bug
> Components: Plugin - Portlet
> Affects Versions: 2.3.1.2
> Environment: Java JDK 6, Tomcat 6
> Reporter: Bruce Phillips
>
> I've got a few Struts application where I use the Struts 2 portlet plugin to
> create a portlet and still have a standalone web application.
> This worked fine through Struts 2 portlet plugin version 2.2.1.1. For an
> example of this problem download and unzip this Eclipse/Maven project:
>
> http://code.google.com/p/struts2-examples/downloads/detail?name=Struts2CRUDPortletExample_Finish.zip
> (read the README.txt file for how to build/deploy).
> This project uses Struts 2.2.1.1. It builds a war file that when deployed to
> Tomcat will register a portlet (that can be used in the Pluto portal
> container) and a web application that can be accessed via calls to Struts
> Actions.
> I tried to upgrade this project to use Struts version 2.3.1.2 (both core and
> portlet plugin). The port let still works fine. But after upgrading to
> 2.3.1.2 when trying to load an action for the standalone version (an action
> defined in package extends="struts-default") I get the following exception:
> Struts Problem Report
> Struts has detected an unhandled exception:
> Messages:
> java.lang.reflect.InvocationTargetException
> java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
> java.lang.RuntimeException: java.lang.RuntimeException:
> java.lang.reflect.InvocationTargetException
> java.lang.RuntimeException: java.lang.RuntimeException:
> java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
> An exception occurred processing JSP page /jsp/employees.jsp at line 5 2:
> <%@ taglib prefix="s" uri="/struts-tags" %> 3: 4: 5: 6: 7: 8: Stacktrace:
> File: org/apache/struts2/portlet/context/PortletActionContext.java
> Line number: 225
> Stacktraces
> org.apache.jasper.JasperException: An exception occurred processing JSP page
> /jsp/employees.jsp at line 5 2: <%@ taglib prefix="s" uri="/struts-tags" %>
> 3: 4: 5: 6: 7: 8: Stacktrace:
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira