Jakarta REQUEST Taglib Example


<%@ taglib uri="http://jakarta.apache.org/taglibs/request-1.0" prefix="req" %>

Cookies received with request:


   Cookie name: 
       Comment: 
        Domain: 
        MaxAge: 
          Path: 
        Secure: 
         Value: 
       Version: 


See if JSESSIONID Cookie exists

   JSESSIONID=


   Cookie JSESSIONID does not exist.


HTTP Headers received with request:


    = 


See if User-Agent Header exists

   User-Agent=


   Header User-Agent does not exist.


GET or POST Parameters received with request:


    = 


GET or POST Parameters received with request for test3:

 
    = 
 


See if test1 parameter exists

   test1=


   Parameter test1 does not exist.


See if parameter test4 equals "aabb"
 
  test4= 
 
 
  Parameter test4 does not equal "aabb".
 
See if test4 equals "aabb", ignoring case
 
  test4= 
 
 
  Parameter test4 does not equal "aabb", ignoring case.


Set an attribute named "myatt"
AAbb
See if myatt attribute exists

   myatt=


   Attribute myatt does not exist.

Set an attribute named "myatt2" to the Header User-agent


See if myatt equals "aabb"

  myatt=


  Attribute myatt does not equal "aabb".

See if myatt equals "aabb", ignoring case

  myatt=


  Attribute myatt does not equal "aabb", ignoring case.


Now loop through all the attributes

    = 

Now remove the attribute myatt

See if myatt attribute exists

   myatt=


   Attribute myatt does not exist.              



Request Information:

AuthType: 
ContextPath: 
Method: 
PathInfo: 
PathTranslated: 
QueryString: 
RemoteUser: 
RequestedSessionId: 
RequestURI: 
RequestURL: 
ServletPath: 
CharacterEncoding: 
ContentLength: 
ContentType: 
Protocol: 
RemoteAddr: 
RemoteHost: 
Scheme: 
ServerName: 
ServerPort: 


IsSecure? Session is using HTTPS. Session is not using HTTPS.

IsSessionFromCookie? Session is using a cookie. Session is not using a cookie.

IsSessionFromURL? Session is using a URL. Session is not using a URL.

IsSessionValid? Session is valid. Session is not valid.

IsUserInRole "admin"? User is in role admin. User is not in role admin.

Log a message to the servlet context log. Test of logging to your servlet context log by the request taglib.