Foros de discusión

First class called after typing url in the browser

Luca Lupo, modificado hace 11 años.

First class called after typing url in the browser

Regular Member Mensajes: 106 Fecha de incorporación: 1/10/12 Mensajes recientes
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, modificado hace 11 años.

RE: First class called after typing url in the browser

Liferay Master Mensajes: 894 Fecha de incorporación: 18/02/09 Mensajes recientes
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
Mehdi norouzi, modificado hace 11 años.

RE: First class called after typing url in the browser

New Member Mensajes: 20 Fecha de incorporación: 18/07/06 Mensajes recientes
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, modificado hace 11 años.

RE: First class called after typing url in the browser

Regular Member Mensajes: 106 Fecha de incorporación: 1/10/12 Mensajes recientes
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
Gnaniyar Zubair, modificado hace 11 años.

RE: First class called after typing url in the browser

Liferay Master Mensajes: 722 Fecha de incorporación: 19/12/07 Mensajes recientes
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, modificado hace 11 años.

RE: First class called after typing url in the browser

Regular Member Mensajes: 106 Fecha de incorporación: 1/10/12 Mensajes recientes
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
Gnaniyar Zubair, modificado hace 11 años.

RE: First class called after typing url in the browser

Liferay Master Mensajes: 722 Fecha de incorporación: 19/12/07 Mensajes recientes
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, modificado hace 11 años.

RE: First class called after typing url in the browser

Regular Member Mensajes: 106 Fecha de incorporación: 1/10/12 Mensajes recientes
The class was btw I118Servlet emoticon