This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

include contents of an .inc file as in HTML pages

 
JayaSiji Gopal
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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??
 
Jessica Sant
Sheriff
Posts: 4313
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could use iframes if you do not want to use server side includes.

Eric
 
Eugene Lucash
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does your server support SSI ? (Server side includes)

(even tomcat supports it via special servlet)
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64970
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic