有关jsp调用servlet的问题,请大家进来看看。

tyd163xx 2002-06-20 01:07:11
我用jbuilder做一个servlet响应jsp表单的实验:

jsp页面在defaultroot\stocksearch.jsp,

对应的servlet在defaultroot\WEB-INF\classes\com\creaunion\example\servlet\StockServlet.class。

我在jsp页面里是这么写的
<form action="com/creaunion/example/servlet/StockServlet" method="post">

可我每次提交时出现:Unable to open location: Document not found on server 错误。
下面的日志如下错误:

2002-06-20 09:19:17 - path="" :debugjsp: init

2002-06-20 09:19:24 - Ctx( ): 400 R( /) null

2002-06-20 09:19:24 - Ctx( ): 404 R( + /com/creaunion/example/servlet/StockServlet + null) null

请大伙帮我看看是怎么回事?
...全文
44 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
yakuu 2002-06-21
  • 打赏
  • 举报
回复
用tomcat or weblogic???
看看它们文档中的例子。可以解决问题。
wcarry21 2002-06-20
  • 打赏
  • 举报
回复
com.creaunion.example.servlet.StockServlet
okyhc 2002-06-20
  • 打赏
  • 举报
回复
建议在web.xml里添加servlet name 和servlet url
这样你就可以用自定义的URL了
LiGun 2002-06-20
  • 打赏
  • 举报
回复
在WEB。INF文件中要有SERVLET-MAPPING才行
MagicJohn 2002-06-20
  • 打赏
  • 举报
回复
<form action="http://localhost:8080/com/creaunion/example/servlet/StockServlet" method="post">

再试一下
chrischen79 2002-06-20
  • 打赏
  • 举报
回复
form action不对,你看看web.xml中的StockServlet的uri是什么
kamanwu 2002-06-20
  • 打赏
  • 举报
回复
StockServlet.java

前面要
package com.creaunion.example.servlet;
kamanwu 2002-06-20
  • 打赏
  • 举报
回复
<form action="com.creaunion.example.servlet.StockServlet" method="post">

81,092

社区成员

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

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