掲示板

First class called after typing url in the browser

11年前 に Luca Lupo によって更新されました。

First class called after typing url in the browser

Regular Member 投稿: 106 参加年月日: 12/10/01 最新の投稿
Hi guys,

Do you know which is the first class called when a user inserts a url in the browser address bar and pushes enter?

Thanks

Luca
11年前 に Oliver Bayer によって更新されました。

RE: First class called after typing url in the browser

Liferay Master 投稿: 894 参加年月日: 09/02/18 最新の投稿
Hi Luca,

I'm not completly sure but my guess would be that one of the first classes which are called are filter or servlet classes (e.g. MainServlet, take a look at web.xml for the exact naming).

HTH Oli
thumbnail
11年前 に Mehdi norouzi によって更新されました。

RE: First class called after typing url in the browser

New Member 投稿: 20 参加年月日: 06/07/18 最新の投稿
Luca Lupo:
Hi guys,

Do you know which is the first class called when a user inserts a url in the browser address bar and pushes enter?

Thanks

Luca



Hi luca
It depends on url that user call. some parameter on url cause to different routing in user request but the best document in your case is web.xml. Allthing is obvioused in this file. if you are not familiar with web.xml element, you should indicate some sample url that you mean.
11年前 に Luca Lupo によって更新されました。

RE: First class called after typing url in the browser

Regular Member 投稿: 106 参加年月日: 12/10/01 最新の投稿
The case I'm going to a url representative of a layout (page in liferay).

localhost:8080/web/guest/home for example.

MainServlet was my first guess too but it's the wrong one. Cause in MainServlet there is already an HttpServletRequest that contains the layout id for example. So I'm guessing there is something before MainServlet.
thumbnail
11年前 に Gnaniyar Zubair によって更新されました。

RE: First class called after typing url in the browser

Liferay Master 投稿: 722 参加年月日: 07/12/19 最新の投稿
Hi,

I hope everytime you hit the URL, it goes to ServicePreAction / ServicePostAction .

Can you tell me the exact requirement what you are trying to achieve ..?


- Gnaniyar Zubair
11年前 に Luca Lupo によって更新されました。

RE: First class called after typing url in the browser

Regular Member 投稿: 106 参加年月日: 12/10/01 最新の投稿
It seems that when it reached MainServlet.java (method service) the request is already there, with elements such as layoutID, so that means something has to create such Request.

What I have to do is the following, when someone inserts a URL like this:

http://virtualhost.com/en/pageurl

liferay has to consider that the real URL would be http://virtualhost.com/en/web/community_name/pageurl
thumbnail
11年前 に Gnaniyar Zubair によって更新されました。

RE: First class called after typing url in the browser

Liferay Master 投稿: 722 参加年月日: 07/12/19 最新の投稿
Luca Lupo:
It seems that when it reached MainServlet.java (method service) the request is already there, with elements such as layoutID, so that means something has to create such Request.

What I have to do is the following, when someone inserts a URL like this:

http://virtualhost.com/en/pageurl

liferay has to consider that the real URL would be http://virtualhost.com/en/web/community_name/pageurl



If it is the case, then write your logic in ServicePreAction and redirect to that particular community adding "web/<community-name>" before that pare url.

But if you have lot of community in your portal, then how you would achieve this..?

- Gnaniyar Zubair
11年前 に Luca Lupo によって更新されました。

RE: First class called after typing url in the browser

Regular Member 投稿: 106 参加年月日: 12/10/01 最新の投稿
The class was btw I118Servlet emoticon