1

have a problem with my liferay DXP, on 6.2 i have a hook that can display after a login if some condition occurred,now i want do the same with my hook on DXP.

on 6.2 have this tree : my-hook -> main -> webapp -> custom_jsps -> folder1 -> folder2 -> some jsps and in liferay-hook : i have <struts-action-path> and <struts-action-path-imp>

on DXP i can use event login.events.post, it's fired but can't display my jsp.

and i goolged without any progress. please could someone help me on this ?

Edit : here my class action :

    public class CustomerMultipleCtsAction extends Action  {

        private String final URL_LIST_CLIENT="/html/specificClient/list/listClient.jsp";

        @Override
            public void run(HttpServletRequest request, HttpServletResponse response)
                    throws ActionException {
        // check if has multiple client : 
                 HttpSession session = request.getSession(false);
                 boolean yes = checkclient(session );
                 if(yes){
                      response.sendRedirect(URL_LIST_CLIENT);
                 }
//.....
        }
        }

and my liferay-hook :

<hook>
    <portal-properties>portal.properties</portal-properties>
         <language-properties>
            i18n/messages*.properties
        </language-properties>
     <custom-jsp-dir>/custom_jsps</custom-jsp-dir>

<struts-action>
<struts-action-path>/portal/updateClient</struts-action-path>
<struts-action-impl>com.fr.total.uap.liferay.lubrifiant.hooks.userigg.UpdateClientAction</struts-action-impl>
</struts-action>
</hook>

and here it's my action after a user choose some client :

public class UpdateClientAction extends BaseStrutsAction {
    private static final Log LOGGER = LogFactoryUtil
            .getLog(UpdateClientAction.class);



    @Override
    public String execute(HttpServletRequest request,
            HttpServletResponse response) {
        String pathTo="/";
        try {
            // update client .....
            .....
            //
            String currentURL =(String)request.getSession().getAttribute("currentURL");
            // Redirect to the choosen group
            pathTo=portalURL.concat(currentURL);
            response.sendRedirect(pathTo);
        } catch (Exception e) {
            LOGGER.error(e.getMessage(), e);
        }
        return pathTo;
    }

hope you have all information you need thanks

KhairiB
  • 45
  • 1
  • 8
  • we know that you want to "display", and we know "some condition". For me, this is not enough to think of an alternative solution - I don't even know what you have implemented so far. I'd recommend to describe the (business) usecase, *as well as* post some sample code of your existing solution. Liferay's notification system might provide a completely different solution, depending on the underlying problem that you're trying to solve. – Olaf Kock Nov 13 '18 at 11:26
  • @OlafKock i update my question to give you more information, do you have any idea to this ? – KhairiB Nov 14 '18 at 08:12
  • When you say "can't display my jsp": Do you mean that the redirect is sent, but your page is not shown - e.g. results in 404? Or the redirect is not sent? – Olaf Kock Nov 17 '18 at 21:50
  • where are you setting login.events.post ? is it calling the CustomerMultipleCtsAction – Lakshmi Mar 04 '21 at 17:18

0 Answers0