这个是什么意思?不明白
我在tomcat manager里面看到的running app显示这个springapp的running 状态是
false,我在tomcat manager尝试start这个app的时候message: FAIL - Application
at context path /springapp could not be started
尝试访问localhost:8080/springapp/的时候,浏览器里显示
HTTP Status 404 - /springapp/
type Status report
message /springapp/
description The requested resource is not available.
Apache Tomcat/6.0.41
我的./springapp/war/WEB-INF/web.xml文件是
I do not think that you can compare JSF to servlet. JSF was introduced by
sun trying to compete with other application tier technologies such as
struts, spring mvc... Like all those web frameworks, jsf is based on Servlet
. Actually without jsp/servlet spec, none of those java based web frameworks
will ever work at all. JSF, not like other web frameworks, is designed
using page controller pattern, which is subtly different from front
controller patterns used by most other popular web frameworks.... 阅读全帖
By default, cookies are accessible to every HTTP request for
the current
directory, and any subdirectories. Now on most web servers
and servlet engines,
servlets are located in a special directory. For example,
when using
servletrunner (which ships with the Java Servlet Development
Kit), servlets
must be invoked under the /servlet/ directory. http://webserver/servlet/servletname
If you want your cookies to be accessible elsewhere, you
must specify the
root path of your webserver, using the
javax
Thanks for Qing DX's answer. It is really helpful.
Another urgent servlet question: The browser(IE) is somehow
caching the servlet output. There are some hyperlinks on the
output page created by serlvets. The hyperlink calls the
servlet itself or some other servlets. Due to the browser
caching problem, if the hyperlink has been clicked before,
the browser won't actually call the corresponding servlet,but
just return the previous caching pages, even the pages are
stale.
I tried to use
response.se
The answer is Yes and No.
You can use mock object to simulate servlet environment and potentially
run/test your servlet without servlet container. However, that's more about
unit testing and it is an advanced topic.
Since you said you are new for Java, I do not want to confuse you here. So,
the answer is No. You can not run servlet from command line (without servlet
container). hehe
I don't think servlet has anything to do with RMI.
Servlet is simply an entry point. You define the binding from url to servlet
in web.xml, and the web container intercepts the call and forwards to the
servlet.
eading cookies from a servlet is quite easy. You can gain
access to any
cookies sent by the browser from the
javax.servlet.http.HttpServletRequest
passed to the servlet's doGet, doPost, etc methods.
HttpServletResponse
offers a method, Cookies[] getCookies() which returns an
array of Cookie
objects.
However, if no cookies are available, this value may be
null, so be sure
to check before accessing any array elements.
// Check for cookies
Cookie[] cookie_jar = request.getCookies();
// Check to see
Butta... what I was thinking was, if you are not doing servlet
chaining, when you are calling another servlet, the instance of that
servlet you call is actually not the one taking and processing
incoming requests, and maybe not initialized at all.
Don't know, maybe we are talking about different things.
am testing the servlet application using tomcat and customized multithreded
test clients. I try the following different scenarios - synchronize or not
the servlet method. In client side, I generate 200 concurrent requests to
this servlet. There are quite different CPU usage in this scenarios: non-
synchronized one use much more CPU (almost 100%) than synchronized (as usual
). Could anyone advise me what's happened there and why has that different?
e.g.
public TestServlet .....{
public void doGet
REST WS is a language neutral spec. You don't have to use Java, even you are
using java, you don't have to use doGet or doPost. Servlet 3.0 introduces
asynchronous servlet. vertx doesn't use servlet at all.
servlet is the underlying technology and you'd better get a grasp of it. But
you rarely need to write your own servlet.
JSF is something built on top of servlet, which is more important than servl
et itself. If you want to work with a JavaEE webapplication. You probably wa
nt to pay more attention to JSF.
Not at all, servlet is the foundation of many web frameworks. e.g. Spring
MVC which still has largest market share for Java web frameworks to date.
Servlet 3.0 adds async support, servlet 3.1 adds non-blocking.
【 以下文字转载自 Programming 讨论区,原文如下 】
发信人: zack (会飞), 信区: Programming
标 题: 急!在线等---从Servlet调用AXIS的Web Service 遇到问题!
发信站: Unknown Space - 未名空间 (Thu Oct 7 14:25:33 2004) WWW-POST
各位,请一定帮帮忙,老板在催活!万分感激!
I met some difficulties when trying to call a simple web service
function from a servlet / jsp. Please give me some help or hints as
possible as you could. Thanks a lot.
I deployed a simple web service function on Tomcat/Axis SOAP server.
The .wsdl file looks fine. The only function of the web service i
【 以下文字转载自 Programming 讨论区,原文如下 】
发信人: zack (会飞), 信区: Programming
标 题: 急!在线等---从Servlet调用AXIS的Web Service 遇到问题!
发信站: Unknown Space - 未名空间 (Thu Oct 7 14:25:33 2004) WWW-POST
各位,请一定帮帮忙,老板在催活!万分感激!
I met some difficulties when trying to call a simple web service
function from a servlet / jsp. Please give me some help or hints as
possible as you could. Thanks a lot.
I deployed a simple web service function on Tomcat/Axis SOAP server.
The .wsdl file looks fine. The only function of the web service i
【 以下文字转载自 Programming 讨论区,原文如下 】
发信人: zack (会飞), 信区: Programming
标 题: 急!在线等---从Servlet调用AXIS的Web Service 遇到问题!
发信站: Unknown Space - 未名空间 (Thu Oct 7 14:25:33 2004) WWW-POST
各位,请一定帮帮忙,老板在催活!万分感激!
I met some difficulties when trying to call a simple web service
function from a servlet / jsp. Please give me some help or hints as
possible as you could. Thanks a lot.
I deployed a simple web service function on Tomcat/Axis SOAP server.
The .wsdl file looks fine. The only function of the web service i
HTTP is a stateless protocol, which makes tracking user
actions difficult.
One solution is to use a cookie, which is a small piece of
data sent by a
web browser every time it requests a page from a particular
site. Servlets,
and CGI scripts, can send cookies when a HTTP request is
made - though as
always, there is no guarantee the browser will accept it.
Cookies are represented by the javax.servlet.http.Cookie
class. Cookie has
a single constructor, which takes two strings (a key and a
value).
/
Hi guys,
I installed tomcat 4,the server works fine (shows up the test page),and the
servlet code compiles, but I can't load it with local:8080
That's what I did:create a directory of 'classes' under
webapps/Root/WEB-INF/,then put my .class file there,but when I tried
http:localhost:8080/servlet/HelloWorld, it doesn't load,always shows up
....file not available, seems I put the .class into a wrong place.
What's wrong with it?
Thanks.
help, friends:
I can start the tomcat as a standalone server and run the examples. For
simplicity, I just put my files in examples folder so that I do not need to
change server.xml and web.xml.
I can not compile the servlet, it alwasy says that the javax.servlet.* does
not exist. How can I deal with it? Thank you very very much.
【 以下文字转载自 JobHunting 讨论区,原文如下 】
发信人: littlelover (大肚子情剩), 信区: JobHunting
标 题: Urgent Help needed about Java Servlet?
发信站: Unknown Space - 未名空间 (Sat Oct 25 17:13:21 2003) WWW-POST
UserAdmin.java is in C:\jwsdp-1.3\webapps\HW3example\WEB-INF\classes
hw1_lib.jar is in C:\jwsdp-1.3\webapps\HW3example\WEB-INF\lib
我是这样compile的:
C:\jwsdp-1.3\webapps\HW3example\WEB-INF\classes>javac -classpath
C:\jwsdp-1.3\we
bapps\HW3example\WEB-INF\lib\hw1_lib.jar;c:\jwsdp-1.3\common\lib\servlet-api.j
ar
UserAdmin.ja
If you wish to use those objects, you need import the path. You should know
that JSP is nothing but a 'servlet', basically, the jsp will be translated
into a servlet while it is compiled by the J2EE container. So, it's final
representation is a class.
Import in JSP is: <%@ page import="java.lang.*" %>
Do not forget to put double quotes on the package name.