boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - still web.xml question
相关主题
Run Servlet with Tomcat
servlet-mapping causing http 404 error
tomcat连接mysql求助
[转载] Urgent Help needed about Java Servlet?
求助!Tomcat下设置servlets的问题
spring mvc 里面 view 必须是 jsp吗?
URL 的问题怎么解决?
有没有办法在browser第一次访问的时候知道是不是支持cookie?
html form and java
Re: Desperately need help on DB2 connection through jdbc in jsp page
相关话题的讨论汇总
话题: servlet话题: name话题: myservlet话题: class
进入Java版参与讨论
1 (共1页)
c******e
发帖数: 139
1
in a html,
action="http://localhost:8080/servlet/servletclient"
according to this action,is the following web.xml right? if the class is
C:\apache-tomcat-5.5.23\webapps\ROOT\WEB-INF\classes\servletclient
web.xml
.
.
.

MyServlet
servletclient


MyServlet
/servlet/servletclient

.
.
A**o
发帖数: 1550
2
servlet标准不支持匿名类。
你的没有包前缀的类是匿名类。

【在 c******e 的大作中提到】
: in a html,
: action="http://localhost:8080/servlet/servletclient"
: according to this action,is the following web.xml right? if the class is
: C:\apache-tomcat-5.5.23\webapps\ROOT\WEB-INF\classes\servletclient
: web.xml
: .
: .
: .
:
: MyServlet

c******e
发帖数: 139
3
是写成这样吗?

MyServlet
ROOT.servletclient


MyServlet
/servlet/servletclient

可是不对。
谢谢指点。

【在 A**o 的大作中提到】
: servlet标准不支持匿名类。
: 你的没有包前缀的类是匿名类。

A**o
发帖数: 1550
4
你的servletclient类很特殊么?为啥不能把它放在一个包里?
比如:
package cherokee;
public class servletclient ...
这样子你的servletclient.class应该被发布到/WEB-INF/classes/cherokee目录下,修
改你的web.xml。
c******e
发帖数: 139
5
还是不对。
如果放到cherokee package 下,web.xml是不是应该是

MyServlet
ckerokee.servletclient


MyServlet
/servlet/servletclient

如果直接放在class package 里,web.xml是不是

MyServlet
servletclient


【在 A**o 的大作中提到】
: 你的servletclient类很特殊么?为啥不能把它放在一个包里?
: 比如:
: package cherokee;
: public class servletclient ...
: 这样子你的servletclient.class应该被发布到/WEB-INF/classes/cherokee目录下,修
: 改你的web.xml。

m******t
发帖数: 2416
6

I couldn't find it anywhere in the spec about this. Do you remember the
particular section?
(That was an honest question. I'm genuinely not aware of this limitation and
just curious about learning more about it.)

【在 A**o 的大作中提到】
: servlet标准不支持匿名类。
: 你的没有包前缀的类是匿名类。

A**o
发帖数: 1550
7
i can take a look. i read this kind of answers often on the forum.
i might have looked up myself long time ago...
we'll see.

and

【在 m******t 的大作中提到】
:
: I couldn't find it anywhere in the spec about this. Do you remember the
: particular section?
: (That was an honest question. I'm genuinely not aware of this limitation and
: just curious about learning more about it.)

h**d
发帖数: 474
8
分特,俺真不知道有这规定,
从来没有这么写过class,呵呵

【在 A**o 的大作中提到】
: i can take a look. i read this kind of answers often on the forum.
: i might have looked up myself long time ago...
: we'll see.
:
: and

A**o
发帖数: 1550
9
不好意思,我也没找到。而且我也好像说错了,这里是我在Java Spec里面找到的。
关键是倒数第二段,估计跟为什么class not found有关。
7.4.2 Unnamed Packages
A compilation unit that has no package declaration is part of an unnamed
package.
Note that an unnamed package cannot have subpackages, since the syntax of a
package declaration always includes a reference to a named top level package.
As an example, the compilation unit:
class FirstCall {
public static void main(String[] args) {
System.out.println("Mr. Watson, come here. "

【在 m******t 的大作中提到】
:
: I couldn't find it anywhere in the spec about this. Do you remember the
: particular section?
: (That was an honest question. I'm genuinely not aware of this limitation and
: just curious about learning more about it.)

c******e
发帖数: 139
10
谢谢各位,终于行了。
m******t
发帖数: 2416
11
Thanks. It's informative anyway. 8-)
I guess the problem with this is it's hard to actually verify by trying it
out - even if a particular container allows it, we still wouldn't know if it
's just a vendor specific extension.

【在 A**o 的大作中提到】
: 不好意思,我也没找到。而且我也好像说错了,这里是我在Java Spec里面找到的。
: 关键是倒数第二段,估计跟为什么class not found有关。
: 7.4.2 Unnamed Packages
: A compilation unit that has no package declaration is part of an unnamed
: package.
: Note that an unnamed package cannot have subpackages, since the syntax of a
: package declaration always includes a reference to a named top level package.
: As an example, the compilation unit:
: class FirstCall {
: public static void main(String[] args) {

1 (共1页)
进入Java版参与讨论
相关主题
Re: Desperately need help on DB2 connection through jdbc in jsp page
大家愿意讨论一下log4j么
tomcat 访问硬盘文件的问题, 3x
J2EE: why is my .jsp not refreshed?
菜鸟请教版上大虾--如何用Java建一个连接Dababase的Tomcat网页
HTTP Status 404 The requested resource (/abc/index.jsp) is not available.
web app 每天更新数据一次
spring mvc 静态文件访问不了
上传和下载JPG到MYSQL数据库代码如下
JSP tag file and EL warnings
相关话题的讨论汇总
话题: servlet话题: name话题: myservlet话题: class