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 8651295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:01:48+00:00 2026-06-12T14:01:48+00:00

I have a JSF 1.2 based Servlet. Am doing session invalidation if a user

  • 0

I have a JSF 1.2 based Servlet. Am doing session invalidation if a user stays idle for some time. I have to show a Jquery dialog box to user 1 minute before session invalidation happens and ask if the user wants to continue or logout.

I have the code for Jquery dialog box in a xhtml page (session.xhtml). I have nearly 15-20 pages in my web application. A user can remain idle in any of those 15-20 pages. So, I need to include session.xhtml page in all of my xhtml pages. Am doing this by using below piece of code in all of my pages.

<ui:insert>
<ui:include src="/session.xhtml" />
</ui:insert>

I have 2 problems here.

a) As the number of page grows in my web application, I need to keep on adding above code to each page

b) Code maintainability : Down the line, if some one else has to develop some pages in my web application, he may not remember to include the above code

So, the question is, is there any way in which I can put this page (say some where in web.xml or some xml files) by which by default this session.xhtml will be available to all pages in my web application?

  • 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-12T14:01:49+00:00Added an answer on June 12, 2026 at 2:01 pm

    The view file may have a template (which is a good practice):

    <ui:composition xmlns="http://www.w3.org/1999/xhtml"
                    xmlns:ui="http://java.sun.com/jsf/facelets"
                    xmlns:a="http://richfaces.org/a4j"
                    ...
                    template="../layout/maintemplate.xhtml">
    

    you may put common logic into maintemplate.xhtml.
    hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small JSF application where the user is required to enter some
I have a War and Jar project in my Eclipse-based JSF project. I have
In my JSF 2 based application I have a form that includes (amongst other
How to improve performance of jsf myfaces based application ? Some tips that I
I have the following scenario in my project based on JSF and RF3.3 1.Each
I have a J2EE/JSF-based web-app. It consists of an form-input, a text display and
I have implemented a JSF validator based on this example . How can I
We have a web based java/JSF/Spring application for which we want to create sitempas.xml
I have heard that JSF is implementing the component based MVC and Spring MVC
I have configured a form based log in in my JSF 2.0 Application on

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.