大家经常用ajax请求servlet,但是如何直接用浏览器调用servlet呢?
其实很简单,前提需要知道访问地址需要那些参数
举个例子:
比如要访问 StudentInfoServlet 需要的参数为id和name
在浏览器地址栏输入http://localhost:8080/Student/StudentInfoServlet?id=1&name=zhangsan
点击回车就可以看到结果
大家经常用ajax请求servlet,但是如何直接用浏览器调用servlet呢?
其实很简单,前提需要知道访问地址需要那些参数
举个例子:
比如要访问 StudentInfoServlet 需要的参数为id和name
在浏览器地址栏输入http://localhost:8080/Student/StudentInfoServlet?id=1&name=zhangsan
点击回车就可以看到结果