Fórum

company.security.strangers.url

thumbnail
Trevor Ackerman, modificado 12 Anos atrás.

company.security.strangers.url

New Member Postagens: 9 Data de Entrada: 17/11/11 Postagens Recentes
I understand that I can enter a friendly URL for this property like so
company.security.strangers.url=/registration1

However I would like to also pass an action parameter to one of the portlets on the page mentioned above.
(Specifically go to page registration1 and have the login portlet there present the create account view)

On my browser I can get exactly what I want by entering the following URL
http://localhost:8080/registration1/-/58?_58_struts_action=%2Flogin%2Fcreate_account

I have also figured out how to get what I want by writing a hook for the login portlet, but I want to know how to do this without resorting to a hook.

Does anyone know the answer?

Thanks
Matt Schiedermayer, modificado 7 Anos atrás.

RE: company.security.strangers.url

New Member Mensagem: 1 Data de Entrada: 28/04/16 Postagens Recentes
Hi Trevor,

The portlets have to handle it themselves, usually in a url parameter. For example, on the login portlet. Say for example, you were viewing the site as a Guest (anonymous User) and you clicked a link to a page that requires an authenticated Liferay User for view rights. Liferay will automatically direct the user to the login portlet with one of the URL parameters being &_58_redirect=%2Fpage%2Fsubpage. As long as you are still in the same Site (or Community for version before 6) the login portlet knows that it uses its normal friendly URL/virtual host URL and appends /page/subpage to the URL after login is complete(ex: www.myliferaysitedomain.com/page/subpage). The parameter and redirect in this example is handled in the standard LoginAction class. As long as you have a custom portlet or are overriding a standard portlet you can handle a redirect in Java code, or possibly even JavaScript.