Actually I have my package structure like it.com.chat.java Now, My all the servlets are inside the java folder. now i have make a jar file, which is exactly same as my structure i mean when u will extract that jar u will find all the servlets inside the it.com.chat.java
If I want to call the LoginServlet inside that .jar file , then how can I do this...?
waiting for ur reply, Thanks in advance. Siddharth
Actually I have some question regarding the DD(web.xml).what should be written in web.xml??? and ya another question is that at where i should placed my .jar file?? I mean where in tomcat directory....?
Now I came to know that where to put my .jar inside the Tomcat directory... that is under WEB-INF/LIB isn't it? But still i am facing some problem while running the servelt inside that .jar file..? I mean it is showing me "Page not found error....".
Could you please give me the answer of the following questions?
1) Is there any changes or updation is necessary in my web.xml? 2) If yes then what will be the changes? 3) If I want to access that servlet by using URLConnection object then what should be URL path that i have to pass inside the URL constructor while creating the new URL ?
Now I am facing another problem , by changing the code inside the servlet. The servlet gets compile very nicely.It means there is no error in the servlet...now i am not able to access it. But when I make undo to the servlet , then it is working fine.
Now if by changing the servlet code i am not able to access the servlet , actually what it shows? If there is a problem with servlet then i think it should not compile, am I right? But as it gets compile then what will be the problem , I am not able to find it out.
Thank you, Mr. Ben, I got ur point to keep watchin my server's log.. but what is actully happned is that Before modify my servlet I have put a message which will tell me that my application is properly deployed on server or not... and when I start my Tomcat server it will show me that message that my application has been deployed successfully.. but after modifying my servelt even I was not able to see that message. It means there is some problem occured after doing this. So I am not able to catch the error over here..b'cz it is not showing any error or any message on log.
Thank you, Mr. Ben , I got the error. The tomcat had written error in log file . It was about deployment. Now I have found it, but when I am try to run it, it shows me error like "HTTP Status 405 - HTTP method GET is not supported by this URL"
But I am confused that I don't have any GET mehod in my servlet..? What will be the problem??
hello Thanks for reply I have overridden the doPost() method in my servlet I dont have overridden doGet() method in the servlet Then too i am getting this error which i had speciied to u As I have asked query in JSP forum abt changing the client from JSP to Swing I am getting error of stream and i am not even able to run the servlet from the browser also The error reads ::: "HTTP 405 THE GET METHOD IS NOT SUPPORTED BY THIS URL"
Hello thanks niraj As u told me to use doGet() Why cant i use doPost() method as i am sending data with my button click event and if i want to use doPost then i have to override it . and that i have done in my servlet. Still i am getting error of doGet()
hello Ben thanks for reply ans as u have replied in JSP forum to change the client from JSP to Swing. according to ur answer i want to call servlet from the Swing interface and when i do this thing i dont think so that i require to specify the menthod name(ie dopost or doget) Just creating an http url connection as been given in the link u specified :: jakarta.apache.org/commons/httpclient
when i do this i get cooneted to the servlets successfully but iu m not able to do I/O with servlets Actually my stream at the client is not getting initialized and it throws an I/O exception :: HTTP RESPONSE CODE 405 <URL NAME> NOT FOUND
This exception is generated at the client side Help regarding the same
Siddharth, please reduce the number of abbreviations in your posts. (u, ans, ur etc) You don't have and we won't force you to, but we prefer that they aren't used since they make posts harder to read for visitors who don't have English as their first language. When combined with spelling and grammar errors they can make posts almost impossible to understand.
Siddharth, To be honest with you, I don't do this often enough to be able to debug your code without looking all of this up. I do know that I followed that tutorial and was able to stream objects back and forth from a Swing Applet to a servlet. This was quite a while ago.
At this point, your problem is not really a Servlet one. It has more to do with calling a web resource from a Swing app. I'm not sure which forum would be the best for this (maybe Distrbuted Java or IO/Streams). [ April 03, 2005: Message edited by: Ben Souther ]
Actually I am not calling the servlet from my applet but it's a swing application. Now , I have all the thing workig nicely that I am able to send request from my swing app. to servlet and getting response back from the servlet...
Now, a question that is giving me little bit harrasment is that if I want to call a method which is declared inside servlet and I want to call that method directly from my client application by just connection it with URL...So is it possible....???
Another question is that how many streams I can open in a servlet to talk with the clients...?
No, use the standard service methods (doPost and doGet).
You would probably be interested in web services. Take a look at http://xml.apache.org/axis. It's a webservice engine that has been implemented as a servlet (as well as standalone). With it, you can make the type of remote procedure calls over HTTP that you are describing.
if you mean 'how many clients can talk to the servlet at one time', then the answer would be: as many as the servlet container can handle. i read in one of these forums that for apache Tomcat this comes to be about 2 requests per second.
But if you mean how many streams of one servlet you can open for one client, then the answer would be one input stream and one output stream.
Hi, you can just add your path it.com.chat.java appended with .ServletName, which you wanna call, and add that jar to classpath of your application server. so that it may really work. For creating objects of your Servlet class(which you wanna call), you can just reference it by it.com.chat.java.ServletName, you understand what I mean, you can just append the name of your servlet class to the end of your it.com.chat.java, and do whatever u want. Vikky