Re: Converting HOST to IP an IP to HOST

2002-08-09 Thread Jose Francisco Junior

The case is that I whould not like to do somithing like
 this:

if( "http://machineName1:8080".equals(
 request.getRequestURL() )||
 "http://www.my_system_url:8080".equals(
 request.getRequestURL() ) ||
 "http://200.2001.148.10:8080".equals(
 request.getRequestURL() ) )
showContent1();
else if( "http://machineName2:8080".equals(
 request.getRequestURL() )||
 "http://www.my_system_url_2:8080".equals(
 request.getRequestURL() ) ||
 "http://200.2001.148.11:8080".equals(
 request.getRequestURL() ) )
showContent2();
...and so on...

I whould like to do some like this:

if( "200.2001.148.10".equals(
 request.getRequestURL().toIPAddress() )
 showContent1();
else if( "200.2001.148.11".equals(
 request.getRequestURL()toIPAddress() )
 showContent2();
...and so on...

PS:toIPAddress() is what I am looking for !
Note that in the first case the user can access the system
 in tree different forms.

but forget about it, it is just a whim...

best regards,
Junior





On Fri, 9 Aug 2002 15:21:52 -0400 
"Turner, John" <[EMAIL PROTECTED]> wrote:
>
>Well, so far you've asked two different questions, yet
> they are supposed to
>be the same.
>
>Your first post wanted an IP address from a name,
> getByName() will do that
>for you, assuming by "name" you mean fully-qualified
> internet domain name.  
>
>Now you are saying that the IP address will actually be in
> the URL, in which
>case you don't need to look it up, so it's not clear what
> you are trying to
>do.
>
>If you need to differentiate content based on whether
> someone accesses a
>resource by IP address or name, and there are many
> possible IP addresses,
>then all you have to do is test if the value returned from
> getRequestURI()
>has an IP address in it.  So rather than look for a
> specific IP address, all
>you have to do is look for ANY IP address.  That will tell
> you if someone
>entered the machine name or not.  
>
>If you need something to translate a Microsoft WINS name
> (server name) to an
>IP address, you'll need some sort of Java WINS
> library...check google...my
>guess is the SAMBA group has written one
> (http://www.samba.org) but it may
>not be generally available.
>
>John Turner
>[EMAIL PROTECTED]
>
>-Original Message-
>From: Jose Francisco Junior [mailto:[EMAIL PROTECTED]]
>Sent: Friday, August 09, 2002 2:55 PM
>To: Tomcat Users List
>Subject: Converting HOST to IP an IP to HOST
>
>
>All right, but it does not solve my problem. I did a local
> web system that can be accessed both by IP or HOST.
> Depending on the way the user accessed( by HOST or IP )
> the application I must display different contents. 
>
>I could do this:
>
>if(
>
 request.getRequestURL().toString().equals("192.168.20.10")
> ) 
> out.print("show IP content"); 
>else 
> ou.print("show HOST content");
>
>But the web server has many network devices and the user
> can accesss the system from many other IP and HOSTs.
>
>The InetAddress.getByName() does not work with the machine
> network name only with inet hosts.
>
>Does anybody has any idea ???
>
>
>Thanks in advice,
>Junior
>
>
>
>On Fri, 9 Aug 2002 13:50:59 -0400 
>"Turner, John" <[EMAIL PROTECTED]> wrote:
>>
>>Come on...RTFM:
>>
>>java.net.InetAddress.getByName();
>>
>>Sheesh.
>>
>>John Turner
>>[EMAIL PROTECTED]
>>
>>
>>-Original Message-
>>From: Jose Francisco Junior [mailto:[EMAIL PROTECTED]]
>>Sent: Friday, August 09, 2002 1:44 PM
>>To: Tomcat Users List
>>Subject: Re: Configuration for High TPS
>>
>>
>>Please,
>>
>>I know it is a bit off-topic but I am trying to get a IP
>> address from an URL like this:
>>new URL("http://java.sun.com";); //this is the URL
>>
>>How can I get the IP address from this URL? Any idea ??
>>
>>
>>Thanks in advance,
>>Junior 
>>
>>Don't E-Mail, ZipMail! http://www.zipmail.com/
>>
>>--
>>To unsubscribe, e-mail:
>><mailto:[EMAIL PROTECTED]>
>>For additional commands, e-mail:
>><mailto:[EMAIL PROTECTED]>
>>
>>--
>>To unsubscribe, e-mail:
>>   <mailto:[EMAIL PROTECTED]>
>>For additional commands, e-mail:
>> <mailto:[EMAIL PROTECTED]>
>>
>
>-
>Prefiro as lágrimas da derrota
>do que a vergonha de não ter lutado... 
>
>Willan Brook
>-
>
>Don't E-Mail, ZipMail! http://www.zipmail.com/
>
>--
>To unsubscribe, e-mail:
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>
>
>--
>To unsubscribe, e-mail:
>   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>

-
Prefiro as lágrimas da derrota
do que a vergonha de não ter lutado... 

Willan Brook
-

Don't E-Mail, ZipMail! http://www.zipmail.com/

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Converting HOST to IP an IP to HOST

2002-08-09 Thread Jose Francisco Junior

All right, but it does not solve my problem. I did a local
 web system that can be accessed both by IP or HOST.
 Depending on the way the user accessed( by HOST or IP )
 the application I must display different contents. 

I could do this:

if(
 request.getRequestURL().toString().equals("192.168.20.10")
 ) 
 out.print("show IP content"); 
else 
 ou.print("show HOST content");

But the web server has many network devices and the user
 can accesss the system from many other IP and HOSTs.

The InetAddress.getByName() does not work with the machine
 network name only with inet hosts.

Does anybody has any idea ???


Thanks in advice,
Junior



On Fri, 9 Aug 2002 13:50:59 -0400 
"Turner, John" <[EMAIL PROTECTED]> wrote:
>
>Come on...RTFM:
>
>java.net.InetAddress.getByName();
>
>Sheesh.
>
>John Turner
>[EMAIL PROTECTED]
>
>
>-Original Message-
>From: Jose Francisco Junior [mailto:[EMAIL PROTECTED]]
>Sent: Friday, August 09, 2002 1:44 PM
>To: Tomcat Users List
>Subject: Re: Configuration for High TPS
>
>
>Please,
>
>I know it is a bit off-topic but I am trying to get a IP
> address from an URL like this:
>new URL("http://java.sun.com";); //this is the URL
>
>How can I get the IP address from this URL? Any idea ??
>
>
>Thanks in advance,
>Junior 
>
>Don't E-Mail, ZipMail! http://www.zipmail.com/
>
>--
>To unsubscribe, e-mail:
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
><mailto:[EMAIL PROTECTED]>
>
>--
>To unsubscribe, e-mail:
>   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>

-
Prefiro as lágrimas da derrota
do que a vergonha de não ter lutado... 

Willan Brook
-

Don't E-Mail, ZipMail! http://www.zipmail.com/

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>




Re: Configuration for High TPS

2002-08-09 Thread Jose Francisco Junior

Please,

I know it is a bit off-topic but I am trying to get a IP
 address from an URL like this:
new URL("http://java.sun.com";); //this is the URL

How can I get the IP address from this URL? Any idea ??


Thanks in advance,
Junior 

Don't E-Mail, ZipMail! http://www.zipmail.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: jsp include question

2002-08-09 Thread Jose Francisco Junior

If you want to redirect the request you have to do it
 before printing any other thing on the page.

Example:

it works:





...

...

it does not work:



...



...
On Fri, 9 Aug 2002 09:38:32 -0700 (PDT)
Ashish Kulkarni <[EMAIL PROTECTED]> wrote:
>Hi
>
>I am developing a web application and came accross
>this problem.
>when in my jsp page i have  runtime
>include and then later in the code when i have
>response.sendRedirect or
>request.getRequestDispatcher() to forward the jsp page
>i get error saying the
>java.lang.IllegalStateException: Response has already
>been committed.
>but when i use <%@ %> compile time include i  dont get
>this error, 
>Can some one explain the why
>Ashish
>
>__
>Do You Yahoo!?
>HotJobs - Search Thousands of New Jobs
>http://www.hotjobs.com
>
>--
>To unsubscribe, e-mail:
>   
>For additional commands, e-mail:
> 
>

-
Prefiro as lágrimas da derrota
do que a vergonha de não ter lutado... 

Willan Brook
-

Don't E-Mail, ZipMail! http://www.zipmail.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: SSL just for a login page

2002-08-09 Thread Jose Francisco Junior

And what happens with the user session ??? Every single
 page a verify if the user session is Ok, if not I have to
 redirect him to the login page. But if I do what you are
 saying I will lost the user session.

Junior

On Fri, 9 Aug 2002 09:08:22 -0500
"Durham David Cntr 805CSS/SCBE"
 <[EMAIL PROTECTED]> wrote:
>Why don't you just build your redirect after they log in.
>  
>
>   response.sendRedirect("http://"; + request.getHostName() +
> "/myApp/home.jsp");
>
>
>
>
>> -Original Message-
>> From: Drinkwater, GJ (Glen)
> [mailto:[EMAIL PROTECTED]]
>> Sent: Friday, August 09, 2002 8:52 AM
>> To: 'Tomcat Users List'
>> Subject: RE: SSL just for a login page
>> 
>> 
>> Hi
>> 
>> I am not am expert in the security of the web at the
> moment. 
>> Could you explain to me why this would open such a big 
>> secuirty hole from
>> swapping from https to https.
>> 
>> I was suggesting this because it read this i a
> 'professional 
>> j2ee' book?!! 
>> 
>> The problem i have is that i need the username and
> password 
>> to be encrypted
>> but i have heard that ssl hits performance quite badly!!
>  I 
>> dont think that
>> i could handle filtering, so what do you suggest for the
> security??
>> 
>> What is the 'norm' for these such problems.
>> 
>> Thanks Glen. 
>> 
>> 
>> --
>> To unsubscribe, e-mail:   
>
>For additional commands, e-mail:
> 
>
>
>--
>To unsubscribe, e-mail:
>   
>For additional commands, e-mail:
> 
>

-
Prefiro as lágrimas da derrota
do que a vergonha de não ter lutado... 

Willan Brook
-

Don't E-Mail, ZipMail! http://www.zipmail.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




SSL Session x Non SSL Session Problem

2002-08-08 Thread Jose Francisco Junior

Please,

Does anybody know anything about the problem below !!!

I can't share an session object that was instatiated on a
 SSL connection with a NON SSL connection.

I am trying to authenticate users using a SSL connection
 and after the authentication I forward the request to an
 Non-SSL connection but the session object is invalidated.

How can I solve this problem ?

Thanks in advance,
Junior

Don't E-Mail, ZipMail! http://www.zipmail.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: