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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:34:32+00:00 2026-06-14T14:34:32+00:00

Note I have ServletFilter which is used to check whether user already logged or

  • 0

Note

I have ServletFilter which is used to check whether user already logged or not by using <url-pattern>. If the user not logged, the redirect to login.xhtml.

My Problem

After the user logged, my program is always redirect the dashboard.xml(based on the navigation-rule). I would like redirect last visited page automatically. Could you provide the possible way for that?

Currently My Soluction is work for that

But, I am not happy to use it. Does Seam support? Could you provide the better way?

In my ServletFilter, I keep last visited page as below

AuthenticationFilter.java

httpSession.setAttribute(Constants.ORIGINAL_VIEW_KEY, requestPath);

In my LoginBean, to redirect the last visited page after the user logged.

LoginBean.java

ELContext elContext = facesContext.getELContext();
Application application = facesContext.getApplication();
ExpressionFactory eFactory = application.getExpressionFactory();
ValueExpression binding = eFactory.createValueExpression(elContext, "#{" + Constants.VISIT_KEY_SCOPE + Constants.VISIT_KEY + "}", Visit.class);
binding.setValue(elContext, visit);

ValueExpression originalViewBinding = eFactory.createValueExpression(elContext, "#{" + Constants.ORIGINAL_VIEW_SCOPE + Constants.ORIGINAL_VIEW_KEY + "}", String.class);

String originalViewId = (String) originalViewBinding.getValue(elContext); <--- last visited view id.

UIViewRoot viewRoot = application.getViewHandler().createView(facesContext, originalViewId) ;
facesContext.setViewRoot(viewRoot);
facesContext.renderResponse();
  • 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-14T14:34:33+00:00Added an answer on June 14, 2026 at 2:34 pm

    If Identity and Credentials is used, the page redirected last visited page(to access the page, the use need to login) automatically after the logged. We have to need configure in component.xml as below.

    component.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <components ----->
       <event type="org.jboss.seam.security.loginSuccessful">
          <action execute="#{redirect.returnToCapturedView}"/>
       </event>
    </components>   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Note - I do not have access to a database and cannot use PHP,
(Note: I have seen this question and it uses a cursor not an animation.)
Note : I have tried using unserialize function but it say that first argument
Note: I have very little python and PyQt experience... Given a context menu already
(note: I have labelled this C# but I am using Monotouch, so it might
Note: I have used lightbox and its many alternatives in an attempt to fix
NOTE: I have now created a jQuery plugin which is my attempt of a
I am doing a application which have a sharing note option to Ever-Note,i have
Note - I have not delved very deeply into Apple's iPhone SDK yet. However,
Note: I have read https://meta.stackexchange.com/questions/128548/what-stack-overflow-is-not/129362#129362 It says try to write the code yourself and

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.