JSP not working with Windows 7

T

teser3

The below JSP (using Tomcat 6.0.24) to fetch Intranet Username has
always worked on Windows XP with IE.
Now that we upgraded to Windows 7 it no longer works. It now responds
with IE generic message Page not found. Tomcat logs doesnt show any
information or error messages.

Anything I can change to make it work using Windows 7?


<%@ page import="sun.misc.BASE64Encoder,java.util.regex.*" %>
<p><h1>Network Windows USERNAME without any login (ie)</h1></p>
<%
String auth = request.getHeader("Authorization");
if (auth == null) {
response.setStatus(response.SC_UNAUTHORIZED);
response.setHeader("WWW-Authenticate", "NTLM");
return;
}
if (auth.startsWith("NTLM ")) {
byte[] msg = new
sun.misc.BASE64Decoder().decodeBuffer(auth.substring(5));
int off = 0, length, offset;
String s;

if (msg[8] == 1) {
off = 18;

byte z = 0;
byte[] msg1 = {(byte)'N', (byte)'T', (byte)'L', (byte)'M',
(byte)'S',
(byte)'S', (byte)'P', z,
(byte)2, z, z, z, z, z, z, z,
(byte)40, z, z, z, (byte)1, (byte)130, z,
z,
z, (byte)2, (byte)2, (byte)2, z, z, z,
z, //
z, z, z, z, z, z, z, z};
//
response.setStatus(response.SC_UNAUTHORIZED);
response.setHeader("WWW-Authenticate", "NTLM "
+ new
sun.misc.BASE64Encoder().encodeBuffer(msg1).trim());
return;
}
else if (msg[8] == 3) {
off = 30;
length = msg[off+17]*256 + msg[off+16];
offset = msg[off+19]*256 + msg[off+18];
s = new String(msg, offset, length);
//out.println(s + " ");
}
else
return;

length = msg[off+1]*256 + msg[off];
offset = msg[off+3]*256 + msg[off+2];
s = new String(msg, offset, length);
//out.println(s + " ");
length = msg[off+9]*256 + msg[off+8];
offset = msg[off+11]*256 + msg[off+10];
s = new String(msg, offset, length);
Pattern pat = Pattern.compile("[a-z,A-Z,0-9]+");
Matcher mat = pat.matcher(s);
String s1 = "";
while(mat.find())
{
System.out.println("Got name: "+mat.group());
s1 = s1+mat.group();
}
System.out.println("Got name: "+s1);
if(s.indexOf('.')!=-1)
{
System.out.println("dots!!!");
}
s.replaceAll("[.]","");
System.out.println("Got name again: "+s);
out.println(s);
out.println("Hello <span style=""
+ " height:10;filter:glow(Color=#009966,Strength=1)">");
out.println(s + "</SPAN>");
out.println("<br><br><b>"+s+"</b>");
}
%></BODY>
 
L

Lothar Kimmeringer

The below JSP (using Tomcat 6.0.24) to fetch Intranet Username has
always worked on Windows XP with IE.
Now that we upgraded to Windows 7 it no longer works. It now responds
with IE generic message Page not found. Tomcat logs doesnt show any
information or error messages.

Does a request show up in the request log? Is another non-JSP
page in the same directory showing up, i.e. is it JSP at
all causing problems or is there a configuration problem
with the effect that the server really doesn't find the page?


Regards, Lothar
--
Lothar Kimmeringer E-Mail: (e-mail address removed)
PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)

Always remember: The answer is forty-two, there can only be wrong
questions!
 
T

teser3

Does a request show up in the request log? Is another non-JSP
page in the same directory showing up, i.e. is it JSP at
all causing problems or is there a configuration problem
with the effect that the server really doesn't find the page?

Regards, Lothar
--
Lothar Kimmeringer                E-Mail: (e-mail address removed)
               PGP-encrypted mails preferred (Key-ID: 0x8BC3CD81)

Always remember: The answer is forty-two, there can only be wrong
                 questions!

I looked in all logs and dont see anything as if nothing ever gets
output when I go to this page.
Other JSP in the directory do show. Only this page with base64 encode
is having this issue. How I find or fix configuration issue without
any log file info?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top