掲示板

company.security.strangers.url

thumbnail
12年前 に Trevor Ackerman によって更新されました。

company.security.strangers.url

New Member 投稿: 9 参加年月日: 11/11/17 最新の投稿
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
7年前 に Matt Schiedermayer によって更新されました。

RE: company.security.strangers.url

New Member 投稿: 1 参加年月日: 16/04/28 最新の投稿
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.