tag:blogger.com,1999:blog-14898252.post3459067925489342885..comments2023-09-04T17:55:35.878+05:30Comments on Learn Share Learn & Repeat: Best practice of referencing resouces(css,img,js) in Portlet JSP{ Neeraj : Sidhaye }http://www.blogger.com/profile/05798201445929791366noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-14898252.post-78135162438183344852015-07-03T16:14:35.114+05:302015-07-03T16:14:35.114+05:30Well explanation.Thanks for sharing...!Well explanation.Thanks for sharing...!Java Training in Bangalorehttp://www.besanttechnologies.in/java-training-in-bangalore.htmlnoreply@blogger.comtag:blogger.com,1999:blog-14898252.post-43429265053890549472014-04-14T13:34:53.288+05:302014-04-14T13:34:53.288+05:30nice post.i like your post.nice post.i like your post.designinghttp://linkssol.weebly.com/noreply@blogger.comtag:blogger.com,1999:blog-14898252.post-12269208957033973352011-06-12T10:38:45.885+05:302011-06-12T10:38:45.885+05:30Hi Naga,
thanks for your comment.To add here, keep...Hi Naga,<br />thanks for your comment.To add here, keeping css,img,js on WebServer should be done when these are part of Portal Theme and not for portlet app because different portlet apps might have different css,js and img and should be placed within portlet WAR.Neeraj Sidhayehttps://www.blogger.com/profile/14653898439551630095noreply@blogger.comtag:blogger.com,1999:blog-14898252.post-57717106888172519642011-06-10T01:42:47.305+05:302011-06-10T01:42:47.305+05:30To further enhance this, it is Best Practice to st...To further enhance this, it is Best Practice to store the css/js/image files on web server and not inside the Portlet, The web server path should be added as prefix while accessing the corresponding files. so instead of <link rel="stylesheet" href="../css/styles.css" type="text/css" /> we can use something like below<br /><c:set var="cssFolder" value="${webServerPath}/css" /><br /><br /><link rel="stylesheet" href="${cssFolder}/styles.css" type="text/css" /><br /><br />above syntax is using jstl and assumes that the web server path is retrieved and stored in a request/session variable with name webServerPath.Naga Dakshina Murthy Nookalahttps://www.blogger.com/profile/12785623182312083070noreply@blogger.com