我有个servlet程序BookCart.java,位于 Package com.liying 下.
当我在jsp程序中引用时是这样写的: <form action= "com.liying/BookCart.java " method= "post "> .
运行时报错:The requested resource (/ServletBook/com.liying/BookCart1.java) is not available.
我是个初学者.请大家帮帮忙,看看这是怎么回事呀?谢谢
------解决方案--------------------
在web.xml下配置,web.xml放在WEB-INF目录下
<web-app>
<servlet>
<servlet-name> bookcart </servlet-name> <!--名字自己取-->
<servlet-class> com.liying.BookCart </servlet-class> <!--Servlet类-->
</servlet>
<servlet-mapping>
<servelt-name> bookcart </servlet-name> <!--与上面名字要一样-->
<url-pattern> /bookcart </url-pattern> <!--在form中写的是这个-->
</servlet-mapping>
</web-app>
<form action= "./bookcart " method= "post "> .