Fórum

how are the css and javascript files injected into the portal whe

Sundeep sde, modificado 13 Anos atrás.

how are the css and javascript files injected into the portal whe

New Member Postagens: 9 Data de Entrada: 11/10/10 Postagens Recentes
Hi,

When a portlet is added to a page, the css and javascript files associated with that portlet are injected into the head tag of the liferay portal.

I observed that when we click the add button of the portlet, a request is sent to the update_layout servlet and a response is received. The servlet url is http://localhost:8080/c/portal/update_layout. But when I checked the source files of liferay portal, I couldn't find any servlet with that name.

Also, I could not find any javascript code in the response received from the servlet, that injects the header css and footer jss files into the head tag.

Any help that would enable me to move forward in my investigation would be appreciated.

Thanks,
Sundeep.


details:
Liferay version: 6.0.4
JDK v1.6
Tomcat v6.0.26
thumbnail
Peter Shin, modificado 13 Anos atrás.

RE: how are the css and javascript files injected into the portal whe

Regular Member Postagens: 121 Data de Entrada: 24/09/07 Postagens Recentes
The js and css in the head tag are added in top_head.jsp. It basically looks at which portlets are on the current page and adds in the appropriate css/js files. Those files are defined in liferay-portlet.xml.

The url http://localhost:8080/c/portal/update_layout will hit com.liferay.portal.action.UpdateLayoutAction. That's defined in struts-config.xml.
Sundeep sde, modificado 13 Anos atrás.

RE: how are the css and javascript files injected into the portal whe

New Member Postagens: 9 Data de Entrada: 11/10/10 Postagens Recentes
Hi Peter,

Thanks for the help emoticon. But, I am still not sure about the following:

1) I think a call to the top_head.jsp is made when the page reloads (that is when all the js/css files of the portlet are added in the head tag). But, if you see the head tag is updated when new portlets are added without reloading.