我有一个servlet,我想通过JAVA类运行这个servlet。比如说地址是http://127.0.0.1:8080/test/testS
我写代码如下
try
{
URL url = new URL("http://127.0.0.1:8080/test/testS");
try
{
url.openConnection();
System.out.println("t");
}
catch (IOException e)
{
e.printStackTrace();
}
}
catch (MalformedURLException e)
{
e.printStackTrace();
}
为何servlet没有运行?怎么才能通过java类启动这个servlet呢?求解。。