Originally posted by Jigar Naik:
<servlet-class>com.tg.servlets.Controller</servlet-class>
Originally posted by Ulf Dittmer:
If the "#" is actually part of the parameter, then the URL needs to be encoded by the java.net.URLEncoder.encode method.
[ March 15, 2007: Message edited by: Ulf Dittmer ]
Originally posted by K Kiran Kumar:
It's not mandatory to override init() method.
Originally posted by K Kiran Kumar:
In the absense of this method, how can we get the context instance? Can we get in doGet() or doPost() methods??
Originally posted by Srinivasan thoyyeti:
Hi Maneesh,
If you don't find out of your context, I got a small doubt...
Where this URL supposed to go, i mean without any port number!
If we don't specify the Port then it will go to HttpServer(80). but how can it reach /page?
http://localhost/host/page.do?abc=#5
Originally posted by Ben Souther:
It would have to either be initialized during its declaration or initialized in the no-arg contstructor.
Is it Allowed for us to write non-arg constructor for Servlets?
Originally posted by Ben Souther:
[QB]
The init method gets called by the container when the servlet is put into service, not when the servlet object is instanciated.
You mean init() method is called everytime a request is received for servlet? I don't think so. Init() and destroy() will be called only once in Servlet life Cycle.
Please Correct if am wrong me.
Regards, Raghav
Originally posted by Ben Souther:
The init method is not the same as a constructor.
You can not use it to initialize final variables this way.
Originally posted by Ben Souther:
Servlet.getServletContext(contextName) can get you access to another context within the same server. Tomcat, for instance disables this, by default. To enable this capability, see the crossContext attribute on this page:
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
Originally posted by Ulf Dittmer:
Your machine must be accessible for inbound traffic, which most desktop machines are not these days. Do you have a static IP address, and does the firewall/NAT allow traffic to get through to it? If you aren't sure, ask a system administrator.