Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
Luca Lupo
First class called after typing url in the browser
16. Januar 2013 23:34
Antwort

Luca Lupo

Rang: Regular Member

Nachrichten: 106

Eintrittsdatum: 1. Oktober 2012

Neue Beiträge

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
Oliver Bayer
RE: First class called after typing url in the browser
17. Januar 2013 00:41
Antwort

Oliver Bayer

Rang: Liferay Master

Nachrichten: 889

Eintrittsdatum: 18. Februar 2009

Neue Beiträge

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
Mehdi norouzi
RE: First class called after typing url in the browser
17. Januar 2013 01:27
Antwort

Mehdi norouzi

Rang: New Member

Nachrichten: 19

Eintrittsdatum: 17. Juli 2006

Neue Beiträge

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.
Luca Lupo
RE: First class called after typing url in the browser
17. Januar 2013 01:35
Antwort

Luca Lupo

Rang: Regular Member

Nachrichten: 106

Eintrittsdatum: 1. Oktober 2012

Neue Beiträge

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.
Kowbathullah Gnaniyar
RE: First class called after typing url in the browser
19. Januar 2013 22:40
Antwort

Kowbathullah Gnaniyar

Rang: Liferay Master

Nachrichten: 608

Eintrittsdatum: 19. Dezember 2007

Neue Beiträge

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
Luca Lupo
RE: First class called after typing url in the browser
21. Januar 2013 09:25
Antwort

Luca Lupo

Rang: Regular Member

Nachrichten: 106

Eintrittsdatum: 1. Oktober 2012

Neue Beiträge

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
Kowbathullah Gnaniyar
RE: First class called after typing url in the browser
23. Januar 2013 04:00
Antwort

Kowbathullah Gnaniyar

Rang: Liferay Master

Nachrichten: 608

Eintrittsdatum: 19. Dezember 2007

Neue Beiträge

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
Luca Lupo
RE: First class called after typing url in the browser
27. Januar 2013 13:52
Antwort

Luca Lupo

Rang: Regular Member

Nachrichten: 106

Eintrittsdatum: 1. Oktober 2012

Neue Beiträge

The class was btw I118Servlet emoticon