Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
|
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 23rd, 2005, 06:49 AM
Authorized User
 
Join Date: Jul 2003
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
Default Why HTTP validate can't work

I use JDK1.5 and Tomcat5.5.12, I have three files like follows:
-------index.jsp-----
<html>
<body>
<%
out.println("<H2>Authentication Mechanism "+ request.getAuthType() +" </H2>" );
%>
</body>
</html>

----------web.xml----------
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
<web-app>
<security-constraint>
<web-resource-collection>
<web-resource-name>Entire Application</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>ProJSP Authentication Example</realm-name>
</login-config>
</web-app>

-----tomcat-users.xml----------
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="superuser"/>
<user username="tomcat" password="tomcat" roles="tomcat"/>
<user username="both" password="tomcat" roles="tomcat,role1"/>
<user username="role1" password="tomcat" roles="role1"/>
<user username="projst" password="projsp" roles="superuser"/>
</tomcat-users>

When run index.jsp,it should pop a validate window,but when I run it,it don't pop a validate window and only shows a message:
Authentication Mechanism null

Why? How to do it?

Thanks in advance!






Similar Threads
Thread Thread Starter Forum Replies Last Post
typing abc.com opens http://abc.com and not http:/ nrlahoti ASP.NET 2.0 Professional 1 February 6th, 2008 01:43 PM
How to validate date jijish ASP.NET 2.0 Professional 4 December 20th, 2007 07:17 AM
http://mysite.com or http://www.mysite.com anshul HTML Code Clinic 1 December 27th, 2004 03:50 PM
http://domain or http://www.domain anshul HTML Code Clinic 9 August 11th, 2004 01:09 AM
HTTP Status 405 - HTTP method GET .... nsakic Servlets 1 January 25th, 2004 04:50 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.