Authorization taglib ver. 1.5

    JSP taglib. Lets you deal with the basic authorization. You may check out authorization settings, force popup dialog for getting user name/password and read these values in your JSP code.

For example:

1. Check out authorization settings and ask for user name/password.
 


<%@ taglib uri="taglib.tld" prefix="auth" %>
<html>

<auth:ifNotAuthorized >
   <!-- force popup -->
   <auth:setAuth realm="Development" />
</auth:ifNotAuthorized>
...
</html>

2. Read user name/password
 


<%@ taglib uri="taglib.tld" prefix="auth" %>
<html>

<auth:getAuth id="A" />
<br>User name: <%=A.getPassword()%>
<br>Password: <%=A.getUserName()%>
...
</html>

Tags are:

ifNotAuthorized

Body tag. Executes own body in case of the client is not authorized

ifAuthorized

Body tag. Executes own body in case of the client is authorized

setAuth

Calls popup dialog for user name/password. Parameters are:

1) realm security realm
2) cond Optional attribute. Describes a boolean value tag's behavior depends on. Default value is true (force dialog).

getAuth

Gets user name/password. Parameters are:

1) id Page scope variable (type is com.cj.auth.UserBean) for extracted settings. Properties are password and userName.

for downloading:

Library: authtag.jar    Description: taglib.tld

 © Coldbeans      Comments?

See also Coldtags suite - the largest collection of custom JSP tags.

Also in Coldtags: