2 questions about authorization filter...

Hi guys,
i need your help to solve my question..
i'm developing a jsf application and i've created an authorization
filter...
My filter must checking for each page access if a registered user is
stored in the session,if not redirect to login page. I've a bit
experience on servlet and filter and i've solved this question with
this filter.
import java.io.IOException;
import javax.servlet.*;
import javax.servlet.http.*;
public class AuthorizationFilter implements Filter {
         * @uml.property name="config"
         * @uml.associationEnd
        FilterConfig config = null;
         * @uml.property name="servletContext"
         * @uml.associationEnd
        ServletContext servletContext = null;
        public AuthorizationFilter() {
        public void init(FilterConfig filterConfig) throws ServletException {
                config = filterConfig;
                servletContext = config.getServletContext();
        public void doFilter(ServletRequest request, ServletResponse response,
                        FilterChain chain) throws IOException, ServletException {
                Utils.log(servletContext, "Inside the filter");
                HttpServletRequest httpRequest = (HttpServletRequest) request;
                HttpServletResponse httpResponse = (HttpServletResponse) response;
                HttpSession session = httpRequest.getSession();
                String requestPath = httpRequest.getPathInfo();
                Visit visit = (Visit) session.getAttribute("visit");
                if (visit == null) {
                        System.out.println("Visit Nullo");
                        session.setAttribute("originalTreeId", httpRequest
                                        .getPathInfo());
                        Utils.log(servletContext, "redirecting to "
                                        + httpRequest.getContextPath() + "/faces/Login.jsp");
                        httpResponse.sendRedirect(httpRequest.getContextPath()
                                        + "/index.jsp");
                else {
                        chain.doFilter(request, response);
                Utils.log(servletContext, "Exiting the filter");
        public void destroy() {
} in my authentication bean,after user has logged in i've
loggedIn=true;
User newUser = new User(loginName, password,teamName, role);
Visit visit = new Visit();
visit.setUser(newUser);
visit.setAuthenticationBean(this);
visit.setLoggedIn(loggedIn);
setVisit(visit);
getApplication().createValueBinding("#{sessionScope.visit}").setValue(faces�Context,visit); to store values into visit object.
and this is my logout function
FacesContext facesContext = getFacesContext();
                Utils.log(facesContext, "Executing AuthenticationBean.logout()");
                HttpSession session = (HttpSession) facesContext.getExternalContext()
                                .getSession(false);
                session.removeAttribute("sessionScope.visit");
                if (session != null) {
                        session.invalidate();
                } My 2 questions are:
1) how can i redirect to login page a user that tries to log in with
the same data of a user stored in the session?
2) how can i handling browser closing?I need a listener?
Please help me,i'm trying to learn about it and i need your help.
Thanks

hi,
1. use the copy - paste functions in the drop down menu.
2. same menu, save setting as........
DR9.

Similar Messages

  • A question about authorization of "me29n".

    I have a question about authorization of "me29n".
    In the screen of me29n, after I choose "cancel release" option,  there are several button I can use, such as "delete","lock","unlock" and so on.    now I want the "delete" button become unavailable after I choose "cancel release".    how can I archive ?   Is there any authorization object to use?   thanks a lot.

    Hello Victor,
    It is possible through Transaction code "SHDS".
    try to create new variant for it.Also you need to take
    ABAP'rs help in this .Try it.All the Best.
    Regards,
    Manjula.

  • Question about the Filter type for the trace provide "Microsoft-Windows-Kernel-File"

    Hello all,
    I have moved this question from the Windows
    Server General Forum accorfing to the suggestion from Mr. Justin Gu 
    I have a question about the Filter function for the trace provider "Microsoft-Windows-Kernel-File".
    I can find the Filter function with the following operation.
    Mr. Justin Gu wrote:
    > You create a Data Collector Set for the trace provider "Microsoft-Windows-Kernel-File" and finish completely, then you > can right click it and select Properties.
    In the Properties dialog box, click Filter and
    then select ‘Edit…’. You will be> able
    to see the Filter type and Filter data in the Filter dialog box.
    What
    Kind of Filter can
    I use in this Filter dialog box?
    And, how can I set to exclude the some kind of datas?
    Could you give me your suggestion?
    Thank you.

    What
    Kind of Filter can
    I use in this Filter dialog box?
    And, how can I set to exclude the some kind of datas?
    Could you give me your suggestion?
    Thank you.
    I'm looking for the same information.

  • Basic question about NR filter

    Very basic question about the (perhaps oversimplified) interface of the noise reduction filter.
    Does anyone know definitively whether the first "Strength" slider is a master control for the filter overall (i.e. it controls the power of all other sliders below it), or whether it only affects an individual parameter (such as what might be perceived as luminosity-based noise, rather than color noise)?
    In other words, if Strength is set to zero, but Reduce Color Noise is set to 100%, does the color noise reduction effectively become zero or 100%?
    Neither the Help Menu nor three of the aftermarket books I have definitively addresses this. There are further redundancies regarding this "Strength" slider when advanced mode is turned on: for instance, if Strength on the "front" panel is set to 0, but 9 on the individual channel panels, what is the effective strength?
    Thanks in advance -

    Yes I'm sure it will work great for you.
    The iFrame format is something Apple has come up with. The reason for its existence is unknown to me so I can only speculate. But it seems to me that Apple "invented" this format in order to have devices such as Ipod/Ipad/Iphone/Ixxx create clips that are editable on consumer hardware such as already mentioned devices but also standard Mac computers, without the need for format conversion.
    iMovie converts most input formats during import, which takes a lot of time, and this need for conversion often comes as a surprise to most people new to home video editing.
    iFrame has a resolution of 960x540 which is long way from the common standards of 1920x1080 and 1280x720. If your end target is YouTube however, this may not be too bad though. However if you intend to go with YouTube HD, you may find iFrame footage to look wrong since they are effectively upscaled to a higher resolution.
    Technically iFrame uses the H.264 algorithm, a smaller frame size (960x540) and a rather low compression scheme. This will result in large files, but the plus side is that the files are ready for editing without the need for any conversion and iMovie will natively edit the files.

  • Questions about authorizations of tables/change requests/badis/locks/lang

    Hi ,
    Few questions I have not been able to find out .
    1) HOw can we ensure that every time we do any change in a table including adding/changing content a change request is generated .Basically to ensure any changes being done are being stored in  a change request .
    2)How to give authorizations to/for a database table ?
    3)can/how we add water marks in scripts and smartforms ?
    4) Can we create and place our own BADIs in SAP standard code?
    5)different LOCK types/categories with clear difference (not the standard SAP help please..)
    6) tips on handling two table controls on one screen.
    7) WHat are the things required if we want to use objects(scripts,texts,smartforms) in different languages ?
    8)multilingual scripts ?
    9) how to have a search help in module pool without using Process on value request ?
    Moderator message - Please - one question per thread and please ask a specific question - post locked
    Edited by: Rob Burbank on Dec 3, 2009 4:29 PM

    FSKB     G/L Account Posting
    this transaction is not working

  • Question about authorizations in SRM + cFolders

    Dear colleagues,
    We are working in a SAP SRM 7.0 prototype.
    Right now we are trying to configure cFolders (installed in the same server as SRM and with RFC working) but we've reached a point where we don't certainlly know what can be going wrong.
    After several tries with different user authorizations we've always had the same result, it's impossible to create or assign a collaboration to a bid when creating it due to an error which just says "Error creating collaboration; check user authorization"
    We have tried with different roles configurations (SAP_CFX_SUPER_USER_ADMIN, all CFX roles, just CFX_*_CREATOR roles...) just nearly everything you can think about, but always get the same error.
    The funny thing about it is that when accessing cFolders through BSP application CFX_RFC_UI this user can create folders and other short of objects, as all works fine.
    Thank you very much for your help.
    Miguel

    Hey Miguel,
    Did you ever find a solution for this issue?  I am having the exact same problem.
    My user has all the roles assigned and is able to create collaborations directly in CFolders, but when I try to create it from SRM RFx, I get the message:  "error creating collaboration; check user authorisation".
    If anybody else has come across the same problem, please help!!
    Thanks and happy new year!
    Monica

  • Questions about authorization variable customer user exit

    Dear all,
    To reduce the authorization maintenance effort, I found from the web that we can use authorization variable with customer user exit RSR00001.
    When I use the transaction CMOD to display the maintain the user exit RSR00001, the user exit does not found. I would like to know how can I use thie user-exit?
    My SAP version is R/3 4.7
    The information of authorization variable  from web is as follow:
    http://help.sap.com/saphelp_nw04/helpdata/en/6d/58f438114ee836e10000000a114084/frameset.htm
    Would anyone have some ideas to solve my questions?
    Many thanks
    Sunny
    Edited by: LI Sunny on Aug 3, 2010 12:08 PM

    Dear Bala Duvvuri,
    Firstly, many thanks of your reply.
    Actually, what I want to do is to call some user-exit when performing authorization checking. I want to add some logic to the authorization checking and the user exit can be called automatically when performing authorization checking.
    I mainly use this checking in the FI module.
    Are there any ways I can perform this checking?
    One more findings, I have another machine containing SAP XI, I can search the user exit RSR00001. but it doesn't exit in SAP R/3 4.7. Is it version issue or my SAP R/3 4.7 doesn't contain the BI module?
    Many Thanks again.
    Sunny

  • I have a question about the filter hud in aperture 3.

      I have a large project (4000 images) and I can't display filter hud.  The hud shows in all my other projects (including albums that are part of this project) but not when I am at the project level.  can anyone suggest a solution?

    Frank, thanks for the help. 
    I have rebuilt the Aperture preferences, rebuilt the database and after all that I have selected browser view and tried to use the filter hud.  Still no luck.
    The strange thing is that I can call up the filter hud in another project and switch to the "problem" project and the hud stays visible.  But i can't launch the hud while I'm in the large project.

  • Question about message filter

    I want to archive all email by using message filter.
    The filter is the following:
    archiveallmail:
    if( rcpt-to == "@mydomain\\.com")
    archive("backup");
    So all mails will be archived to the directory "backup". I would like to seperate different users. For example:
    if ( rcpt-to == "@mydomain\\.com")
    archive(rcpt-to);
    but it will occurr error because rcpt-to is not a string. How can I archive email to separate directories according to recipient address.

    This cannot be done to my knowledge. You would need to enter the $ sign for the variable. But the filter is only looking for a string.
    The $ will also not work as the name of the directory is named after the string name.
    I wouldn't archive all messages in the IronPort. You can use the bcc option to send it to a different mail host
    Regards,
    Mark

  • Question about how filter documents

    First of all,
    Hello all, this is my first post, and i dont know if i`m posting on right local.
    I need to filter Documents on KM, for each one enterprise saw you own Documents, cause here it`s configured to all can see all.
    If someone can awnser this for me, will make me happy.
    Thanks.
    <b>EDIT</b>
    Example:
    I got
    Root:
    Subdir A
    Subdir B
    User 1 - User 1 can see "Subdir 1" ONLY, and cant see Subdir 2
    User 2 - User 2 can see "Subdir 2"ONLY, and cant see subdir 1
    Reggards
    Andre.
    Edited by: Andr Celidonio on Aug 4, 2008 4:30 PM
    Edited by: Andr Celidonio on Aug 4, 2008 4:35 PM

    Hi Andr,
    first of all welcome to SDN. To make access to folders or documents user or group specific you can set access rights for each folder.
    Therefore you have to go to your KM Content in Portal and call the 'Details' from context menu of any folder you want. Then you can set under 'Settings -> Permissions' access rights for users and groups.
    If this was helpful for you, don't forget to reward points.
    Best regards,
    Denis

  • Another BW question about filter in the query definition

    Hi ,
    I have another question about filter in the query definition.
    <u>Question:</u>
    Which of the following objects can be filtered in the query definition?
    A. characteristic
    B. Key figure
    C. Structure
    D. Units
    E. Hierarchy
    My answer is A,B,D,E.
    The answer in the book is A,B,D
    Can anybody tell me which one is wrong?
    Thanks in advance,
    Liu Jia

    HI
    1.The answer could be A,B,D.you can not apply filters on hierarchies
    2.Whenever there is a change in Attribute data(like Location,Num etc...)that has to be reflected in all aggregates of the cube.Thsi can be done by running "ATTRIBUTE CHANGE RUN".
    sri

  • A question about the example "Filter"

    Hi,
    I have a question about the example "Filter (The Filter example illustrates how to filter data using a butterworth filter)" in the measurement studio reference now, it is one of the analysis examples.
    I load this example in Vc++, but when I compile it, the error messages are:
    "'ButterworthHighPass' : is not a member of 'CNiMath'" ,
    "'ButterworthHighPass' : undeclared identifier",
    "'ButterworthLowPass' : is not a member of 'CNiMath'" ,
    "'ButterworthLowPass' : undeclared identifier",
    "'WhiteNoiseWave' : is not a member of 'CNiMath'" ,
    "'WhiteNoiseWave' : undeclared identifier",
    Can you tell me what is matter? and how can I solve it?
    Thanks!

    Hi,
    I was hoping that you could tell me what version and edition you have of Measurement Studio. I also need to know if you are using .NET or 6.0. For example, "I am using Mesurement Studio Enterprise edition 7.1 for Visual Studio .NET."
    Depending on the version that you have, different functions and controls are included. I believe that you may have an edition that does not include the Butterworth filter. Let me know and we can go from there.
    Thanks,
    Caroline
    National Instruments
    Thanks,
    Caroline Tipton
    Data Management Product Manager
    National Instruments

  • Question about  SAP's predefined authorization roles and responsibilities

    Hi,
    Is  there  a document (like a best practice document) that talks about what are the SAPu2019s predefined roles to be assigned to different responsibilities(like Basis, ABAP Developer, ABAP Developer for HR etc, Functional Configuration etc)?. If anybody have seen this document, please send the URL for that.
    I am seeing SAP AUTHORIZATION SYSTEM and SAP AUTHORIZATION MADE EASY books in the market.
    But these books talk  about authorization concept up to 46C only( I might be wrong).
    Please advise about any latest book on SAP Authorization that talks about NW(ABAP + JAVA)  also.
    Thanks.
    Raj.

    Hi
    The following link help your requirement on documentation.
    http://help.sap.com/saphelp_banking463/helpdata/en/23/07d128f31011d296330000e82de14a/content.htm
    Regards
    Shan

  • Question about using multiple iPods on the same PC

    I've read the FAQs on this subject but I still have a couple of questions about multiple users with separate iPods using the same PC.
    I want to use my family's desktop (A new Gateway with Vista, if it matters) for my new iPod Classic, but my father already has an iTunes account on there for his iPod. I know I can create a new user account on the PC and move iTunes to a shared folder so that we can share music, but will this second account be able to purchase music from the iTunes store or am I going to have to switch between Windows User accounts to make purchases and then move new songs into my separate iTunes account via the shared folder? Will it be its own separate iTunes account (separate user name, separate credit card used, etc.) or will it just be a second library that's dependant on the first?
    I want to be able to have my own iTunes account, make my own purchases in it, and maybe occasionally share tv shows or something with my father.
    If this can't be done, would I be better off just creating new playlists for our two iPods from the same library, or creating a second library on my Father's account?
    Also, if I want to access things I've purchased from iTunes on this desktop in iTunes on my notebook, will I be able to?
    I hope that made sense.
    Sorry if these seem like silly questions. This will be my first iPod as I'm really excited about the 160gig and want to know if these things are possible.
    Thanks in advance for any help

    Hi, Wes.
    Congratulations on your new iPod Classic and Welcome to the Apple Discussions.
    For no particular reason, let's answer your last question first ...
    ... if I want to access things I've purchased from iTunes on this desktop in iTunes on my notebook, will I be able to?
    The iTunes Store operates on a one download per purchase policy so you will have to copy the purchases from one computer to the other and make sure that you authorize the laptop to play the songs.
    As to your first question ...
    ... will this second account be able to purchase music from the iTunes store or am I going to have to switch between Windows User accounts to make purchases ...
    Whatever XP User Account you are logged in to doesn't really matter. What's important is which Apple Account you sign in to ... yours or your Dad's or - if you had my Apple ID and password - The Mimico Kid's for that matter. You can sign in to any Apple Account on any XP User Account. Or any computer for that matter.
    Where the XP User Account comes into play is that it will determine where on your computer the purchases are downloaded. Files will be sent to the iTunes Music folder as specified in the iTunes Edit menu > Preferences > Advanced tab > General sub-tab. Default settings will have a different location for each User Account - C:\Documents and Settings\ user name \My Documents\My Music\iTunes - but if you've read this article in the Apple Knowledge Base, you will know you can change the location of the iTunes Music folder in each XP Account to a common location such as C:\Documents and Settings\All Users\Documents\My Music\iTunes.
    Post back if all this hasn't been as clear as mud and you need anything clarified.

  • Question about restoring a backup.

    Question about restoring a backup. I want to restore an old back up to recover messages and photos. If I restore my iPhone with this old backup, will it delete any CURRENT text messages that I currently have on my phone? Same concern current photos on my phone. Thanks!

    Hello,
    I'm having a problem ....
    My phone was giving me trouble and I had to completely wipe everything from it. I had backup on my PC , but when I connect my wiped phone back to my PC, it couldn't recognize it , so I got a question...something like "this phone is connected first time....do you want to authorize this computer...blah,blah" ,
    but than I've got next question, something like "do you want to merge data or you want to overwrite your phone" and I've pressed "merge" by accident
    Now....is there any way back from it? How I can get data from all apps back to my phone ?
    All app's are there, but all of them are empty ! Please help!

Maybe you are looking for

  • PSE 9 Install Error 1311....Source File Not Found

    Just got PSE 9 for Christmas. Tried to install it and got this msg repeatedly in the first minute of install. I decided to take it back thinking it was the disk. Got a new disk and still have the same problem. I've tried all of the troubleshooting op

  • How do I find camera roll photos after backing up my iPad in iTunes before migrating to iOS8 then back to iOS7?

    I recently, mistakenly, migrated my iPad to iOS8. In less than a day I concluded iOS8 was not for me, I migrated back to IOS 7.  I backed up the iPad in iOS8 using iTunes before migrating back and now find that my camera roll has gone.  I realise tha

  • Runtime.getRuntime().exec in JBuilder 7

    Hello! I want to do that: Process p = Runtime.getRuntime().exec("CntVirRel.exe"); System.out.println("Procesando....."); p.waitFor(); System.out.println("waitfor end"); which seems easy. My problem is that if I put this code in a program using only t

  • Query on Sales Assistant for Opportunity Transaction

    Hello All, We have configured the activities which the sales assistant has to perform the same is getting determined, however when we click on the particular activities the required activity is not getting created, please let me know if there any con

  • Vision 8.2.1 evaluation Problem

    Hi All I had installed the Vision 8.2.0 Development Module evaluation mode and license day is expired before. Now, as i know that Vision Development Module upgraded to 8.2.1 & 8.5 version so  i want to try its new features for those 8.2.1 or 8.5 eval