• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to restrict access to request from specific IP’s in Java web application?

 
cherry hal
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to restrict access to request from specific IP’s in Java web application?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note that the javax.servlet.ServletRequest interface has a getRemoteAddr method.

Bill

 
cherry hal
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi William Brogden,
Thank you and can you explain with programmatically i mean sample code?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64959
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have enough info to write some code for yourself. Please do so and then post back with any troubles you may be having.
 
Rob Spoor
Sheriff
Pie
Posts: 20545
56
Chrome Eclipse IDE Java Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One suggestion - use a filter to check the IP address. That way you don't have to build in the same checks in all of your servlets.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cherry hal wrote:Hi William Brogden,
Thank you and can you explain with programmatically i mean sample code?


If you are aspiring to be a servlet/jsp developer, you will learn more by coding than by asking for worked out code.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic