Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7586155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:21:20+00:00 2026-05-30T19:21:20+00:00

Preface: I am an inexperienced java programmer handed one of his first assignments. If

  • 0

Preface: I am an inexperienced java programmer handed one of his first assignments. If I do not ask the question correctly or do not give enough detail, please let me know.

I am trying to import a HTML page that is saved on my C drive. I am trying to import it to the content portion (div id=”content”) of a JSP file that exists in a war file. I have already figured out that I can not use jsp:include, #include, @include file because the file exists outside the war file. I also figured out that c:import and iFrame do not work.

My goal is to make the contents of the html file that is saved in on my c drive appear in the contents of the jsp (visible on the web page).

Am I on the right track with this <% File f = new File("c:\\temp\\filename.html").......%>

I have searched stackoverflow and the only topic that came close was “How to Include a file outside the application (war) using jsp include.” It did not really get me where I needed to go. Maybe the answer is right in front of me but I couldnt see it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T19:21:21+00:00Added an answer on May 30, 2026 at 7:21 pm

    JSP/JSTL does not offer tags which support this. You’d need to do it using pure Java. You just have to write it to the response yourself.

    Here’s one of the simplest ways:

    <%
        Reader reader = new FileReader("c:/path/to/external/file.html");
        try {
            for (int i = 0; (i = reader.read()) != -1;) {
                out.write(i);
            }
        } finally {
            try { reader.close(); } catch (IOException ignore) {}
        }
    %>
    

    You could wrap it in a custom tag to keep your JSP free of scriptlet clutter, or you could read it into a String in a servlet and pass it to JSP EL scope.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

( Preface: This is my first audio-related question on Stack Overflow, so I'll try
First let me preface this question by saying that I'm fairly new to Javascript.
To preface this, I do not work with Java or Struts, but I understand
To preface this question, this is my first app and I have a very
Preface : I'm honestly not sure if this should be on StackOverflow, SuperUser or
Preface: I have two entities defined as a one-to-many relationship: A <<-------> B. B's
Preface I've rarely ever been a JS developer and this is my first attempt
PREFACE: I'm relatively inexperienced in C++ so this very well could be a Day
Preface The official python package python-openid (as distributed through pypi.org) does not work with
Preface: I am horrible with java, and worse with java ui components. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.