| |

VerySource

 Forgot password?
 Register
Search
View: 801|Reply: 7

Hematemesis, open the generated html, how difficult is it? ? ?

[Copy link]

1

Threads

4

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-26 22:00:02
| Show all posts |Read mode
Dear friends,

    The brother generated the html file with the program, but the original code is displayed no matter whether it is double-clicked or accessed under the server, but the original code is manually placed in Notepad and saved as XX.html. Double-click to see the web page. How about it? ? ?
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-2-18 17:00:01
| Show all posts
Right click, select open method, select ie
Reply

Use magic Report

0

Threads

10

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 Thailand

Post time: 2020-2-19 02:15:01
| Show all posts
Then you did not generate the files as html or jsp at all, but just print the code to the page.
Reply

Use magic Report

0

Threads

63

Posts

42.00

Credits

Newbie

Rank: 1

Credits
42.00

 China

Post time: 2020-2-20 16:45:01
| Show all posts
What program and how is it generated?
Reply

Use magic Report

1

Threads

4

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 Japan

 Author| Post time: 2020-2-21 07:15:01
| Show all posts
cedarcao:

  Hello there!
 
  If the code prints to the page, how can I see it as a web page when I visit it?

  Please advise!
Reply

Use magic Report

1

Threads

4

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-2-21 09:00:02
| Show all posts
My program is:
try {
if (url! = null) {

java.io.InputStream l_urlStream;
java.net.URL l_url = new java.net.URL (url);
java.net.HttpURLConnection l_connection = (java.net.HttpURLConnection) l_url
.openConnection ();

l_connection.connect ();
l_urlStream = l_connection.getInputStream ();

java.io.BufferedReader l_reader = new java.io.BufferedReader (
new java.io.InputStreamReader (l_urlStream));

while ((sCurrentLine = l_reader.readLine ())! = null) {
sTotalString + = sCurrentLine + "\n";
}
// sTotalString = sTotalString.replaceAll ("<", "&lt;");
// sTotalString = sTotalString.replaceAll (">", "&gt;");
sTotalString = sTotalString.replaceAll ("\n", "<br>");

Files f = new Files ();
// f.createAndDeleteFolder ("aa\\tt", "f:\\");
f.createAndDeleteFile ("E:\\workspace\\testfile\\WebRoot\\", "welcome.htm");
f.writeFile ("E:\\workspace\\testfile\\WebRoot\\", "welcome.htm", sTotalString);
System.out.println ("sTotalString" + sTotalString);
}
} catch (Exception d)
{
d.printStackTrace ();
}
Reply

Use magic Report

1

Threads

4

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 Unknown

 Author| Post time: 2020-2-21 11:45:02
| Show all posts
Make up:

 // sTotalString = sTotalString.replaceAll ("<", "&lt;");
// sTotalString = sTotalString.replaceAll (">", "&gt;");

Open the above two lines,
Reply

Use magic Report

0

Threads

63

Posts

42.00

Credits

Newbie

Rank: 1

Credits
42.00

 China

Post time: 2020-3-21 14:15:01
| Show all posts
I did n’t understand how to write a disk file, what did the whole process do?
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list