小弟的文件和配置如下
servlet : G:\Workspace\projectname\src\servletspackage\Servletname.java
jsp: G:\Workspace\projectname\WebContent\Object\temp\car.jsp
xml配置:
<servlet>
<description> </description>
<display-name> Servletname </display-name>
<servlet-name> Servletname </servlet-name>
<servlet-class> servletspackage.Servletname </servlet-class>
</servlet>
<servlet-mapping>
<servlet-name> Servletname </servlet-name>
<url-pattern> /Servletname </url-pattern>
</servlet-mapping>
jsp代码:
<form name=form1 action= "servletspackage/Servletname " method= "post ">
<table>
<tr>
...
<td> <input type= "text "> </td>
...
<tr>
<tr>
...
<td onClick= "alert( 'submit! ');submit(); "> 提 交 </td>
...
<tr>
</table>
<form>
================================================================
点击提交,把form里面的所有 <input type= "text "> 的值都提交给servlet,但是却出错了:
type Status report
message /projectname/Object/temp/servletspackage/Servletname
description The requested resource (/projectname/Object/temp/servletspackage/Servletname) is not available.
================================================================
请问:
我的问题出在哪里?该怎么改正?
------解决方案--------------------
<form name=form1 action= "servletspackage/Servletname " method= "post "> 改成 <form name=form1 action= "/Servletname " method= "post ">
------解决方案--------------------
action= "servletspackage/Servletname "
改成action= "/Servletname "
------解决方案--------------------
同上
------解决方案--------------------
jsp代码改为: <form name=form1 action= "Servletname " method= "post ">
------解决方案--------------------
把完整的jsp页面帖出来
------解决方案--------------------
lz的js.js代码呢?
------解决方案--------------------
var temp=document.getElementById( "carid ");
var temp=document.getElementById( "num ");
有id为carid和num的html标签吗?
lz是想实现在提交表单之前用javascript验证表单控件值吗?