Planned maintenance is scheduled for the week of June 15th - the exact date and time will be announced soon.
See More Details
Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Current Url generates Exception:NULL..........
M not able to display any image on portlet................
<img src="H:/arr.jpg" height="100" width="200"/>
<liferay-ui:png-image image="H:/arr.jpg" height="100" width="500"></liferay-ui:png-image>
none of it works......
12:50:37,084 INFO [PortalImpl:3829] Current URL /en_GB/web/sanketgosavi/arr.png generates exception: null
<img src="H:/arr.jpg" height="100" width="200"/>
<liferay-ui:png-image image="H:/arr.jpg" height="100" width="500"></liferay-ui:png-image>
none of it works......
12:50:37,084 INFO [PortalImpl:3829] Current URL /en_GB/web/sanketgosavi/arr.png generates exception: null
Try putting that image in your portlet. Like if that is in your-portlet/images/arr.png then use
<img src="<%=request.getContextPath()%>/images/arr.png">
You cannot use fixed paths to images, all images must be relative to the web application.
That is a basic web server development thing which you should already be aware of to undertake web development.
That is a basic web server development thing which you should already be aware of to undertake web development.
i knw dat...i want a way to do that
You cannot. It's an application server thing, not just something you can override. It is there to ensure that you do not serve up resources outside of the application container, which would be a potential security leak.
Well...plzzzzz tell me wht i hav do to display image on d portlet....
As I previously mentioned and David also explaining, image should be in your document root. If you are not doing so, then serve those images using a different method. Which is not at all recommended, will decrease performance and not tested by me.. 
You can write a method which loads image content from local file and sends it to application. serveResource() method may be used, I guess. But for that you will need to change all urls to get resources by serveResource.. I don't know whether its possible but you can try..
David: is that really possible?
You can write a method which loads image content from local file and sends it to application. serveResource() method may be used, I guess. But for that you will need to change all urls to get resources by serveResource.. I don't know whether its possible but you can try..
David: is that really possible?
It worked....thnks.....Can i display text keeping the image as background?
Of course yes... depends on how you are writing that.
how?..is der any attribute or somthing...
Will background-image property of css not help? check this http://www.w3schools.com/css/css_background.asp
Just place the image url at appropriate position. Suppose abc is the id of the element you want to set background of..
HTH
Just place the image url at appropriate position. Suppose abc is the id of the element you want to set background of..
#abc{background-image:url('paper.gif');}
HTH
i want to do this too... but instead of an image, i want to display a PDF file, how would that work. If its possible, let me know.
Thanks.
Haris
Thanks.
Haris
Community
Company
Feedback