Fórum

Loading an .html file inside an iFrame?

Roberto Rivera, modificado 13 Anos atrás.

Loading an .html file inside an iFrame?

New Member Postagens: 5 Data de Entrada: 01/11/10 Postagens Recentes
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
Hitoshi Ozawa, modificado 13 Anos atrás.

RE: Loading an .html file inside an iFrame?

Liferay Legend Postagens: 7942 Data de Entrada: 24/03/10 Postagens Recentes
If you place your html file in the document library, you'll be able to use the url presented by document library.
Roberto Rivera, modificado 13 Anos atrás.

RE: Loading an .html file inside an iFrame?

New Member Postagens: 5 Data de Entrada: 01/11/10 Postagens Recentes
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
Hitoshi Ozawa, modificado 13 Anos atrás.

RE: Loading an .html file inside an iFrame?

Liferay Legend Postagens: 7942 Data de Entrada: 24/03/10 Postagens Recentes
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.
Marcos Laurito, modificado 10 Anos atrás.

RE: Loading an .html file inside an iFrame?

Junior Member Postagens: 99 Data de Entrada: 18/04/13 Postagens Recentes
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...
Alla Sapozhnikova, modificado 10 Anos atrás.

RE: Loading an .html file inside an iFrame?

Junior Member Postagens: 81 Data de Entrada: 02/03/12 Postagens Recentes
Hi Marcos,

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

Thank you,
Alla
Marcos Laurito, modificado 10 Anos atrás.

RE: Loading an .html file inside an iFrame?

Junior Member Postagens: 99 Data de Entrada: 18/04/13 Postagens Recentes
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
Vilmos Papp, modificado 10 Anos atrás.

RE: Loading an .html file inside an iFrame?

Liferay Master Postagens: 529 Data de Entrada: 21/10/10 Postagens Recentes
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
Vilmos Papp, modificado 10 Anos atrás.

RE: Loading an .html file inside an iFrame?

Liferay Master Postagens: 529 Data de Entrada: 21/10/10 Postagens Recentes
What would you like to achieve by showing an html file in an iframe? I mean what is your use case?