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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:01:09+00:00 2026-06-08T04:01:09+00:00

I have used tiles in Spring web flow.This is my standard jsf file. standard.xhtml

  • 0

I have used tiles in Spring web flow.This is my standard jsf file.

standard.xhtml

      <f:view contentType="text/html">

   <h:head >
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Nagra Employee Leave Application</title>
<link rel="stylesheet" href="${request.contextPath}/styles/blueprint/screen.css" type="text/css" media="screen, projection" />
<link rel="stylesheet" href="${request.contextPath}/styles/blueprint/print.css" type="text/css" media="print" />

<link rel="stylesheet" href="${request.contextPath}/styles/le-frog/jquery-ui-1.8.2.custom.css" type="text/css" media="screen" />
<ui:insert name="headIncludes"/>
<style>

</style>
  </h:head>
   <h:body  style="background:#343433" >
   <div class="container" style="background:white;">


    <a href="#{request.contextPath}"><img src="${request.contextPath}/images/rubon1.jpg" height="200" width="950" alt="Spring Travel"/></a>


<div>
    <div id="local" class="span-4 colborder" style="padding-top: 20px;
    padding-left: 21px;">
        <h3>Nagra Vision</h3>
        <ui:insert name="notes"/>
    </div>
    <div class="span-19 last" style="width: 720px;">
        <ui:insert name="content"/>
    </div>
</div>

<div>
    <a href="http://www.nagra.com">
        <img src="${request.contextPath}/images/nagra_footer.png" alt="Powered by Nagra-India" />
    </a>
</div>
 </div>
 </h:body>

Login.xhtml

 <ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
template="/WEB-INF/layouts/standard.xhtml">

<ui:define name="content">
    <h:form style="margin-top:10px;">
        <div>
            <h:outputLabel for="username">Username:    </h:outputLabel>
            <h:inputText id="username" value="#{userInfo.username}">          </h:inputText>
        </div>
        <div>
            <h:outputLabel for="password">Password:    </h:outputLabel>
            <h:inputSecret id="password" value="#{userInfo.password}">
            </h:inputSecret>
        </div>
        <div>

            <h:selectBooleanCheckbox id="leavetype"
                value="#{userInfo.loginperson}">
                <f:selectItems value="#{referenceData.loginPersonOptions}" />
            </h:selectBooleanCheckbox>
            <h:outputLabel for="password">Select you are a manager</h:outputLabel>
        </div>

        <div>
            <p:commandButton id="Signin" action="click" value="Sign In"
                style="margin-left:80px;" />
        </div>
    </h:form>
</ui:define>

mainpage.xhtml

 <ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui"
template="/WEB-INF/layouts/standard.xhtml">
<ui:define name="notes">
    <h:outputLabel for="employee">${loginperson.username}</h:outputLabel>
    <h:form>
    <div>   <h:commandLink value="Sick Leave" action="sickleave" id="sickleave" /></div>
    <div>   <h:commandLink value="Paid off Leave" action="paidleave" id="paidleave" /></div>
    <div>   <h:commandLink value="Logout" action="logout" id="logout" /></div>
    </h:form>



</ui:define>
<ui:define name="content">
     <h2 style="font-size: 16px; font-weight: bold; margin-top: 100px;">Available
        Leave</h2>




    <h:dataTable value="#{leaveavailable}" var="a"
        styleClass="order-table" headerClass="order-table-header"
        rowClasses="order-table-odd-row,order-table-even-row"
        columnClasses="order-table-odd-column,order-table-even-column">
        <h:column>
            <f:facet name="header">
                Sick Leave
            </f:facet>
                #{a.totalSickLeave}
        </h:column>
        <h:column>
            <f:facet name="header">
                Paidoff Leave
            </f:facet>
                #{a.totalPaidoffLeave}
        </h:column>
    </h:dataTable>



</ui:define>

here once the user login in the user will see the mainpage.xhtml.After the user getting into the mainpage,if he press the back button of the browser it takes me to the login page.So I need to disable the back button.I do no where to add the javascript code to disable the browser back button.Whether I have to add in mainpage.xhtml or in standard.xhtml.

What java script i have to add to disable the back button

  • 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-08T04:01:10+00:00Added an answer on June 8, 2026 at 4:01 am

    You can’t disable the back button. You can, however, remove the current document from the browser history and replace it with your desired document by using window.location.replace. Keep in mind that you need to use AJAX in this case, since replace has to be called from the document you want to replace.

    Instead of meddling with JavaScript and trying to mangle the user’s browser, why don’t you check on the server side whether the user is already logged in and redirect him to your main page?

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

Sidebar

Related Questions

I have used some jquery components in my web site, Suddenly i'm getting an
I have used this website for testing http://www.webpagetest.org and among some suggestions for optimization
I have used this code (kind of tutorial) at http://code.google.com/p/gwt-examples/wiki/gwt_hmtl5 ... In this code,
Background I have a Spring batch program that reads a file (example file I
All, I am trying to add Spring Security(3.0.7) to my web application(Spring 3.0.6, Tiles
Ok, consider this common idiom that most of us have used many times (I
I have used this type of convention many times in my code in the
I have a Web Service that I used it to Authenticate Users: public bool
So I have this web application I am making, as of now there is
I have a upload excel file on my web application. When the file is

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.