1

I'm working on an old JSP webapp, that has basic 3 presentation areas:

top menu / side menu / content

Initially, this layout used IFRAMES. Other people has changed before the top menu and side menu from Iframe to DIV approach, but not the content IFRAME.

Every page of the system is an individual JSP page, with many Includes of other JSPs (access control, session time, etc), JS, CSS, etc.

When I try to use DIV to load content, many problems happens because this option insert the content into a base code (main page), that has your own CSS, JS, included JSPs.

a4j:include, ui:include (templates with facelets), and c:import are options that like DIV, mix the codes.

I want an option that like IFRAME, insert an independent and isolated page in an area of a main page. Without this, many hardwork (and tedious) would be necessary to adapt every single file content with the main page.

Unfortunately my boss don't want to remains on IFRAME :)....

Update: BalusC, it's a honor to me that you had answered my question. I'm living my first experience with work as a developer (always was a personal dream, since I'm child when I have first contacts with Basic in a TK90X plugged into tv) , started in this job 2 months ago, and some times I can see your comments around the web helping many people.

I'm very starter with JSF / JSP, but the question is about how to drop the IFRAME and use another solution to load content, with minimal project impact, because the webapp has more than 1k JSP files, someones already using JSF tags (the project is slowly been updated to use JSF). We are using JAVA 6, Tomcat 6 and JSF 1.2.

Some problems with use of a4j:include, for example, is that the included pages action as a part of the main page, and:

1- every page need to use a f:subview tag instead f:view. All of them that already migrated to JSF are using f:view (very manual changes were necessary).

2- with include, the URL path reference is the path of the main page, not the path of the included file (with IFRAME this problem don't exists). Every page of project was made to work with frames, using includes of JS, CSS, JSPs, many o them using relative path like: "../../javascript/jsfile.js".

As you can see, with includes or imports (a4j, ui), many hardwork will be necessary (more than 1k file changes. An option that acts like Iframe, including an independent page at the content area (the webapp was made for that), will help me a lot. I know that this not is the correct way, but the webapp is very large to do a drastic change quickly with templates or other solutions.

Forgive me for the bad English and possible basic questions that I don't know.

4

1 回答 1

2

我使用 HTML 标签“对象”解决了我的问题。与“iframe”一样,使用此标签“嵌入文档保持独立于主文档”。(w3c.org)

这个标签是 HTML Strict 的。

链接到关于“对象”的 w3c 页面:http: //www.w3.org/TR/html401/struct/objects.html

不管怎么说,还是要谢谢你。

于 2012-04-17T22:35:56.780 回答