Current URL /web/guest/HTML generates exception: null in Liferay 6.0.6

落花浮王杯 提交于 2019-12-22 00:26:09

问题


I develop an example of Struts2 with Jasper Reports and every thing work fine. In my index.jsp I have

index.jsp:

<body>
  <a href="HTML.action" target="_blank" >click to generate pdf report</a>
</body> 

struts.xml:

<struts>
  <package name="default" extends="struts-default,jasperreports-default">
    <action name="HTML" class="com.tutorialspoint.DataBeanList" method="exporte">
      <result name="success">/index.jsp</result>
    </action>
  </package>
</struts>

but when I want to do that with Liferay 6.0.6 I got this error:

INFO [PortalImpl:3829] Current URL /web/guest/HTML.action generates exception: null

In my struts.xml I have:

<!-- Action pour générer un rapport pdf -->

<package namespace="/reporting" extends="struts-portlet-default,json-default,jasperreports-default" name="reportingview"> 
  <action name="HTML" class="com.xxxxxx.struts2.actions.genererQPpdf" method="exporte">
    <result name="success">/JSPs/reporting/resultQP.jsp</result> 
  </action> 
</package>

so any one can help me.


回答1:


Better use the struts tags to exclude errors in the code. For example url tag could be used to construct the correct link that point to the action.

<a href="<s:url namespace="/reporting" action="HTML"/>" target="_blank" >click to generate pdf report</a>


来源:https://stackoverflow.com/questions/16876101/current-url-web-guest-html-generates-exception-null-in-liferay-6-0-6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!