Solution 1 :

You’ve left out a lot of important details (Q: How is the JSP getting invoked? Q: Are you passing a filename in the URL? Etc. etc.)

But here’s a simple example that might get you started in the right direction:

   <%
        BufferedReader reader = new BufferedReader(new FileReader("myile.txt"));
        boolean firstLine = true;
        String line;
        while((line = reader.readLine())!= null){
            if (firstLine) {
              line = "<b>" + line + "</b>";
              firstLine = false;
            }
            out.println(line);
        }
        reader.close();
    %>

Problem :

I want to import a text file (not user import), for example:

Coding

There are several languages…

When the file is read, the first line should be in larger font and bolded, and the other lines can be kept in the text file format. Not sure how I can use JSP and link it to HTML

Comments

Comment posted by here

Q: Is your question a) how to modify text, or b) how to read a text file? Q: I just noticed that you asked the same question

By