aspose file tools*
The moose likes JSP and the fly likes Login Window in Html page Apache style Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Login Window in Html page Apache style" Watch "Login Window in Html page Apache style" New topic
Author

Login Window in Html page Apache style

George Joseph
Greenhorn

Joined: Nov 05, 2001
Posts: 24

Hello Java Ranchers,

How to generate A Login window of the format
------------------------------------------------------
Enter Network Password
Please type your user name and password
Site :
Realm :
User Name _________
Password _________
ok cancel
-----------------------------------------------------
I want a Login window like the above which seems to be seperated from the web page
What is the required JSP/ HTML code for this
In many new sites we see this type of Login window mostly apacehe sites
form
George Joseph
James Swan
Ranch Hand

Joined: Jun 26, 2001
Posts: 403
This is called Basic Authentication and depends on what HTTP server you are using for how to set it.
Some HTTP servers simply have the requirement of placing a special file (eg .htaccess) in a directory you want to protect. The file contains a list of valid users, and when the browser tries to access anything in that directory they are asked to authenticate.
You would really need to look up the Apache manual for how to set this.
Another approach from JSP/Servlets and to modify the HTTP headers sent back to the browser specifying that Basic Authentication is required.
But easiest is just let the HTTP server worry about it.
James.
James Swan
Ranch Hand

Joined: Jun 26, 2001
Posts: 403
Here is an example of a Servlet performing Basic Authentication:

James
[This message has been edited by james swan (edited November 06, 2001).]
George Joseph
Greenhorn

Joined: Nov 05, 2001
Posts: 24
Hi James,
Thanks for your prompt and valuable response
regards
George Joseph
Originally posted by james swan:
[B]Here is an example of a Servlet performing Basic Authentication:

James
[This message has been edited by james swan (edited November 06, 2001).][/B]

Pedro Garcia
Greenhorn

Joined: Sep 12, 2002
Posts: 15
I put the Servlet below but, when I make the call from a from, send me:
HTTP Status 405 - The specified HTTP method is not allowed for the requested resource
type Status report
description The specified HTTP method is not allowed for the requested resource

How can I test this Servlets


Pedro
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Login Window in Html page Apache style
 
Similar Threads
How to do logout in struts application
Accesing aplications from portlets without login
Login vs. register
Login on lan Network?
How specify the next page after form log on.