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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:36:25+00:00 2026-05-26T07:36:25+00:00

I am developing a mobile webapp using JSF and Apache myFaces 1.2.9. During authentication

  • 0

I am developing a mobile webapp using JSF and Apache myFaces 1.2.9.

During authentication i am calling a servlet which will do the authentication and then set some attribute in the session.

And in every managed bean constructor i am checking for this session attribute and accordingly i am setting a boolean value.That boolean value i am setting as a value for rendered attribute of tr:document.Something like this

<tr:document title="someid" rendered="#{controller.render}">
//SOME PAGE CONTENTS
</tr:document>

Based on the session attribute,the page may render or not.I want to handle this issue more gracefully.

I came through this question in SO which tells the usage of filters.I used the filter as shown here.

I changed the webFilter urlPattern to /faces/jsp/* as i want to check the session attribute for each jsp.

In doFilter() method i am checking for session attribute like this
and if it is null i am redirecting to invalid user page.

System.out.println("In doFilter");
            HttpServletRequest request = (HttpServletRequest) req;
            HttpServletResponse response = (HttpServletResponse) res;
            HttpSession session = request.getSession(false);

            if (session.getAttribute("myattribute") == null) {
       response.sendRedirect(properties.getProperty(INVALID_USER_REDIRECTURL, true));  // No attribute found, so redirect to Invalid user page.
            } else {
                chain.doFilter(req, res); // attribute found, so just continue request.
            }

But i don’t see my filter getting fired as i don’t see any debug statements which i kept in my filter init(),doFilter() methods.

Any help?

EDIT:I just came through this filter mapping in my web.xml

<filter>
    <filter-name>trinidad</filter-name>
    <filter-class>org.apache.myfaces.trinidad.webapp.TrinidadFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>trinidad</filter-name>
    <servlet-name>faces</servlet-name>
  </filter-mapping>

I suppose myfaces has some filter.Can i have another one of mine?

  • 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-26T07:36:26+00:00Added an answer on May 26, 2026 at 7:36 am

    Map the filter to URL pattern where your FacesServlet is mapped.

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

Sidebar

Related Questions

I'm developing mobile application which will be able to download/upload mobile phone book contact
I'm developing a mobile site using IUI . It's a framework that makes web
I am developing a mobile game in j2me and i am using mobile nokia
I am developing windows mobile application. I am using the SQLlite database. I am
Is there any example on using Lungo.JS? I'm trying to start developing a WebApp
I am developing mobile application in C#. I am using the following code in
I am currently developing a mobile application using the latest version of Flash Builder
I am developing a mobile site, so I'm using CSS to make things as
I'm developing a mobile site using Zend framework, and the site has two possible
I am developing mobile application in C#. I am using the keyboard launch functionality

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.