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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:15:28+00:00 2026-05-15T21:15:28+00:00

I am using JSF 1.2 + Facelets + Apache My Faces without Tomahawk or

  • 0

I am using JSF 1.2 + Facelets + Apache My Faces without Tomahawk or other libs. I use a customized container. I have a scenario to implement but I am not sure How to achieve the same using JSF + Facelets. These are my questions : Appreciate any help you can provide. Thanks!

Scenario : I have only one page + one backing bean , By default , the request is sent to that only one page and so everything is okay. Based on some data in the backing bean once the request has come, I determine whether the user should be allowed to see the page or not. If he should not, I should send the user to other page or an error page.

1) Is it mandatory to use a template in Facelets?
2) How to achieve if and else conditionals using Facelets ? Is it possible?
3) Is this correct ?- The Backing Bean constructor always returns to the page for which the request has come – This one is little confusing as Constructors cannot return a “String”
4) How do i send the user to a different page or where to place to code to send him to a diff page ?

  • 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-05-15T21:15:29+00:00Added an answer on May 15, 2026 at 9:15 pm

    This should not be done in the view side, but in the controller side. The normal practice is to use a Filter for this. Create a class which implements Filter and does basically the following (pseudo) in doFilter() method:

    if (request meets conditions) {
        chain.doFilter(request, response);
    } else {
        response.sendRedirect(errorPageURL);
        // or response.sendError(statusCode, message);
    }
    

    You can alternatively also handle the redirect in the bean’s constructor with help of ExternalContext, but that’s not really the right place for this.

    public Bean() {
        if (request does not meet conditions) {
            FacesContext.getCurrentInstance().getExternalContext().redirect(errorPageURL);
            // Or externalContext.responseSendError(statusCode, message);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 514k
  • Answers 514k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I do not know of any in built in feature… May 16, 2026 at 6:19 pm
  • Editorial Team
    Editorial Team added an answer See jTDS FAQ http://jtds.sourceforge.net/faq.html you will have to pass useNTLMv2=true… May 16, 2026 at 6:19 pm
  • Editorial Team
    Editorial Team added an answer The reason you're seeing this seemingly "strange" behaviour is that… May 16, 2026 at 6:19 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I am trying to implement a scenario using JSF. I have a commandExButton and
Goal: I want to use jsf`s i18n Scenario: creating resource bundle (utf-8) file info:
I'm using JSF/Facelets, and I'm trying to iterate over some Document objects (custom object)
I'm using JSF 2.0 with Facelets in a Java EE 6 application server (GlassFish
I am currently working on a JAVA web application using JSF, Facelets, JSTL and
I am using JSF 2.0 btw I have an attribute X type Integer, that
Explanation: I have a JSF command link that sets a member in the backing
I have been investigating a JSF upgrade on our existing web apps that are
I've got a JSF app built with MyFaces 1.2.8, Facelets 1.1.14 and building it
In JSF application we are using richfaces (Final.3.3.3). In pom.xml there is dependency 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.