Forums Register Login
Navigation System putting two headers in an .html file when fully rendered in the browser.
Hello I inherited a navigation system which is like this:


When I click on the "view source" in the browser, I get two headers like this:

I know this is not good. I have inherited the nav system from someone else and I have a lot of complicated AJAX and JQuery going on inside my module.

I am not sure how to resolve.

Look for an "include" statement in one of the pages, probably in index.jsp. It might look like <%@include... or <jsp:include... The file that is being included (I assume homepage.jsp) should be a fragment, that is, it should not contain "head" and "body" tags, the doctype, and all that.
Thanks, I appreciate the info.

What I need to say is this: I am developing solutions that fit in with a ux/ui template that I did not design, these are in HTML 4.01.

A lot of time to save time I import those html files into my eclipse project just to view the files and then I inspect the elements if I get into trouble with a browser.

I am a little confused because I am working with another developer who said that I need to run the index.jsp file to to get down to my pages. I have never worked this way.

In general, I have never used this code: <jsp:include page="/jsp/blah.jsp"/>

I am wondering is there a best practices for this?

I inherited a design that is a bunch of divs and inside them are these <jsp:include page="/jsp/blah.jsp"/>

I hope I make sense.

Anything that would boil it down for me and help me to conceptualize what is going on would be great.

However, in summary my situation is like this:

1. The other developer made a index.jsp page
2. The other developer made a homepage.jsp page
I have all these other pages that link from the homepage.jsp to other files.

I also should mention that my navigational system is not one that I designed, it is designed by the other developer.

Any insight on how to deal with this would be appreciated.


None of the included files should have a full HTML page within it -- only the parent page. All the included files should create HTML fragments, not pages. Inspect each to see which one contains the faulty markup.
Thanks Bear. I just have one other question. Does this mean all the js and css and jquery needs to be included in the header of the parent .jsp file? And then for example, all there would be is divs for the children pages that get included?

Yeah, pretty much.

Remember that all this JSP stuff, whether it does from include files or not, is intended to end up generating one HTML page to send as the response.

So the "parent" JSP should set up the HTML page, and the included JSPs would only be contributing parts of the page. That make sense?
Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards

All times above are in ranch (not your local) time.
The current ranch time is
Oct 16, 2017 21:52:56.