2013年10月22日星期二

servlet-api.jar and jsp-api.jar

Do not use do not need to configure the servlet servlet-api.jar and jsp-api.jar paths of these two packages , but the JSP into JAVA source which has import javax.servlet.http * package , jsp and servlet into the same package , why do you need to configure when compiling the package path servlet , jsp do not need .
------ Solution - ------------------------------------------
these two packages are each application server is a proprietary , Javax belong to third parties under the package , Sun only raised interface specification, all third-party application server vendor has its own implementation
------ For reference only --- ------------------------------------

//这是jsp页面转换成的servlet代码
package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;

public final class index_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {
}


//这是我自己写的servlet代码
import java.io.*; 
import java.sql.*; 
import javax.servlet.*; 
import javax.servlet.http.*; 

public class ServletUser extends HttpServlet 
{ }


------ For reference only ----------------------------------- ----
upstairs conceptual interpretation of the interface was very good, master.
------ For reference only -------------------------------------- -
unofficial [color = # FF0000] [/ color]

没有评论:

发表评论