How to include CSS, JS and Image in Liferay Portlet JSP
In Init.jsp, add the following plug-ins to enable CSS and JS to be loaded inside a portlet. <%-- CSS, JS --%> <link href="/o/contact-us-portlet/css/portlet-main.css" rel="stylesheet" /> <script src="/o/contact-us-portlet/js/portlet-main.js"></script> The path starting with /o/(portlet-name)/ is automatically appended to main url (ex. localhost:8080/o/..) /o/(portlet-name)/ represents resources/META-INF/resources One thing to keep in mind is that the above initialization should be done after <liferay-theme:defineObjects /> <portlet:defineObjects /> I DO NOT KNOW WHY ... In view.jsp. can get path through request src="<%=request.getContextPath()%>/images/form-icon.png" Prerequisite: In bnd.bnd Web-ContextPath: /contact-us-portlet should be set . ------------------------------------------------------------------------- Today's trouble sh...