留言板

Images are not loading in liferay 7 configuration jsp

Thirumal Reddy,修改在7 年前。

Images are not loading in liferay 7 configuration jsp

Regular Member 帖子: 216 加入日期: 15-12-3 最近的帖子
Hi All,
we are migrating liferay 6.2 portlet into liferay 7 plugin portlet.
the 6.2 portlet contains configuration page and that page contains images.
so i am trying to include the images in config.jsp but the images are not loading.
i tried with
<img src="images/help.png"/>
<img src='<%=request.getContextPath() +"/images/help.png"%>'>
<img src="../images/help.png"/>

so how to load images in configuration jsp in Lifray 7.

Thanks
Thirumal.
thumbnail
David H Nebinger,修改在7 年前。

RE: Images are not loading in liferay 7 configuration jsp

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
You should just be using /images/help.png because the image comes from your context.

Also check where the images are in the project filesystem hierarchy. Based on your URL, I would expect that they are in src/main/resources/META-INF/resources/images
Thirumal Reddy,修改在7 年前。

RE: Images are not loading in liferay 7 configuration jsp

Regular Member 帖子: 216 加入日期: 15-12-3 最近的帖子
Hi All,
I'm not migrating 6.2 plugin portlet into module.
i'm continuing with portlet. so the images are placed in docroot/images/ folder.
i'm able to get the images in view.jsp but the same image i'm unable to get it in configuration.jsp

Thanks,
Thirumal
asif aftab,修改在5 年前。

RE: Images are not loading in liferay 7 configuration jsp

Regular Member 帖子: 123 加入日期: 13-9-2 最近的帖子
RAVI RAJAMANI,修改在7 年前。

RE: Images are not loading in liferay 7 configuration jsp

Regular Member 帖子: 123 加入日期: 14-12-7 最近的帖子
Hi,
U can try following code


<img src="<%=request.getContextPath()%>/images/help.png">


Add image inside META-INF/resources/images folder

Example=/src/main/resources/META-INF/resources/images/help.jpg


Regards,
Ravi