Tribune

Home » Liferay Portal » English » 3. Development

Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Luca Lupo
First class called after typing url in the browser
16 gennaio 2013 23.34
Risposta

Luca Lupo

Punteggio: Regular Member

Messaggi: 106

Data di Iscrizione: 1 ottobre 2012

Messaggi recenti

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 gennaio 2013 0.41
Risposta

Oliver Bayer

Punteggio: Liferay Master

Messaggi: 881

Data di Iscrizione: 18 febbraio 2009

Messaggi recenti

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 gennaio 2013 1.27
Risposta

Mehdi norouzi

Punteggio: New Member

Messaggi: 19

Data di Iscrizione: 17 luglio 2006

Messaggi recenti

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 gennaio 2013 1.35
Risposta

Luca Lupo

Punteggio: Regular Member

Messaggi: 106

Data di Iscrizione: 1 ottobre 2012

Messaggi recenti

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 gennaio 2013 22.40
Risposta

Kowbathullah Gnaniyar

Punteggio: Liferay Master

Messaggi: 603

Data di Iscrizione: 19 dicembre 2007

Messaggi recenti

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 gennaio 2013 9.25
Risposta

Luca Lupo

Punteggio: Regular Member

Messaggi: 106

Data di Iscrizione: 1 ottobre 2012

Messaggi recenti

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 gennaio 2013 4.00
Risposta

Kowbathullah Gnaniyar

Punteggio: Liferay Master

Messaggi: 603

Data di Iscrizione: 19 dicembre 2007

Messaggi recenti

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 gennaio 2013 13.52
Risposta

Luca Lupo

Punteggio: Regular Member

Messaggi: 106

Data di Iscrizione: 1 ottobre 2012

Messaggi recenti

The class was btw I118Servlet emoticon