Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Login Window in Html page Apache style

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 403
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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]


 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Wink, wink, nudge, nudge, say no more, it's a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic