Visualización de documentos html/JSP dentro de iFrame

I'm busy working on a web app that basically has 5 pages that one can jump to from the navigation bar (obviously). But instead of using links the normal why where you'll get directed to a different web page entirely, I want to keep everything in my "index.html". So when you click on one of the navigation bar links, an iFrame will just get populated with a different document e.g. about.html, controlpanel.html, profile.html etc...

Is this good practice or are there better ways of doing this?

Gracias de antemano!

preguntado el 03 de mayo de 12 a las 10:05

1 Respuestas

One problem I see is that your users won't be able to bookmark / share any links to your pages.

All they can do is with the /index.html.

Edit:

Based on your comment, in order to avoid redundancy in coding header / footer, this is what I recommend:

init.jsp

Declare all imports, taglibs, any global variables here.

encabezado.jsp

<%@ include file="init.jsp" %>
Write code for header here

pie de página.jsp

<%@ include file="init.jsp" %>
Write code for footer here

página1.jsp

<%@ include file="init.jsp" %>
<%@ include file="header.jsp" %>
Write main code here.
<%@ include file="footer.jsp" %>

página2.jsp

<%@ include file="init.jsp" %>
<%@ include file="header.jsp" %>
Write main code here.
<%@ include file="footer.jsp" %>

Respondido el 20 de junio de 20 a las 10:06

Very true, I didn't think of that.. It's a rather tiny app so having to bookmark a particular page won't be necessary. But some people would like to I suppose... The whole point of me wanting to do is this way is so that I can avoid having to code the 'header' and 'footer' section the whole time for every page.. Also avoiding an entire page load on each nav click. - user818700

You can always use include files <%@ include page="pages/header.jsp" %> to avoid code redundancy. I guess now that this is sorted, you can forget the iframe solution :) - Adarshr

And this is why I love this site :-) Thanks guys! - user818700

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.