aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes getRemotePort() and getLocalPort() error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "getRemotePort() and getLocalPort() error" Watch "getRemotePort() and getLocalPort() error" New topic
Author

getRemotePort() and getLocalPort() error

satya mahapatra
Ranch Hand

Joined: Jan 07, 2006
Posts: 134
Hi all,

When I am doing getRemotePort() and getLocalPort() its throwing the following error

2007-07-19 22:32:03 Error compiling file: C:\Apache Group\Tomcat 4.1\work\Standalone\localhost\Beer-v1\/result_jsp.java [javac] Since fork is true, ignoring compiler setting.
[javac] Compiling 1 source file
[javac] Since fork is true, ignoring compiler setting.
[javac] C:\Apache Group\Tomcat 4.1\work\Standalone\localhost\Beer-v1\result_jsp.java:98: cannot find symbol
[javac] symbol : method getRemotePort()
[javac] location: interface javax.servlet.http.HttpServletRequest
[javac] out.print( request.getRemotePort() );
[javac] ^
[javac] C:\Apache Group\Tomcat 4.1\work\Standalone\localhost\Beer-v1\result_jsp.java:104: cannot find symbol
[javac] symbol : method getLocalePort()
[javac] location: interface javax.servlet.http.HttpServletRequest
[javac] out.print( request.getLocalePort() );
[javac] ^
[javac] 2 errors

But gerServerPort() is workin fine. And both client and server are in the same box. Please help.

Thanks,
Satya


Regards,<br />Satya<br />SCJP,SCWCD
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707

javac] symbol : method getLocalePort()
[javac] location: interface javax.servlet.http.HttpServletRequest


It is getLocalPort() not getLocalePort() method!


Thanks,


cmbhatt
satya mahapatra
Ranch Hand

Joined: Jan 07, 2006
Posts: 134
I tried with getLocalPort() but still the same problem


Generated servlet error:
[javac] Since fork is true, ignoring compiler setting.
[javac] Compiling 1 source file
[javac] Since fork is true, ignoring compiler setting.
[javac] C:\Apache Group\Tomcat 4.1\work\Standalone\localhost\Beer-v1\result_jsp.java:108: cannot find symbol
[javac] symbol : method getLocalPort()
[javac] location: interface javax.servlet.http.HttpServletRequest
[javac] out.print( request.getLocalPort() );
[javac] ^
[javac] 1 error
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
Hi Satya,

Instead, if you post your code, it may help to find out the actual source
of the error. It seems "out" couldn't be recognized.

Thanks,
satya mahapatra
Ranch Hand

Joined: Jan 07, 2006
Posts: 134
Hi Chandra,

Thanks for replying. Actually I had a look at the ServletRequest Interface API. And I am surprised to see there is no getLocalPort() and
getRemotePort() method in the ServletRequest Interface . Only getServerPort() method is there.

FYI... my code

ServerPort:: <%= request.getServerPort() %> <br>
RemotePort:: <%= request.getRemotePort() %> <br>
LOCALPort:: <%= request.getLocalPort() %> <br>%> <br>

Thanks,
Satya
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: getRemotePort() and getLocalPort() error
 
Similar Threads
Why is this happening?
Problems of importing a class
Changing ClassPath
where to place Bean file(*.class)in Tomcat server
Package not found error in JSP