Weblogic6.1中关于WEB控件配置的问题!!SOS

yadang 2002-03-17 10:59:09
web.xml中:
<servlet-mapping>
<servlet-name>ShoppingServlet</servlet-name>
<url-pattern>/ShoppingServlet</url-pattern>
</servlet-mapping>

在JSP中引用到这个SERVLET:
<form name="shoppingForm"
action="ShoppingServlet"
method="POST">
这样用没有任何问题。但是我在JSP中改成:
<form name="shoppingForm"
action="/ShoppingServlet"
method="POST">
就出问题了。
这到底是怎么回事?<url-pattern>/ShoppingServlet</url-pattern>到底是什么意思??
...全文
54 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
王释之 2002-03-17
  • 打赏
  • 举报
回复
action指向的是<servlet-name>,而不是他的<url-pattern>,
因为web.xml中对servlet有两项,一项是对应package路径,一个
是对应url,最终的url:http://xxx.xxx.xxx.xxx/<servlet-name>

23,409

社区成员

发帖
与我相关
我的任务
社区描述
Java 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧