请问怎样在Eclipse中导入servlet.jar文件阿~~~
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import
public class ExampleServlet extends HttpServlet{
public void doGet( HttpServletRequest request, HttpServletResponse response ){
try
{
PrintWriter out = response.getWriter();
String output;
//Instruct the servlet to respond with html
response.setContentType( "text/html " );
output = " <html> <body> <head> <title> Example Servlet </title> </head> Hello World </body> </html> ";
//Print the response to the Web browser.
out.println( output );
//Close the Printwriter object
out.close();
}
catch( Exception e)
{
//Print any exceptions to the system console.
System.err.println( e.toString() );
}
}
}
在import javax....那里就是有错,好郁闷阿~~~
------解决方案--------------------
工程属性-> java build path-> libraries-> add External jar