Results 1 to 3 of 3
  1. #1
    jeremy.wilson is offline Member
    Join Date
    Jul 2009
    Location
    Seattle, WA
    Posts
    23
    Rep Power
    0

    Default Using JSTL to capture HTTP referer data and serialize into a variable

    Using JSTL, how I can both capture the 'referer' data, strip it down to just wwwdotsomedomaindotcom, and then declare it as a variable for later equality/inequality comparisons?

    And I had to write out the dummy domain name above because this message board still prevents me from posing URLs or images until I hit 20 posts.

    Thanks in advance.

  2. #2
    jeremy.wilson is offline Member
    Join Date
    Jul 2009
    Location
    Seattle, WA
    Posts
    23
    Rep Power
    0

    Default

    I attempted to pull in the referer data, using a scriptlet, as follows:


    <% //get parameters from the URL
    String referer = request.getHeader("referer");
    if (referer == null) {
    referer = "";
    }
    %>

    I then converted (serialized?) it into a JSTL variable declaration:

    <c:set var="referer"><%=request.getHeader("referer")%></c:set>

    My question still remains, before moving to set the referer information into the JSTL variable, how do I strip the initial referer variable information (from the scriplet string declaration) down to just the actual domain information?

    If anyone could help me bridge this gap I would really appreciate it.

  3. #3
    bharati.dontu is offline Member
    Join Date
    May 2011
    Posts
    1
    Rep Power
    0

    Default

    You can use ${header.referer} to get <%=request.getHeader("referer")%> value in JSTL....

Similar Threads

  1. Oracle & JSTL - Data not being retrieved correctly?
    By kev_thomas in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 10-09-2009, 12:08 PM
  2. how to capture jsf form data
    By Srikala in forum JavaServer Faces (JSF)
    Replies: 2
    Last Post: 07-16-2009, 10:06 AM
  3. Help require to capture streaming data
    By jobseeker in forum Java Servlet
    Replies: 1
    Last Post: 04-02-2009, 10:18 PM
  4. Setting a variable in JSTL for use in a JSP function
    By MikeStringfellow in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 03-19-2009, 05:48 PM
  5. Problem is getting the data to browser(JSTL)
    By freddieMaize in forum JavaServer Pages (JSP) and JSTL
    Replies: 6
    Last Post: 07-15-2008, 04:04 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •