How do I include one file in another?

Answer Posted / irene

Html on it's own does not support this.

1. Use server side includes. JSP and servlets are good
options.<%@ include file="filename" %> or
<jsp:include page="filename" />
where file name should be .html or .jsp
*Use this code in a file with a jsp extension.

This works fine if you have a web server - an IDE like RAD.
Develop your page with a jsp entension instead of html, add
this code to include another file, view it in a browser and
click on View>Source and copy the code generated and save
that code as your html document. The included jsp file is
translated into html, and merged with the main file
*You need a web server to be able to view jsp files
This will not help if you do not have a web server in your
development environment.

Another method. Add this line to the

As in Ans 1, ask your web server host if server side
scriting is supported. Good luck

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I change the title of a framed document?

496


Describe HTML Entities with example?

498


In an html form I have a button which makes us to open another page in 15 seconds. How will do you that?

507


What are the features of html5?

455


How to create a nested webpage in html?

465






What are the various formatting tags in html5?

488


What happens if the list-style-type property is used on a non-list element like a paragraph?

619


Explain data attributes in html5?

462


What are the new FORM elements which are available in HTML5?

499


What language is pt br?

434


How can I make a form with custom buttons?

476


what is the new structural elements in html5?

493


What is html4?

504


What is hyperlink? Why it is used?

486


Where is the navigation bar?

436