JSP is servlet but there is no function called doGet() or doPost() in JSP?

Viewed 1555

I am a beginner in servlet/JSP. I have read that JSP is actually a servlet (after the container transfer the JSP file into a Java source code and compiled it). But in the servlet, there is always at least one of the doGet() and doPost(). In JSP, I do not write any code to override the doGet() or doPost(). What I write is just below:

<%@ page import="com.example.*, java.util.*" %>
<html>
<body>
the page count is:
<%=
Counter.getCount()
%>
</body>
</html>

I know the above code will be changed to java code like:

public void _jspService(){
    out.println(......)
}

But I do not see the doGet() or doPost(). So, where is doGet() and doPost() in the JSP?

3 Answers
Related