Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8674311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T19:40:45+00:00 2026-06-12T19:40:45+00:00

I am using JSF2 with Prime faces. I will want to show all the

  • 0

I am using JSF2 with Prime faces. I will want to show all the previous links or Urls clicked by user in every page.How can i do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T19:40:47+00:00Added an answer on June 12, 2026 at 7:40 pm

    Hi I have created this Singleton class to put the Url Browsed by a User.

    import java.util.HashMap;
    import java.util.LinkedList;
    import java.util.List;
    import java.util.Map;
    
    public class UrlHistory {
    
        @SuppressWarnings("rawtypes")
        private static Map<String, List> store = new HashMap<String, List>();
    
        private static UrlHistoryBean instance = null;
    
    
        public static UrlHistoryBean getInstance() {
            if (instance == null) {
                instance = new UrlHistoryBean();
            }
            return instance;
        }
    
        LinkedList<UrlData> urlList = new LinkedList<UrlHistoryBean.UrlData>();
    
        public void addUrl(String sessionId, String urlString, int urlId) {
            UrlData data = new UrlData();
            data.setUrlName(urlString);
            data.setUrlId(companyId);
            if (urlList.isEmpty()) {
                urlList.add(data);
            } else {
                boolean isEqual = false;
                for (UrlData urlDataObj : urlList) {
                    if (urlDataObj.equals(data))
                        isEqual = true;
                }
                if(!isEqual)
    
                    urlList.addFirst(data);
            }
            store.put(sessionId, urlList);
    
        }
    
        @SuppressWarnings("rawtypes")
        public static Map<String, List> getStore() {
            return store;
        }
    
        @SuppressWarnings("rawtypes")
        public static void setStore(Map<String, List> store) {
            UrlHistoryBean.store = store;
        }
    
        public class UrlData {
    
            String urlName;
            int urlId;
    
            public String getUrlName() {
                return UrlName;
            }
    
            public void setUrlName(String UrlName) {
                this.UrlName = UrlName;
            }
    
            public int getUrlId() {
                return urlId;
            }
    
            public void setUrlId(int urlId) {
                this.urlId = urlId;
            }
    
            public boolean equals(UrlData rData) {
                boolean bEqual = false;
                if (this.getUrlId() > 0 && rData.getUrlId() > 0 && this.getUrlId() == rData.getUrlId()) {
                    bEqual = true;
                }
                return bEqual;
            }
    
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using jsf2.0 with primefaces.My application was working fine with all browsers includes
Using jsf2 (see maven dependencies ) <dependency> <groupId>com.sun.faces</groupId> <artifactId>jsf-impl</artifactId> <version>2.1.10</version> </dependency> <dependency> <groupId>com.sun.faces</groupId> <artifactId>jsf-api</artifactId>
i want to use jQuery to sync values of JSF2 components. We are using
I'm using JBoss 7.1 with JSF 2.1/Prime Faces and keep running into the error
I work with JSF2 and PrimeFaces and I want to go to another page
Hope you all will be fine. Actually i want to upload image files from
I am using Primefaces and JSF2 . All my .xhtml files are dumped in
I am using JSF2.0/primefaces I want to create a validator, the validator should validate
I want to make a form using Primefaces Mobile with jsf2.0 and primefaces-3.0.M2, but
I am using JSF2 with Pure JPA2. But the problem is with entityManager, @PersistenceContext

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.