SUN TEAM & ANYONE!! SecurityFilter Problem

Hi all
i have used and implemented the security filters discussed in
http://forum.java.sun.com/thread.jspa?threadID=5050520
It seems to work fine. If i try to access a page without having logged in first, i get redirected to the login page.
but something very wierd is happening. after logging in, i am 100% sure that the user attribute in session bean is set, since i have a text field that displays it. but if i change anything on the page (drop down selection, dates, etc) or interact with it (bascially any request), the user is redirected to login page.
i dont reset the username in session at any point, so it cant be that the user isnt logged in anymore. and also there was no time out, so that cant be the problem either.
is it a problem with the security filter class? i cant understand what's going on.
the code for the doFilter(...) method is posted below:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        HttpServletRequest hreq = (HttpServletRequest)request;
        HttpServletResponse hres = (HttpServletResponse)response;
        HttpSession session = hreq.getSession();
        String url = hreq.getPathTranslated();
        boolean notLoginPage = url.endsWith("LiveLogin.jsp") == false;
        boolean isJsp = url.endsWith(".jsp");
        /** Dont filter login.jsp because otherwise an endless loop.
         * & only filter .jsp otherwise it will filter all images etc as well.
        if (notLoginPage && isJsp) {
            /* There is no User attribute so redirect to login page */
            if(session.getAttribute("ATTR_USER") == null) {
                System.out.println("Session expired, redirecting to login page");
                hres.sendRedirect("/SPNLiveBeta3/faces/LiveLogin.jsp");
                return;
        /* deliver request to next filter */
        chain.doFilter(request, response);
}could anypne please help me find the problem? this is that last step in the development of my application, which should be delivered for testing very soon
MUCH APPRECIATED!!.

There is nothing wrong with Extending a CustomAbstractpageBean , and it should work. I had this code in a hurry and it might need some work and the only purpose of this code is to demonstrate the idea.
* CustomAbstractpageBean.java
* Created on February 28, 2007, 9:13 AM
* To change this template, choose Tools | Options and locate the template under
* the Source Creation and Management node. Right-click the template and choose
* Open. You can then make changes to the template in the Source Editor.
package estimate;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import javax.servlet.RequestDispatcher;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
* CustomAbstractpageBean.java
* Created on February 28, 2007, 9:08 AM
* To change this template, choose Tools | Options and locate the template under
* the Source Creation and Management node. Right-click the template and choose
* Open. You can then make changes to the template in the Source Editor.
* @author wzahra
public abstract class CustomAbstractpageBean extends AbstractPageBean{
    /** Creates a new instance of CustomAbstractpageBean */
    public CustomAbstractpageBean() {
     public void init() {
        // Perform initializations inherited from our superclass
        super.init();
        // Perform application initialization that must complete
        // *before* managed components are initialized
        // TODO - add your own initialiation code here
        // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Initialization">
        // Initialize automatically managed components
        // *Note* - this logic should NOT be modified
        // </editor-fold>
        // Perform application initialization that must complete
        // *after* managed components are initialized
        // TODO - add your own initialization code here
int i=0;
     * <p>Callback method that is called after the component tree has been
     * restored, but before any event processing takes place.  This method
     * will <strong>only</strong> be called on a postback request that
     * is processing a form submit.  Customize this method to allocate
     * resources that will be required in your event handlers.</p>
     protected RequestBean1 getRequestBean1() {
        return (RequestBean1)getBean("RequestBean1");
     * <p>Return a reference to the scoped data bean.</p>
    protected ApplicationBean1 getApplicationBean1() {
        return (ApplicationBean1)getBean("ApplicationBean1");
     * <p>Return a reference to the scoped data bean.</p>
    protected SessionBean1 getSessionBean1() {
        return (SessionBean1)getBean("SessionBean1");
     * <p>Callback method that is called just before rendering takes place.
     * This method will <strong>only</strong> be called for the page that
     * will actually be rendered (and not, for example, on a page that
     * handled a postback and then navigated to a different page).  Customize
     * this method to allocate resources that will be required for rendering
     * this page.</p>
    public void prerender() {
        /**Code for Authentication and session Timeout can be placed here..........*/
       String userId= this.getSessionBean1().getUserId();
       String activeSession=this.getSessionBean1().getActiveSession();
        if(userId==null|| activeSession==null) {
            HttpServletRequest req=(HttpServletRequest)this.getFacesContext().getExternalContext().getRequest();
            HttpServletResponse res=(HttpServletResponse)this.getFacesContext().getExternalContext().getResponse();
            RequestDispatcher dispatcher=req.getRequestDispatcher("/faces/Login.jsp");
            try{
                dispatcher.forward(req, res);
            } catch(Exception e) {
                error("Can not forword to Login page");
     * <p>Callback method that is called after rendering is completed for
     * this request, if <code>init()</code> was called (regardless of whether
     * or not this was the page that was actually rendered).  Customize this
     * method to release resources acquired in the <code>init()</code>,
     * <code>preprocess()</code>, or <code>prerender()</code> methods (or
     * acquired during execution of an event handler).</p>
}and in your pageBean.....some attension to the extends cluase and prerender() method.
public class Page1 extends CustomAbstractpageBean{
    // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Definition">
    private int __placeholder;
     * <p>Automatically managed component initialization.  <strong>WARNING:</strong>
     * This method is automatically generated, so any user-specified code inserted
     * here is subject to being replaced.</p>
    private void _init() throws Exception {
    private Page page1 = new Page();
    public Page getPage1() {
        return page1;
    public void setPage1(Page p) {
        this.page1 = p;
     * <p>Construct a new Page bean instance.</p>
    public Page1() {
     * <p>Return a reference to the scoped data bean.</p>
    protected RequestBean1 getRequestBean1() {
        return (RequestBean1)getBean("RequestBean1");
     * <p>Return a reference to the scoped data bean.</p>
    protected ApplicationBean1 getApplicationBean1() {
        return (ApplicationBean1)getBean("ApplicationBean1");
     * <p>Return a reference to the scoped data bean.</p>
    protected SessionBean1 getSessionBean1() {
        return (SessionBean1)getBean("SessionBean1");
     * <p>Callback method that is called whenever a page is navigated to,
     * either directly via a URL, or indirectly via page navigation.
     * Customize this method to acquire resources that will be needed
     * for event handlers and lifecycle methods, whether or not this
     * page is performing post back processing.</p>
     * <p>Note that, if the current request is a postback, the property
     * values of the components do <strong>not</strong> represent any
     * values submitted with this request.  Instead, they represent the
     * property values that were saved for this view when it was rendered.</p>
    public void init() {
        // Perform initializations inherited from our superclass
        super.init();
        // Perform application initialization that must complete
        // *before* managed components are initialized
        // TODO - add your own initialiation code here
        // <editor-fold defaultstate="collapsed" desc="Creator-managed Component Initialization">
        // Initialize automatically managed components
        // *Note* - this logic should NOT be modified
        try {
            _init();
        } catch (Exception e) {
            log("Page1 Initialization Failure", e);
            throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
        // </editor-fold>
        // Perform application initialization that must complete
        // *after* managed components are initialized
        // TODO - add your own initialization code here
        int i=0;
     * <p>Callback method that is called after the component tree has been
     * restored, but before any event processing takes place.  This method
     * will <strong>only</strong> be called on a postback request that
     * is processing a form submit.  Customize this method to allocate
     * resources that will be required in your event handlers.</p>
    public void preprocess() {
     * <p>Callback method that is called just before rendering takes place.
     * This method will <strong>only</strong> be called for the page that
     * will actually be rendered (and not, for example, on a page that
     * handled a postback and then navigated to a different page).  Customize
     * this method to allocate resources that will be required for rendering
     * this page.</p>
    public void prerender() {
        super.prerender();
         int i=0;
     * <p>Callback method that is called after rendering is completed for
     * this request, if <code>init()</code> was called (regardless of whether
     * or not this was the page that was actually rendered).  Customize this
     * method to release resources acquired in the <code>init()</code>,
     * <code>preprocess()</code>, or <code>prerender()</code> methods (or
     * acquired during execution of an event handler).</p>
    public void destroy() {
    public String button1_action() {
        // TODO: Process the button click action. Return value is a navigation
        // case name where null will return to the same page.
         int i=0;
        return "case1";
    }

Similar Messages

  • SUN TEAM: PLEASE GIVE US A DECENT APP SERVER!

    Sun Team,
    I am still persevering with JSC2 due to functionality. However my patience is really wearing thin with the app server. How many times in a sesion do I have kill it !! at least twice and hour. I have a top end PC and still it doesn't play ball.
    Any chance of giving us tomcat or something that works?
    I use both Eclipse and JSC2, and Eclipse(with another app server) has never given me a problem.
    I am very, very frustrated with JSC2.
    Regards,
    LOTI

    All I want is the ability to do at least one hours piece of work without having to kill the appserver and Creator. I don't think it is asking too much.
    Coming from a background over the last 10 years of using GUI RAD tools, I expected too much from JSC when it was launched. Although SUN did hype it as the best thing since sliced bread!! Time has shown a different story.
    It was very niave of me to think JSC could achieve the same of ease of use when putting together a web app. I have championed this product up until now and other of my "low level hmtl" colleagues have expressed an interest. They would laugh if they started using JSC. It is simply not commerical or professional standard as compared to Eclipse, etc.
    Until the pefromance issues of JSC are sorted out, I will remain unconvinced about the products viability in the "real life" world.
    And before anybody gets on a rant, I am trying to write a fairly sized commercial project of which I am getting well paid. Hence the frustration. This is not some novice putting together a hello world.
    Regards,
    LOTI

  • Is anyone having problems with the battery heating up and draining the power?  Mine has been doing this for about 2 months now.

    Is anyone having problems with the battery heating up and draining the power?  Mine has been doing this for about 2 months now.

    This is a major problem with Lollipop, but yo said it started 2 months ago.   Several people have fixed problem by removing FaceBook And Face book messenger and then re loading the apps again.   You might want to clear your cache before reloading.  Not sure this is your problem, but worth a try.  Good Luck

  • Has anyone experienced problems with Mackeeper? I did not complete downloading this software. Yet, occasionally when on the internet, I will have the MacKeeper multi-colored circle replace my pointer. How do you deal with this?

    Has anyone experienced problems with Mackeeper? I did not complete downloading this software. Yet, occasionally when on the internet, I will have the MacKeeper multi-colored circle replace my pointer. How do you deal with this?

    Welcome to Apple Support Communities
    Don't download MacKeeper. Users complain about this app and it damages OS X. Also, Mac OS X knows how to take care of itself, so you don't need any other cleaning application that may damage OS X. See > https://discussions.apple.com/docs/DOC-3691

  • Anyone having problem with iphone getting not delivered message after sending picture and it really is getting delivered to recipient.

    Anyone having problem with iphone getting a not delivered message after sending pic and it really is getting delivered to recipient.

    Same problem here with and I've done everything shy of a total reset which I also find unacceptable. This problem exists on all iMessage platforms (iPhone, iPad, and Mac) so I don't see how restoring my iPhone would help the problem.

  • Anyone having problems with Elements organiser 13 when try to import photos from Mac photos which was an upgrade from Iphotos on 9th April 2015. Before when I was using Iphotos all was ok...

    Anyone having problems with Elements organiser 13 when try to import photos from Mac photos which was an upgrade from Iphotos on 9th April 2015. Before when I was using Iphotos all was ok...

    hi I have been trying to do this, but PE13 comes up with a fail message saying that file types are not supported, am only trying to import jpeg files so can't understand this.  So far have been unable to use PE13 at all, any ideas anyone please!

  • Hi Anyone had problems with losing Dropbox favourites on their IPad?

    Hi
    Anyone had problems losing Dropbox favourites on their iPad?
    I have about 400 songs (words and chords) as Word documents on Dropbox marked as Favorites on my iPad (saves carrying around sheets of paper in a binder) but for some reason the documents lose their 'favourites' tag and so cannot be accessed unless I have a Wi-Fi connection.  I have 're-favoritized' them twice already which is very time consuming.  I am thinking of giving up and buying a tablet.
    Any ideas? 

    Hi Dave
    Just looked at the string and I am guessing you didn't get it!  Basically I was saying I was pleased you got a positive response from Dropbox.  Very easy for Dropbox; very easy for Apple and Dropbox to blame each other which is not helpful to their customers.
    You can of course use your songs via Dropbox providing you have access to Wi-fi at the gig but this is a bit risky if you are their to do a gig.  By the way do you have the iPad holder that clips onto your mic stand?  Saves taking a music stand and gives you a bit more room in the space a coffee bar or restaurant usually gives you.
    Keep in touch and let me know if you make any progress.  I will do the same.  [email protected]
    Cheers
    Ian

  • Has anyone had problems connecting iPad mini to Jawbone speakers via Bluetooth?

    Has anyone had problems connecting iPad mini to a Jawbone speaker system via Bluetooth?

    What versions BT are involved? Is AVD2P suppoted on both?

  • TS3276 Anyone experiencing problems sending mail using TalkTalk - can receive but not send  - was ok up until pm 24/08/12 - have recently loaded Mountain Lion patch could this be the problem?

    Anyone experiencing problems sending mail using Apple Mail viaTalkTalk - can receive but not send  - was ok up until pm 24/08/12 - have recently loaded Mountain Lion patch could this be the problem?

    jag157 wrote:
    "I managed to solve the problem. Under smtp settings (mail preferences/accounts/edit smtp) I set the outgoing port to 25 (as recommended by Talktalk), no authentication (set to none) and unchecked SSL. I found that until I set the port to 25 and authentication to none I was unable to uncheck SSL. One I had done this I was able to send from my main email and other email adddresses set up under my account."
    Superb advice R&W!  My email sending block using TalkTalk started 2 months ago using Snow Leopard, continued when I upgraded to 10.8.2, and has been persistent on my wife's new iPad (IOS 6.1).  Implementing your wise words has fixed all that, and now enables me to call her on FaceTime — previously only she could call me.  Thank you so much; this will save hours of further fruitless searching and phoning.
    Please remember that your email is now insecure, if you wish to have a secure connection SSL must be on and port 25 should be avoided.

  • Has anyone had problems with upgrading iPhoto. I am, it's stops at 5 0f 9 and will not finish!! Can someone please help me out?

    Has anyone had problems with upgrading iPhoto? I am, it stops at 5 of 9 and just stays there and won't finsih. Can someone please help me out?

    iphoto upgrading: Apple Support Communities
    iphoto upgrade hangs: Apple Support Communities

  • Has anyone had problems with the latest driver update for the Lexmark printers? My Lexmark printers won't work with the latest driver update.

    Has anyone had problems with the latest Lexmark printer driver update? My Lexmark printers won't work with the latest driver update. If I reinstall an older version of the drivers, they work.

    Mine crashed once with new update, but working fine.
    I had to delete old printer, restart iMac, and then reinstall
    new drivers to get it to work. Would not complete without
    the restart after deleting non-working printer. No problems
    since and all features working.

  • HT1933 Good all, is there anyone with problem on the whatsapp 2.11.6 version. It's was crashing on my iPhone. I thought these software was first tested before uploading.

    Good all, is there anyone with problem on the whatsapp 2.11.6 version. It's was crashing on my iPhone. I thought these software was first tested before uploading.

    Looking at the reviews for the current version of the app in the app store it looks like other people are also having problems with it - you could try contacting the developers of the app : http://www.whatsapp.com/contact/

  • Anyone have problems with apple ID's? I have the correct ID in my settings but when I try to update my apps my ID shows my first name and last name but not my ID? I'm not sure what else to do because I've made sure I have the correct ID in my settings!

    Anyone have problems with apple ID's? I have the correct ID in my settings but when I try to update my apps my ID shows my first name and last name but not my ID? I'm not sure what else to do because I've made sure I have the correct ID in my settings! Anyone else have this issue?

    I think its meant to show your name, not your ID.

  • Does anyone have problems using the  highlights, shadows and sharpness edits in iphoto? Since I uploaded Mountain Lion, those editing tabs do not work!

    Does anyone have problems using the highlights, shadows and sharpness controls in iphoto 11? Since I uploaded Mountain Lion on my
    mac mini, those editing features no longer work!!!!

    Sorry, I booted into 10.8 just to test this, but I only have iPhoto 08.

  • Anyone having problem with the iCloud lately

    anyone having problems with iCloud sending from iPad to windows computer within the last week?

    I am having similar problems.  iCloud has been working great between my Mac and iPad, but within the last week, when I save a Pages doc (via my Mac) onto iCloud, it doesn't show up for me to retrieve on my iPad.  All my settings seem to be correct, and there are still plenty of other docs on iCloud that I have previously saved, but these new ones will not show up.  I have plenty of space left, so that is not the issue...

Maybe you are looking for

  • Help for Interactive ADOBE form

    Can anybody tell me the example of Interactive ADOBE form usin web dynpro in ABAP? I am getting stucked at mapping between the two contexts. PLease guide me. And also the next step for Interactive form. After mapping betwwen form and web dynpro conte

  • What is the best directory / location to store master document database?

    I would like to store my master database containing 14GB of data on the iPhone itself, and then use that to connect to my Mac computers (either the desktop, or one of my laptops). So I have a couple of choices that I am aware of. I can store everythi

  • Incomplete swf import

    Hi.im trying to import swf files produced by an external party into an existing captivate project. There are 3 files varying in length from 3-5 minutes. On each attempt to import the files captivate seems to import successfully, but when viewing the

  • Hello there! Does anybody know RadioWMPCoreGecko 5.dll. What is it and how can I remove it because it slows down my computer. Thank you.

    Starting my computer this morning I immediately was informed by Norton Security that RadioWMPCoreGecko 5.dll is safe. I don´t know this data and I want to remove ist because it slows down my computer. Has that something to do with Firefox? The Inform

  • [SOLVED] yaourt seems not to manage cache correctly

    Firstly, I'll tell you that I put these options in /etc/yaourtrc to make yaourt save a copy of all the packages: # Build EXPORT=1 EXPORTDIR="/var/cache/pacman/pkg-local" as it's written in the wiki. The problem is that, for example, when I try to upd