- 论坛徽章:
- 0
|
i want to access Servelt by hyperlink in a jsp web site
connection.jsp
Accessing servlet
i put the bean in the dir(/myjsp/WEB-INF/classes/hello(package)/Hello)
and modify the file web.xml like this:
>
Hello
hello.Hello
Hello
/Hello
it works!
but if i use
it causes an Exception The requested resource (/myjsp/myjsp/SimpleServlet) is not available.
but if you rewrite the path like this
it will be ok. why?
in my opinion, if you use the default path is http://localhost:8080
so you need the rest path is /myjsp/Hello. but if you use the default path is http://localhost:8080/myjsp/,so you just need write the rest part"/Hello".
i don't know my explaination is right or not. but i think this is a try.
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/21684/showart_140263.html |
|