| |

VerySource

 Forgot password?
 Register
Search
View: 702|Reply: 8

Compile Error!

[Copy link]

2

Threads

6

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-1-9 13:20:01
| Show all posts |Read mode
package test;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class Test extends HttpServlet {
protected void doGet (HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
PrintWriter out = response.getWriter ();
out.println ("<html>; <body>; <h1>; This is a servlet test. </ h1>; </ body>; </ html>;");
out.flush ();
}
}

======================================================== =====

Test.java:10: illegal type start
throws ServletException, IOException {
^
Test.java:15: requires <identifier>
}
^
2 Error
Reply

Use magic Report

2

Threads

6

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

 Author| Post time: 2020-1-13 16:36:01
| Show all posts
up
Reply

Use magic Report

0

Threads

10

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-1-14 14:09:01
| Show all posts
It's best to follow the line above.

If there is an IDE, it will automatically write you to the second line with a certain space in front.
You should just press enter after writing it yourself and write throws to a new line.
Reply

Use magic Report

2

Threads

6

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

 Author| Post time: 2020-1-14 17:18:01
| Show all posts
Which line is wrong? Throws the next line, or? Be specific.
Reply

Use magic Report

0

Threads

39

Posts

23.00

Credits

Newbie

Rank: 1

Credits
23.00

 China

Post time: 2020-1-16 09:45:01
| Show all posts
May contain illegal characters in it?
Reply

Use magic Report

1

Threads

7

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 United States

Post time: 2020-1-16 12:18:01
| Show all posts
May contain illegal characters, pay attention to the case of the symbols, and the state of the input!
Reply

Use magic Report

2

Threads

6

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

 Author| Post time: 2020-1-16 12:45:02
| Show all posts
This is over, but is a new JSP application built in the webapps directory or in the webapps\ROOT directory? My version is TOMCAT5.
Reply

Use magic Report

0

Threads

10

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 Invalid IP Address

Post time: 2020-1-17 09:45:01
| Show all posts
1. It is recommended that the landlord first look at the basics of J2EE or WEB development.
2, can not be placed under webapps; can be placed under ROOT. If it is not placed under ROOT, you can create a new directory under webapps according to the directory structure of ROOT, and then put the jsp program in this directory. The new directory must contain WEB-INF / web.xml.
Reply

Use magic Report

2

Threads

6

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

 Author| Post time: 2020-1-17 10:09:02
| Show all posts
WEB-INF / web.xml both have ...
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