Here is the code for JApplet to servlet communication private URLConnection getServletConnection(String servletName) throws MalformedURLException, IOException { URL urlServlet = new URL(getCodeBase(), servletName); con = urlServlet.openConnection(); con.setDoInput(true); con.setDoOutput(true); con.setUseCaches(false); return con; }
That's going to work except for the "getCodeBase()", which is an applet method. You're going to need to get the servlet URL some other way -- i.e., letting the user type it in, or from a configuration file or something.
But surely if you tried this, the compiler error message already made this clear enough?
ItemDetails is my application name, dbmodify is the urlpattern which is written in web.xml for that particular servlet.
Help me,
Thanks in advance
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35252
7
posted
0
Kalyan, you need to provide more detail if you want us to help you: TellTheDetails.
E.g., what does this mean:
the servlet is not responding.
Does the request ever get to the server? Does the request ever get to the servlet? Is any of the code of the servlet run? Are there exception, either on the client or the server?
kalyan chowdary
Greenhorn
Joined: Jun 22, 2006
Posts: 24
posted
0
hi,
I mean servlet is not called
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35252
7
posted
0
It's impossible to determine what might be going wrong if you don't tell us what's happening in detail. Make sure the URL you're accessing is correct (e.g., at first you seem to call parts of it "db", and then later "dbmodify"), and that the code that calls it is actually being run. Good luck.