简体   繁体   中英

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

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.

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM