File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes include contents of an .inc file as in HTML pages Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "include contents of an .inc file as in HTML pages" Watch "include contents of an .inc file as in HTML pages" New topic
Author

include contents of an .inc file as in HTML pages

JayaSiji Gopal
Ranch Hand

Joined: Sep 27, 2004
Posts: 303
Hi!

I have a .inc file, which is a plain text file, containing around 20 lines of plain text. I have an HTML page with lot of tables inside it. I need to include this plain text AS INLINE TEXT inside the html page.

How do I get this done?? Any ideas??


SCJP 1.4, SCWCD 1.4<br /> <br />Thanks in advance!<br />Jayashree.
Jessica Sant
Sheriff

Joined: Oct 17, 2001
Posts: 4313

if you're using JSP's (Java Server Pages) -- you can use the <jsp:include> tag. But... seeing as though you're asking about plain old HTML pages,
I'm going to move this to that HTML and JavaScript forum. Hopefully they can help you out.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Could use iframes if you do not want to use server side includes.

Eric
Eugene Lucash
Ranch Hand

Joined: Feb 19, 2005
Posts: 77
I don't really understand which environment you are working in.
What does it means 'INLINE TEXT'
If you want to preserve formating in .inc file,
you can include within <pre> tag

<table><tr><td>......
........
<pre>
<%@include file="file.inc" %> <%-- using jsp --%>
</pre>
.....
... </td></td></table>
JayaSiji Gopal
Ranch Hand

Joined: Sep 27, 2004
Posts: 303
Hi All,

Thank u for all the replies.

By inline text, I mean...the HTML file contains all the text from the .inc file directly into it. I cannot use <@include file...> since it is plain HTML. I am not using JSP.

I am working on SeeBeyond EAI tool. Writing Java Code to put business logic into the system. SeeBeyond is an Enterprise Appln and Integration Tool developed by SeeBeyond Corporation Inc.

I cannot use JavaScript, bcos it is not supported by SeeBeyond.
[ February 21, 2005: Message edited by: JayaSiji Gopal ]
Eugene Lucash
Ranch Hand

Joined: Feb 19, 2005
Posts: 77
Does your server support SSI ? (Server side includes)

(even tomcat supports it via special servlet)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60053
    
  65

HTML has no inherent include mechanism. You need to use a mechanism provided by the web server for this.

So, what web server are you using? If Apache, you need to enable server-side includes.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: include contents of an .inc file as in HTML pages
 
Similar Threads
how to include one html inside another
Links in HTML Table Cells
Include a HTML file in another HTML File
Simplified Chinese in jsp
How to include a part of html code in to a jsp page?