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

difference between getServerPort and getLocalPort

 
avi sinha
Ranch Hand
Posts: 453
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i was reading the Api specification and i found :



and



what i know is that Local port is the port where the request was made and server port is the port where the response was given by the server.
i got confused by the lines :
Localport --> which the request was received
serverport ---> the client connection was accepted on.

i think i am missing something .please help.

avi sinha
 
mingt sun
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know either. However, for the exam, I don't think you really need to understand the difference. Understanding the difference between getRemotePort() and getServerPort()/getLocalPort() is enough.
 
Niteen Patil
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remembering the methods provided in the API.

Hi Ranchers,
Will some one provide me the details of what is expected related to the API and which methods are to be known.
Interface or class name , method and the explanation of the method for each interface or class.
Thanks.
 
avi sinha
Ranch Hand
Posts: 453
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mingt sun wrote: Understanding the difference between getRemotePort() and getServerPort()/getLocalPort() is enough.


i am just trying to do the above my friend.

avi sinha
 
mingt sun
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I meant all you need to know is getRemotePort() is the port on client side, getServerPort() and getLocalPort() are the port on server side. As far as the difference between getServerPort() and getLocalPort(), I don't think it's one of the exam objectives. At least I never came accross questions on this, of more than 1000 practice questions.
 
mingt sun
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nitinyanand Patil wrote:Remembering the methods provided in the API.

Hi Ranchers,
Will some one provide me the details of what is expected related to the API and which methods are to be known.
Interface or class name , method and the explanation of the method for each interface or class.
Thanks.


Well, that's hard to say exactly which methods are on/off the exam. Could getPathTranslated() be on the exam? yes, it could, but very unlikely. But we surely expect to see getCookies().

I guess ServletRequest, ServletResponse, HttpServletRequest, HttpServletResponse, ServletContext, ServletConfig, all 8 listerners are among the most important classes/interfaces.

Also it is critical to memorize all implicit objects for EL and jsp.
 
avi sinha
Ranch Hand
Posts: 453
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nitinyanand Patil wrote:Remembering the methods provided in the API.

Hi Ranchers,
Will some one provide me the details of what is expected related to the API and which methods are to be known.
Interface or class name , method and the explanation of the method for each interface or class.
Thanks.


if you are reading HFS them be sure to know each and every method mentioned.
also you should go through SCWCD_API

and the most important thing Don't study to crack the exam . do it to gain expertise over the objectives.
the reason is that these things will help you further.

avi sinha
 
Niteen Patil
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
avi sinha wrote:
Nitinyanand Patil wrote:Remembering the methods provided in the API.

Hi Ranchers,
Will some one provide me the details of what is expected related to the API and which methods are to be known.
Interface or class name , method and the explanation of the method for each interface or class.
Thanks.


if you are reading HFS them be sure to know each and every method mentioned.
also you should go through SCWCD_API

and the most important thing Don't study to crack the exam . do it to gain expertise over the objectives.
the reason is that these things will help you further.

avi sinha

Hi Avi Sinha,
I know that Ashok_SCWCD_API is the one to which we can refer to the API(not http://esnault.frederic.free.fr/certification/scwcd_notes.pdf).
I want to know the way by which we can gain expertise over the objectives as stated by you.
Also we can't ignore the fact that to get good score(not just cracking the exam) we have to remember the API.
Please share some tips thr' which we can do that.
Thanks.
 
avi sinha
Ranch Hand
Posts: 453
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nitinyanand Patil wrote:
Also we can't ignore the fact that to get good score(not just cracking the exam) we have to remember the API.
Please share some tips thr' which we can do that.
Thanks.

for getting a good score you should know the api. you should figure out how the api works not just remembering it.


in servlets and jsp you can figure out the interface or classes a method can belong.
i am giving you an example :
getHeader/getHeaderNames/getHeaders and all header related methods : they can't reside in ServletRequest interface because this interface is not related to HTTP.

just follow my suggestion and you will not have to memorize everything.

avi sinha
 
Niteen Patil
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks avi sinha.
 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If we say getServerPort() it 'returns the port number to which the request was sent'. If we hosted server on port no. 8080 and made a request to it. Then the request goes to the port no. 8080. The getServerPort() returns that port number. For details of getLocalPort() method, see this.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic