• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Applets - web application

 
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
How can we get the client's IP Address?
Iam using Applet web application(Applet+tomcat server).

Any one known about that please give me the sample code..


-- thanks in advance

-- bharathi
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Would this code run in the applet or the servlet? If the latter, check out HttpServletRequest.getRemoteAddr method. Be sure to read its javadocs.
 
muthu bharathi
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Thanks for quick response.

Im new to this concept. please send me the complete code.

and also please give me some samples for Applet run on Tomcat Server..

very urgent....

--
Bharathi
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Im new to this concept. please send me the complete code.


The code of what? It's just a single method call.

also please give me some samples for Applet run on Tomcat Server.


What would these examples show? An applet consists of an HTML (or JSP) file containing an applet tag, and some class files (or maybe jar files), all placed together in a public directory in your web app. The Sun Java Tutorial explains all this in detail.
 
muthu bharathi
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
If we use httpRequest we'll get only the last Proxy IP address.

How we get the client machine's IP in J2EE Application.


-- thanks in advance,
--
bharathi
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If there's a proxy in between, then the proxy can usually be configured to set the originating IP address in an HTTP header. Ask your network administrator about that.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you mean by "change the Applet code into web application"? As far as I can tell -and you made it unnecessarily hard to read the code, because you didn't UseCodeTags; please do that in the future- all the applet does is to determine the local IP address. Are you asking how to determine the local IP address of the servlet container that runs the web app? I already mentioned how to get a client IP address in a web app.
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[Edit; not-so-nice post removed. Tread carefully.]
[ December 14, 2008: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you need someone else to develop for you, try posting the question at http://www.rentacoder.com or http://www.freelancers.net

If you are capable to write code yourself, but you stucks with a technical coding problem, then you are always welcome here to ask for help. But please ask the question the smart way. Elaborate about the coding problem in detail. Asking for code isn't going to work here. The more effort you put in asking the question the smart way, the more effort others will put in giving the answer, including more chance on a (relevant) code example.

Good luck.
 
muthu bharathi
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Scholtz,

Please Answer my Query:-

Im a new bie....

How can i get the clients IP Address using J2EE Application thro' Applet(Applet+servlet+Tomcat server).

some one was answered my query... but i can't understood that concept....

I know how to find the clients IP Address using Applet. now i want to know if some one(client) login into that particular site, That client Machines IP 'll be displayed in server... that's what i need

--- Advance Thanks
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

some one was answered my query... but i can't understood that concept....


Then tell us what you have trouble understanding, and we'll try to help you understand.

I know how to find the clients IP Address using Applet.


Probably not, actually, at least not reliably. Many computers are behind NATed firewalls, and so what the applet will get is something like "192.168.....". That's an internal address that doesn't tell you anything about the client.

now i want to know if some one(client) login into that particular site, That client Machines IP 'll be displayed in server...


Didn't we discuss that already? What did the network admin say regarding passing on the real IP address in addition to the proxy address?
 
muthu bharathi
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Thanks ulf....

MY task is working fine... thanks a lot.

i've one more doubt...

i've two text boxes(Name and password) in Applet and also i've another two text boxes and a submit button in JSP.

While i click on the submit button, the browser will display the values of name and password and also to display the values of two boxes(ie, in jsp).

I need guidance for Applet and JSP communication...


once again thanks a lot.

Advance thanks

-- bharathi
 
muthu bharathi
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everybody,

i was tried <jsp lugin>. the codes are compiled. At run time i was got the following error. Anybody known about that please help

***************************************************
oad: class daytimeapplet.class not found.
java.lang.ClassNotFoundException: daytimeapplet.class
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed:http://localhost:8080/Applet_servlet/build/classes/daytimeapplet/class.class
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
**************************************************************


I thought the error was in java(TM) plug-in.....

please verify it and clarify my doubt....

--ADvance Thanks

bharathi
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let's not divert this topic from the original question. Please start two new topics for these unrelated questions.
 
reply
    Bookmark Topic Watch Topic
  • New Topic