dkartik
Posts: 1
|
Posted: 09/26/2005, 8:11 AM |
|
Hi to all,
I need coding in JSP for allowing only users from particular IP address list which is stored in database.The code must first get the User IP address and compare it the IP List in database and should allow user only if the user IP is listed in database IP list.
Thanks in advance..
_________________
Love,
Karthi |
|
|
awalland
Posts: 7
|
Posted: 10/02/2005, 8:42 PM |
|
if(Integer.parseInt(DBTools.dLookUp("count(*)", "table", "ip_address = '"+e.getPage().getRequest().getRemoteAddr().toString()+"'", "Connection1")) == 0){
e.getPage().setRedirect("access_denied_page.jsp");
}
hth, armin
|
|
|
newbie
|
Posted: 10/10/2005, 7:52 AM |
|
Hey,
I am getting this error. Any ideas?
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 6 in the jsp file: /MERCHANT_maintHandlers.jsp
Generated servlet error:
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\ocg\org\apache\jsp\MERCHANT_005fmaint_jsp.java:469: cannot resolve symbol
symbol : method parseInt (java.lang.Object)
location: class java.lang.Integer
if(Integer.parseInt(DBTools.dLookUp("count(*)", "useraccount", "username="+userName, "ocgdb")) > 0){
^
1 error
|
|
|
miko
Posts: 50
|
Posted: 10/10/2005, 11:38 PM |
|
You can try the following code:
if(Utils.convertToLong(DBTools.dLookUp("count(*)", "useraccount", "username="+userName, "ocgdb")).intValue() > 0){
_________________
Regards,
Michael |
|
|
|