This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getRemotePort() and getLocalPort() error

 
satya mahapatra
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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


It is getLocalPort() not getLocalePort() method!


Thanks,
 
satya mahapatra
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic