掲示板

Loading an .html file inside an iFrame?

13年前 に Roberto Rivera によって更新されました。

Loading an .html file inside an iFrame?

New Member 投稿: 5 参加年月日: 10/11/01 最新の投稿
Hi,

I'm trying to display an .html file inside an iFrame that's contained in a JSP.

I've set the iframe's src property to a number of values without any success: 'file.html', 'portlet_name/file.html', 'portlet_name/WEB-INF/file.html'. None of them work.

I get an error saying something like:

requested resource was not found.

http://localhost:8080/web/guest/file.html


Where should I place the file in my portlet? What should I set the src property of the iFrame to?

I'm using Spring Portlet MVC, in case it makes a difference.

thanks,
rob
thumbnail
13年前 に Hitoshi Ozawa によって更新されました。

RE: Loading an .html file inside an iFrame?

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
If you place your html file in the document library, you'll be able to use the url presented by document library.
13年前 に Roberto Rivera によって更新されました。

RE: Loading an .html file inside an iFrame?

New Member 投稿: 5 参加年月日: 10/11/01 最新の投稿
Hitoshi Ozawa:
If you place your html file in the document library, you'll be able to use the url presented by document library.


Thanks for your suggestion.

I have a couple of problems with your solution. First, the URL provided in the document library will not display the page, but rather prompt the user for a download. The WebDAV URL does work for displaying the page, but requires a login (which wouldn't be great in a public portal).

Second, the document ID generated by the Document Library would not be constant between different environments (dev, test, and prod), so I'd have to extract the link to a properties files, or modify the containing jsp for each instance.

I've found that if I place the .html file inside ${TOMCAT}/webapps/ROOT/html/, I can access it, but I feel uncomfortable placing files inside Liferay's ROOT application.

Any way of doing it from inside a portlet?

Regards
thumbnail
13年前 に Hitoshi Ozawa によって更新されました。

RE: Loading an .html file inside an iFrame?

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
Second, the document ID generated by the Document Library would not be constant between different environments (dev, test, and prod), so I'd have to extract the link to a properties files, or modify the containing jsp for each instance.


Liferay 6.x has a new feature to access files in Document Library using the following URLs:
http://localhost:8080/document/[group-id]/[folder-id]/[encoded-title]
http://localhost:8080/document/[group-id]/[uuid]
http://localhost:8080/document/[shortcut-id]

Also, it may be helpful to think about using Liferay's Staging to publish to a production server.
10年前 に Marcos Laurito によって更新されました。

RE: Loading an .html file inside an iFrame?

Junior Member 投稿: 99 参加年月日: 13/04/18 最新の投稿
I'm having this exact problem and i cant resolve it.
I've upload one simple html file to documents & media. I'm trying to display it using an iFrame on another page of the same site but it doesn't work. When i load the page that contains the iframe it prompts me to download the file configured in the iFrame but i want it to be displayed directly in the iFrame... I've been trying using the URL and WebDavURL and is the same...
10年前 に Alla Sapozhnikova によって更新されました。

RE: Loading an .html file inside an iFrame?

Junior Member 投稿: 81 参加年月日: 12/03/02 最新の投稿
Hi Marcos,

I am trying to solve the same problem. Have you found a solution yet?

Thank you,
Alla
10年前 に Marcos Laurito によって更新されました。

RE: Loading an .html file inside an iFrame?

Junior Member 投稿: 99 参加年月日: 13/04/18 最新の投稿
Alla Sapozhnikova:
Hi Marcos,

I am trying to solve the same problem. Have you found a solution yet?

Thank you,
Alla



Hi. No i couldn't find a solution for this...
Sorry
thumbnail
10年前 に Vilmos Papp によって更新されました。

RE: Loading an .html file inside an iFrame?

Liferay Master 投稿: 529 参加年月日: 10/10/21 最新の投稿
Perhaps you can set this property in your portal-ext.properties to display the .html file instead of download, but I think if you want to display an HTML content a web content display would be the proper solution.


    #
    # Input a list of comma delimited extensions for which the content
    # disposition header has to be set to "inline".
    #
    mime.types.content.disposition.inline=flv,gif,jpg,pdf,png,swf,wmv
thumbnail
10年前 に Vilmos Papp によって更新されました。

RE: Loading an .html file inside an iFrame?

Liferay Master 投稿: 529 参加年月日: 10/10/21 最新の投稿
What would you like to achieve by showing an html file in an iframe? I mean what is your use case?