Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
sand s
context path not obtained when instanceable set to false
January 16, 2012 3:52 AM
Answer

sand s

Rank: New Member

Posts: 2

Join Date: December 1, 2011

Recent Posts

Hello,

I'm having a problem obtaining the context path of my portlet when the portlet is set to instanceable false.

When true, the context path is retrieved properly, which is /name-of-my-portlet. I use this context path only for the purpose of displaying images on my portlet with <img src="<%=request.getContextPath()%>/images/image1.png"/>

But when set to false, the context path becomes " / " and my images are no longer displayed. I have tried overriding the default context path in portal-ext.properties by setting it explicitly to /name-of-my-portlet, but nothing will work when instanceable is false.

I need to set instanceable to false in order for my url mapping property to work, so setting it to true won't work for me.

Does someone have a solution to this problem of getting the correct context path? Or another way which I could display images without using the context path?

Thanks!
Amigoo Earth
RE: context path not obtained when instanceable set to false
November 19, 2012 2:21 AM
Answer

Amigoo Earth

Rank: New Member

Posts: 8

Join Date: October 15, 2012

Recent Posts

Maybe there are some relationship between context path issue and the freemarker parse problem.
https://www.liferay.com/forums/-/message_boards/message/18013355