UNIX Socket FAQ

A forum for questions and answers about network programming on Linux and all other Unix-like systems

You are not logged in.

  • Index
  • » Java
  • » Help to understand 2 small piece of java code...

#1 2008-02-14 11:15 PM

felix
Member
Registered: 2003-12-04
Posts: 171

Re: Help to understand 2 small piece of java code...

String requestURL = httpRequest.getRequestURL().toString();
   String redirect =  "http://" + requestURL.substring( (requestURL.indexOf("://") + 3 ), ( requestURL.lastIndexOf(":"))) + "/SUS";

   // Some irrelevant code.

   httpResponse.sendRedirect( redirect );

Offline

#2 2008-02-19 07:40 PM

mlampkin
Administrator
From: Sol 3
Registered: 2002-06-12
Posts: 911
Website

Re: Help to understand 2 small piece of java code...


"The only difference between me and a madman is that I'm not mad."

Salvador Dali (1904-1989)

Offline

#3 2008-02-19 09:47 PM

felix
Member
Registered: 2003-12-04
Posts: 171

Re: Help to understand 2 small piece of java code...

Hi mlampkin,

Thank you for reply, was very useful! All this job, to only return the exact hostname of the URL... hehehe

I don't know if it cause a IndexOutOfBounds, but this code works well.

Any idea about the other java snipp of code ? :)

Thank you,

Regards

Offline

#4 2008-02-19 10:06 PM

mlampkin
Administrator
From: Sol 3
Registered: 2002-06-12
Posts: 911
Website

Re: Help to understand 2 small piece of java code...

Alas... sorry but I'm not really that familiar with jsp or the BEA stuff...

Anyone else out there know what that fragment is doing ?


Michael


"The only difference between me and a madman is that I'm not mad."

Salvador Dali (1904-1989)

Offline

#5 2008-12-27 04:58 AM

tony47ch
Guest

Re: Help to understand 2 small piece of java code...

nice to meet you all.

  • Index
  • » Java
  • » Help to understand 2 small piece of java code...

Board footer

Powered by FluxBB