servlet-container

Serve files from a folder different of context directory in a servlet container

久未见 提交于 2021-01-29 17:50:29
问题 I got a situation that I must serve files from different folders then the one of the context my web app is running. As an example, suppose my web app is running in a servlet context on "/opt/tomcat/webapps/ROOT/" and I must serve files existent in "/opt/my_other_folder/". These folders can be changed in runtime by the client, so I can't simply add a new context pointing to these directories. I would like a solution that I wouldn't have to rewrite a web server only for that. Also, the product

doGet or doPost method invocation [duplicate]

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 12:52:58
问题 This question already has answers here : How doGet() or doPost method invokes service() method internally (3 answers) Closed 3 years ago . How does the servlet container know whether to call doGet or doPost method. When I make a get request doGet is called, When I make a post request doPost is called , but where is the logic to decide this . 回答1: You never really call doGet() or doPost() (the service() method will, and it is called by the Web container as you read in the lifecycle). The

What is the lifecycle of a jsp PageContext object - is it threadsafe?

狂风中的少年 提交于 2019-12-23 12:23:14
问题 Are jsp PageContext objects created and destroyed as part of the http request-response cycle or are they cached and reused between requests. PageContext has life-cycle methods that suggest reuse between requests. ie initialize(), release(). If they are reused this could pose serious concurrency problems: if two http requests arrive, requesting the same jsp page, and each request is processed by its own thread, but sets attributes on a shared PageContext object, they will render each others'

Loading derby.war (derby servlet server) before other web applications in Tomcat

筅森魡賤 提交于 2019-12-23 02:49:12
问题 Apache Derby has an option to run its "Network Server" as a web application in a servlet container ( derby.war ). The problem is then how to deploy other applications that depend on derby in the same container to load after derby loads (preferable in a Tomcat container). From what I recall there is no way to control the order of web application initialization in Tomcat. Has anybody gotten derby.war to work in a multiple web application environment? 回答1: You'll probably find it easier and more

Tomcat is web server or application server? [closed]

痞子三分冷 提交于 2019-12-20 08:26:52
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . Is Tomcat a web server or an application server? 回答1: Tomcat is a web server (can handle HTTP requests/responses) and web container (implements Java Servlet API, also called servletcontainer) in one. Some may call it an application server, but it is definitely not an fullfledged Java EE application server (it

What are some Servlet Container for Netty

三世轮回 提交于 2019-12-13 07:09:15
问题 I wanted to build myself a Web based chat application (something like hipchat or facebook chat)I think netty is the way for this since it is event driven, However. Netty does not have any servlet container. So How do I build my own servlet container for netty? or better yet how do you build your own ServletContainer? 回答1: Perhaps Netty is too low level for what you are trying to accomplish. If you want an embedded solution in which servlets can be executed, why not trying Jetty instead? http:

Loading derby.war (derby servlet server) before other web applications in Tomcat

孤街醉人 提交于 2019-12-08 03:11:25
Apache Derby has an option to run its "Network Server" as a web application in a servlet container ( derby.war ). The problem is then how to deploy other applications that depend on derby in the same container to load after derby loads (preferable in a Tomcat container). From what I recall there is no way to control the order of web application initialization in Tomcat. Has anybody gotten derby.war to work in a multiple web application environment? You'll probably find it easier and more reliable to run the Network Server in a separate standalone process of its own, rather than as part of the

ServletContext getRealPath method - what is a virtual path?

浪子不回头ぞ 提交于 2019-12-07 11:50:03
问题 I am reading the documentation for the getRealPath(String s) and I became confused when I read this statement Returns a String containing the real path for a given virtual path. For example, the path /index.html returns the absolute file path on the server's filesystem would be served by a request for http://host/contextPath/index.html , where contextPath is the context path of this ServletContext.. What is a virtual path? let's say I am inside in my deployment environment and when I say

ServletContext getRealPath method - what is a virtual path?

混江龙づ霸主 提交于 2019-12-05 19:25:42
I am reading the documentation for the getRealPath(String s) and I became confused when I read this statement Returns a String containing the real path for a given virtual path. For example, the path /index.html returns the absolute file path on the server's filesystem would be served by a request for http://host/contextPath/index.html , where contextPath is the context path of this ServletContext.. What is a virtual path? let's say I am inside in my deployment environment and when I say getRealPath("index.html") does this usually points to the WEB-INF directory? or does getRealPath() starts

Tomcat is web server or application server? [closed]

爱⌒轻易说出口 提交于 2019-12-02 14:09:36
Is Tomcat a web server or an application server? BalusC Tomcat is a web server (can handle HTTP requests/responses) and web container (implements Java Servlet API , also called servletcontainer) in one. Some may call it an application server , but it is definitely not an fullfledged Java EE application server (it does not implement the whole Java EE API ). See also: What exactly is Java EE? How do servlets work? Instantiation, sessions, shared variables and multithreading Tomcat is an application container that is also a web server. An application container can run web-applications (have