• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to use Adaptor class

 
gokulanand narayanan
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I implemented Javax.servlet.ServletRequest Interface.

In that all are abstract methods, i want to use only the getRemoteAddr()method through adaptor class.

how to use that can u guide me

Thanks in advance
 
Kj Reddy
Ranch Hand
Posts: 1704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by gokulanand narayanan:
Hi,

I implemented Javax.servlet.ServletRequest Interface.

In that all are abstract methods, i want to use only the getRemoteAddr()method through adaptor class.

how to use that can u guide me

Thanks in advance


You do not need to implement, container will implement for you.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree, I'm not sure what you're trying to do so I'm not sure how to help you.

Dave
 
gokulanand narayanan
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I want to get the ClientAddress How can i do for that

pls guide me
 
Kj Reddy
Ranch Hand
Posts: 1704
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by gokulanand narayanan:
Hi,

I want to get the ClientAddress How can i do for that

pls guide me


What is ClientAddress? I do not understand your requirement exactly.
I understood something like you want use the data in your Adaptor class provided by ServletRequest. You have many alternatives for this. One alternative is create JavaBean class which will hold the data of ClientAddress and instantiate ClientAddress class based on the data you get from ServletRequest. And pass this instance of ClientAddress to your adaptor.

You can directly pass ServletRequest to Adaptor but it is not advisable.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you call the getRemoteAddress method from the request object that is passed to you from the container?
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/ServletRequest.html#getRemoteAddr()
 
furqan naqvi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi gokulanand,
ben is right using getRemoteAddress from request object is the best solution to the problem...
 
gokulanand narayanan
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank u guys

I got it.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!