Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
Luca Lupo
First class called after typing url in the browser
January 16, 2013 11:34 PM
Answer

Luca Lupo

Rank: Regular Member

Posts: 106

Join Date: October 1, 2012

Recent Posts

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
January 17, 2013 12:41 AM
Answer

Oliver Bayer

Rank: Liferay Master

Posts: 875

Join Date: February 18, 2009

Recent Posts

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
January 17, 2013 1:27 AM
Answer

Mehdi norouzi

Rank: New Member

Posts: 14

Join Date: July 17, 2006

Recent Posts

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
January 17, 2013 1:35 AM
Answer

Luca Lupo

Rank: Regular Member

Posts: 106

Join Date: October 1, 2012

Recent Posts

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.
Gnaniyar Zubair
RE: First class called after typing url in the browser
January 19, 2013 10:40 PM
Answer

Gnaniyar Zubair

Rank: Liferay Master

Posts: 602

Join Date: December 19, 2007

Recent Posts

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
January 21, 2013 9:25 AM
Answer

Luca Lupo

Rank: Regular Member

Posts: 106

Join Date: October 1, 2012

Recent Posts

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
Gnaniyar Zubair
RE: First class called after typing url in the browser
January 23, 2013 4:00 AM
Answer

Gnaniyar Zubair

Rank: Liferay Master

Posts: 602

Join Date: December 19, 2007

Recent Posts

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
January 27, 2013 1:52 PM
Answer

Luca Lupo

Rank: Regular Member

Posts: 106

Join Date: October 1, 2012

Recent Posts

The class was btw I118Servlet emoticon