Strange behavior when using servlet filter with simple index.htm

I am new to J2EE development so please tolerate my ignorance. I have a web application that starts with a simple index.htm file. I am using a servlet filter throughout the website to check for session timeout, redirecting the user to a session expiration page if the session has timed out. When I do something as simple as loading the index.htm page in the browser, the .css file and one image file that are associated, or referenced in the file are somehow corrupted and not being rendered. How do I get the filter to ignore css and image files??? Thank you!!
The servlet filter:
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class SessionTimeoutFilter implements Filter {
     String[] excludedPages = {"SessionExpired.jsp","index.htm","index.jsp"};
     String timeoutPage = "SessionExpired.jsp";
     public void destroy() {
     public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
          if ((request instanceof HttpServletRequest) && (response instanceof HttpServletResponse)) {
               HttpServletRequest httpServletRequest = (HttpServletRequest) request;
               HttpServletResponse httpServletResponse = (HttpServletResponse) response;
               //httpServletResponse.setHeader("Cache-Control","no-cache");
               //httpServletResponse.setHeader("Pragma","no-cache");
               //httpServletResponse.setDateHeader ("Expires", 0);
               String requestPath = httpServletRequest.getRequestURI();
               boolean sessionInvalid = httpServletRequest.getSession().getAttribute("loginFlag") != "loggedIn";               
               System.out.println(sessionInvalid);
               boolean requestExcluded = false;
               System.out.println(requestExcluded);
               for (int i=0;i<excludedPages.length;i++){
                    if(requestPath.contains(excludedPages)){
                         requestExcluded = true;
               if (sessionInvalid && !requestExcluded){
                    System.out.println("redirecting");
                    httpServletResponse.sendRedirect(timeoutPage);
          // pass the request along the filter chain
          chain.doFilter(request, response);
     public void init(FilterConfig arg0) throws ServletException {
          //System.out.println(arg0.getInitParameter("test-param"));
The index.htm file (or the relevant portion)<HTML>
<Head>
<META http-equiv="Content-Style-Type" content="text/css">
<LINK href="RTEStyleSheet.css" rel="stylesheet" type="text/css">
<TITLE>Login</TITLE>
</HEAD>
<BODY>
<FORM NAME="Login" METHOD="POST" ACTION="rte.ServletLDAP"><!-- Branding information -->
<table width="100%" border="0" cellpadding="0" cellspacing="0">
     <tr>
          <td width="30%" align="left"><img src="images/top_logo_new2.gif">
          </td>
          <td width="37%" align="center"></td>
          <td width="33%" align="right"></td>
     </tr>
</table>
My web.xml entry for the filter:     <filter>
          <description>
          Checks for a session timeout on each user request, redirects to logout if the session has expired.</description>
          <display-name>
          SessionTimeoutFilter</display-name>
          <filter-name>SessionTimeoutFilter</filter-name>
          <filter-class>SessionTimeoutFilter</filter-class>
          <init-param>
               <param-name>test-param</param-name>
               <param-value>this is a test parameter</param-value>
          </init-param>
     </filter>
     <filter-mapping>
          <filter-name>SessionTimeoutFilter</filter-name>
          <url-pattern>/*</url-pattern>
          <dispatcher>REQUEST</dispatcher>
          <dispatcher>FORWARD</dispatcher>
     </filter-mapping>

Hi,
Try adding CSS files and images to the excluded Pages.

Similar Messages

  • Strange behaviour when using connection pooling with proxy authentication

    All
    I have developed an ASP.NET 1.1 Web application that uses ODP.NET 9.2.0.4 accessing Oracle Database 8i (which is to be upgraded to 10g in the coming months). I have enabled connection pooling and implemented proxy authentication.
    I am observing a strange behaviour in the live environment. If two users (User 1 and User 2) are executing SQL statements at the same time (concurrent threads in IIS), the following is occurring:
    * User 1 opens a new connection, executes a SELECT statement, and closes this connection. The audit log, which uses the USER function, shows User 1 executed this statement.
    * User 2 opens the same connection (before it is released to the connection pool?), excutes an INSERT statement, and closes this connection. The audit log shows User 1, not User 2, executed this statement.
    Is this a known issue when using connection pooling with proxy authentication? I appreciate your help.
    Regards,
    Chris

    Hi Chris,
    I tried to reproduce your complaint, but was unable to. I didnt use auditting however, just a series of "select user from dual" with proxy authentication. You might want to see if you can put together a small complete testcase for this and open a sr with support.
    Cheers
    Greg

  • Problem with SSAS cube reporting action when using pivot filter with cubevalue function

    Hi everyone,
    I have a quite specific problem when I combine cube actions (Reporting Action SSRS) with Excel's cubevalue() function.
    The problem is when I use a pivot filter as a parameter for the cubevalue() function. The action item does not show up in the context menue.
    The cube action works fine when I do it from a "normal" pivot or if I use the cubevalue() function without the reference to a pivot filter (all the parameters in the function are "hard-coded").
    I use SSAS 2012 and Excel 2010.
    Thanks for yor help.
    Gerhard

    Hi everyone,
    I actually figured out a way to solve this problem. I had to use a detour to solve this bug in Excel (at least I think it's a bug).
    What I needed to do: I had to make Excel belive that the filter is actuall hard-coded and does not come from a pivot filter. This was only possible by adding a new calculated measure to the cube that gives back the MEMBER_Unique_Name to the current member
    passed. This "value" can then be used to go back to the cube and select the cubemember function. Here is a small example.
    This is the cube member:
    CREATE MEMBER CURRENTCUBE.[Measures].[RegCompBranNameKey] AS
    [Company Branch].[Reg - Comp - Bran Name].CurrentMember.Properties("MEMBER_UNIQUE_NAME", TYPED),
    VISIBLE = 0 ;
    And this is then done in a hidden Excel cell:
    =CUBEMEMBER("Metrics";
     IF(RIGHT(CUBEVALUE("Metrics";<PivotFilter>;"[Measures].[RegCompBranNameKey]");5)="[ALL]";"[ALL]";
      RIGHT(CUBEVALUE("Metrics";<PivotFilter>;"[Measures].[RegCompBranNameKey]");LEN(CUBEVALUE("GlobalMetrics";<PivotFilter>;"[Measures].[RegCompBranNameKey]"))-57)
    I had to use the UniqueName property because I have a combined filter. That's also the reason for this truncation and also useing the last part of it. If you just have a straight key you more easily use it.

  • Strange behavior when creating a document with an "html" node

    A strange thing is happening here. I'm using the javax.xml.transform.Transformer to save some XML documents. I can create documents with any arbitrary DOM tree I want, but if I have the root node have a name of "html". somehow the Transformer decides to apply its own HTML rules and handles it differently from all other document types. The problem is that its html-specific rules are not what I want. Specifically, it is doing things like outputting <br> instead of
    , putting in meta-equiv tags that I don't want, etc. This is all bad because I'm not writing HTML. I'm writing carrier-specific mobile xhtml documents and I don't want the javax.xml.transform.Transformer to be "helping" me out any.
    There must be some way to get this under control. Can anyone advise me?
    Thanks

    I think I solved the problem: I need to put this line in:
    transformer.setOutputProperty(OutputKeys.METHOD, "xml");and that does the trick, and forces it to not get fancy when it's outputting <html>. I suppose there's a way of setting that in the TransformerFactory so I don't have to set it in every individual transformer I create but that's a minor issue.

  • Very strange bug when using a view with a date

    Hi,
    Just thought I'd point out this bug I'd found and see if anybody has had similar problems.
    I'm connecting to Oracle 9i from servlets using the thin client-side JDBC driver. In the Oracle schema I've got a few views to another schema set up. One of them looks like this:
    select
    blah
    blah
    from
    projects
    where
    project_start_date between '1-Apr-2000' and '31-Mar-2010'
    Nothing wrong with this, you'd think. And indeed, the view works fine and any valid queries on the view also work fine if they're performed from anywhere apart from my servlets. The servlets can perform queries on all my other views but they think that this particular view is completely empty.
    As soon as I change the view to:
    project_start_date > '1-Apr-2000'
    the servlets can see the data in the view.
    Hope all this made sense. Anybody else had any similar problems?
    Chris.

    Any time you want to do a date comparison, you really want to do an explicit to_date conversion rather than relying on Oracle to do it implicitly. I'll wager that if you change the view to
    SELECT <columnList>
      FROM projects
    WHERE project_start_date BETWEEN to_date('1-Apr-2000', 'DD-MON-YYYY') and to_date('31-Mar-2010', 'DD-MON-YYYY')that everything will work.
    Justin

  • Strange behavior when using Runtime.exec() to run batch file

    I've been struggling with this for hours.
    I have a Swing application which upon clicking a button, I want to execute a batch file. This batch file itself uses a command window.
    When I use
    Runtime load = Runtime.getRuntime();
    load.exec("cmd /c start c:\\renew\\renew2\\bin\\win\\renew.bat");
    The program (Renew) will start up no problem, but when I exit Renew, the command window stays put. I want the command window to close. Running Renew stand-alone, upon closing Renew, it will exit the command window.
    When I use
    Runtime load = Runtime.getRuntime();
    load.exec("cmd /c c:\\renew\\renew2\\bin\\win\\renew.bat");
    or
    Runtime load = Runtime.getRuntime();
    load.exec("c:\\renew\\renew2\\bin\\win\\renew.bat");
    When I press the button, sometimes the Renew application will come up right away, sometimes the Renew application will come up after a very long delay, and most times, the Renew application will only come up after I have closed the Swing frame where the button is located. When I use this code, the command window that Renew uses is never visible.
    What I want is to simply have the Renew application behave the same exact way launching from my Swing application as when Renew is being run standalone.
    Any suggestions? Thanks so much.
    Sincerely,
    Will

    Getting rid of start makes the startup time very variable. Sometimes it starts up right away, sometimes after many minutes, most times only after I close my application.
    Thanks, Any other suggestions?
    (BTW, I have read the famous "When Runtime.exec() won't" article, and have tried its suggestions to no avail)
    Message was edited by:
    willies777

  • Strange behavior when using Labview to collect data from Tektronix tds8200 oscillosco​pe

    I have hit a wall in trying to figure this one out. The problem I am having is that my program does not start the oscilloscope when it should.
    I am using a Tektronix TDS8200 oscilloscope. My goal is to collect waveform data from the oscilloscope using Labview. My program first initializes and configures the oscilloscope; this part of the program runs fine.
    The second part of the program begins the data aquisition using the  'tktds8k Start or Stop Aquisitions.vi' function, which is equivalent to pressing the Run button on the scope. The 'tktds8k Get Waveform.vi' function is then used and should ideally return the data, which I have connected to a waveform graph for visualization.
    When I run my program, the first part executes without issue, but as soon as the program gets to the Get Waveform function, the Run button on the scope, which is green when running, turns off; the program then times out, and no data is collected.
    Here's where it gets weird. I went through some debugging to try and figure this out, and I put breakpoints on both the Start and Get Waveform functions so that I could step through the later part of the program. The program continues through the Start function, and the Run button on the scope is green. The breakpoint for the Get Waveform function is reached, and when I press continue, the Run button turns off and then turns back on almost immediately; the data is collected, the waveform graph is displayed, and the program exits without an error.
    I thought timing might be the issue, so I made the program wait as long as 5 seconds between the Start and Get Waveform functions, and that did not work. I also tried moving the Start function to before the configuration functions, and removing the Start function altogether; neither method worked.
    Are there any thoughts on why the program works when I have the breakpoints enabled and doesn't when the breakpoints are disabled? I am sure that there is an easy fix, but I haven't been able to find a solution.
    I have attached a pdf containg information on the Oscilloscope functions (tktds8k.pdf), and I have also attached my program.
    Solved!
    Go to Solution.
    Attachments:
    tktds8k.pdf ‏1424 KB
    set_up_osc.vi ‏32 KB

    Thank you for the swift replies.
    After Bill asked about the ID Query, I decided to try a few things that I had already gone over just to double check. I was suspspicious that timing was the source of the error. Using a timed while loop, I set the wait time to 10 seconds and got results. As it turns out, 5 seconds is not long enough, but 8 seconds is a sufficient wait time for the program to work. With the problem solved, I am still mystified as to why waiting 8 seconds is required.
    I think that the oscilloscope must be given sufficient time to display the signal on-screen before the Start Aquistion or Get Waveform functions are used. With this logic in mind, the breakpoints were acting as a sort of wait, allowing the signal to be displayed before continuing through the program.
    In response to Jeff, I am indeed using an external direct trigger. The hardware is sound, but apparently, my coding could use some work.
    I have attached the modified code. I am certain that there is a more elegant solution to the timing than simply slapping a timed while loop on the code. Any suggestions?

  • Strange behavior when I try to match a mpeg2 video with the menu size image

    hello all,
    got a strange behavior when I try to match a mpeg2 video with the menu size image,
    menu size is 1920 x 1080 (photoshop file)
    mpeg2 video 1920 x 1080 (1second 19 frames)
    the idea is to go from the menu link to the next sub menu with a video as transition, using the same image on the video as the menu and then zooming in (in my case through a door) to end up after the zoom in the next level menu.
    I try to achieve a smooth change from the first play menu picture to the video image into the next level menu picture,
    everything works good but when I watch it on the preview mode on the left and right side of the video it shows a black bar at least 15 to 25 pixel wide, that means the video image appears smaller and it causes a little jump what is preety disturbing and can not be sold as a professional work.
    why encore treats the video size and picture differently?
    it's gratful appreciated if somebody who got experience in a transition I mentioned obove posting any solution,
    thankl you all

    Hi all
    I'm having a very similar problem with Encore. My menu items are distorting (a minor but infuriating squashing top and bottom) when previewed.
    Using Encore,PS,AE CS4
    DVD format SD PAL DV widescreen
    I created 3 menu frameworks and 3 video transistions to link them in AE. On the final frame of each transistion in AE I saved the frame with Composition>Save Frame to> Photoshop Layers. In PS i added the button functionality and saved.
    In Encore I use Dynamic link to import AE transistions as timelines and imported each PS menu twice, once as "menu" and once as an asset.
    When I link the timeline transistions to the menu and preview at the point the menu begins the whole image is squashed. When the next transistion is activated the image returns to its original size.
    Thinking it was the use of PS that was causing the menus to distort I used the menu asset directly in the time line. Obviously no menu functionality but also no distortion. The AE transistion flowed straight into the "menu" just as I expected.
    In the properties panel the menu Aspect Ratio 16:9
    The AE transistions PAR is SD PALwidescreen 1.4587.
    I did try the Blu Ray suggestion above but the same distortion was apparent.
    Any suggestions short of squashing the video to match the menu would be welcomed.
    Thanks

  • Strange behavior when resizing with 'Selection Tool'

    Hello,
    I have a really strange issue when using selection tool to resize object. I have several rectangles stacked and grouped inside a layer. When I select one of them (either in Layer panel or with Group selection tool) and switch to 'Selection Tool (V)' to resize it, this tool behaves diferently at diferent zoom levels. Only at 200% zoom it behaves as it shoul.. With 100-150% zoom result is diferent - like there's a invisible box around selected object and I'm resizing it.. I've tried to explain the issue in attached image.. Anyone knows why is this happening?
    Thanks.

    - make new document, size 16383x16383px
    - create rectangle any width, hight say 200px (or anything less then 320px for 5% zoom)
    - select rectangle and show bounding box
    - try resizing hight by stretching bounding box
    - this is how same selection looks at diferent zoom levels
    - same zoom level as befor, hight 100px..

  • Question about the CSS behavior when using layer 3 sticky and sticky table

    Hi everyone,
    I have a question about the CSS behavior when using layer 3 sticky and sticky table is full.
    If I configure layer 3 sticky and specify the inactivity timeout as below, how does the CSS
    handle subsequent needed sticky requests ?
    advanced-balance sticky-srcip
    sticky-inact-timeout 30
    CSS document says that
    Note:
    If you use the sticky-inact-timeout command to specify the inactivity timeout
    period on a sticky connection, when the sticky table becomes full and none of
    the entries have expired from the sticky table, the CSS rejects subsequent
    needed sticky requests.
    My question is what is the next reaction by doing the CSS if the CSS is in the
    following condition:
    when the sticky table becomes full and none of the entries have expired from
    the sticky table, the CSS rejects subsequent needed sticky requests
    Does CSS just rejects/drops subsequent needed sticky requests ?
    or
    Does CSS does not stick subsequence requests to particular service but CSS forward
    subsequence requests with round-robin basis ? which means if the sticky table is full,
    the CSS just works round-robin load balancing fashion for subsequence requests ?
    Your information would be appreciated.
    Best regards,

    Hello,
    There is a good document explaining this on Cisco web site
    http://www.cisco.com/en/US/products/hw/contnetw/ps789/products_tech_note09186a0080094b4b.shtml
    It depends if the sticky-inact-timeout is used or not. If not, it's FIFO (the oldest entry in the sticky table is removed). If yes, the CSS will reject the next sticky request.
    Rgds,
    Gaetan
    Rgds
    Gaetan

  • [svn] 1720: Bugs: LCDS-304 - Authentication not working in all cases when using security constraint with NIO endpoints .

    Revision: 1720
    Author: [email protected]
    Date: 2008-05-14 14:50:06 -0700 (Wed, 14 May 2008)
    Log Message:
    Bugs: LCDS-304 - Authentication not working in all cases when using security constraint with NIO endpoints.
    QA: Yes
    Doc: No
    Details:
    Update to the TomcatLoginCommand to work correctly with NIO endpoints.
    Ticket Links:
    http://bugs.adobe.com/jira/browse/LCDS-304
    Modified Paths:
    blazeds/branches/3.0.x/modules/opt/src/tomcat/flex/messaging/security/TomcatLoginCommand. java

    Revision: 1720
    Author: [email protected]
    Date: 2008-05-14 14:50:06 -0700 (Wed, 14 May 2008)
    Log Message:
    Bugs: LCDS-304 - Authentication not working in all cases when using security constraint with NIO endpoints.
    QA: Yes
    Doc: No
    Details:
    Update to the TomcatLoginCommand to work correctly with NIO endpoints.
    Ticket Links:
    http://bugs.adobe.com/jira/browse/LCDS-304
    Modified Paths:
    blazeds/branches/3.0.x/modules/opt/src/tomcat/flex/messaging/security/TomcatLoginCommand. java

  • How Can i use Html frames with  simple JSP???

    How Can i use Html frames with simple JSP???
    Actually i am creating an application in which i have used Index.html as frame.
    Noew i am trying that if i click on a link of one frame(say menu frame) the \result shoul come to some other frame(say frame named mainwindow).
    Hoe can i do like this???
    Anand Pritam

    Well i am using..
    < Base target="mainwindow">
    But it is no working is there some other way??

  • Scope when using a JavaBean with JSP

    what is the meaning of this question .....?
    "Which of the following can not be used as the scope when using a JavaBean with JSP? "
    question 4
    site :http://java.sun.com/developer/Quizzes/jsptut/

    The question is clearly written. I don't see how you can be confused. But let's assume you are since you would not have posed the question.
    Dumbed-down:
    There are 4 scopes or areas of variable visibility in JavaServer Pages. Which of those can areas can not be used with JavaBeans?
    Does that help?

  • When using Camera raw with PS12 after editing, I cannot save my file in JPEG, only DNG

    When using Camera RAW after editing photo I can only save file as DNG, I want to save as JPEG. HOW??
    THANKS LLOYD

    BARBARA,Yes, you are so right, I was deceived by the eve button,  Just tried it and it WORKS GREAT-Thanks for the help.
    THANKS AGAIN AND HAVE A GOOD DAY Lloyd
          From: Barbara B. <[email protected]>
    To: Lloyd Bennett <[email protected]>
    Sent: Tuesday, January 13, 2015 11:46 AM
    Subject:  When using Camera raw with PS12 after editing, I cannot save my file in JPEG, only DNG
    When using Camera raw with PS12 after editing, I cannot save my file in JPEG, only DNG
    created by Barbara B. in Photoshop Elements - View the full discussionYou are being deceived by the Save button, like most people. That button is not the Save As button, really, but a link to the DNG converter. To save your raw file in an image format, click the Open button instead and then save in the format of your choice in the editor. If the reply above answers your question, please take a moment to mark this answer as correct by visiting: https://forums.adobe.com/message/7092207#7092207 and clicking ‘Correct’ below the answer Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: Please note that the Adobe Forums do not accept email attachments. If you want to embed an image in your message please visit the thread in the forum and click the camera icon: https://forums.adobe.com/message/7092207#7092207 To unsubscribe from this thread, please visit the message page at , click "Following" at the top right, & "Stop Following"  Start a new discussion in Photoshop Elements by email or at Adobe Community For more information about maintaining your forum email notifications please go to https://forums.adobe.com/thread/1516624.

  • How to avoid data repetation when using select statements with innerjoin

    how to avoid data repetation when using select statements with innerjoin.
    thanks in advance,
    satheesh

    you can use a query like this...
      SELECT DISTINCT
             frg~prc_group1                  "Product Group 1
             frg~prc_group2                  "Product Group 2
             frg~prc_group3                  "Product Group 3
             frg~prc_group4                  "Product Group 4
             frg~prc_group5                  "Product Group 5
             prc~product_id                  "Product ID
             txt~short_text                  "Product Description
    UP TO 10 ROWS
    INTO TABLE l_i_data
    FROM
    Joining CRMM_PR_SALESG and
    COMM_PR_FRG_ROD
    crmm_pr_salesg AS frg
    INNER JOIN comm_pr_frg_rod AS prd
    ON frgfrg_guid = prdfragment_guid
    Joining COMM_PRODUCT and
    COMM_PR_FRG_ROD
    INNER JOIN comm_product AS prc
    ON prdproduct_guid = prcproduct_guid
    Joining COMM_PRSHTEXT and
    COMM_PR_FRG_ROD
    INNER JOIN comm_prshtext AS txt
    ON prdproduct_guid = txtproduct_guid
    WHERE frg~prc_group1 IN r_zprc_group1
       AND frg~prc_group2 IN r_zprc_group2
       AND frg~prc_group3 IN r_zprc_group3
       AND frg~prc_group4 IN r_zprc_group4
       AND frg~prc_group5 IN r_zprc_group5.
    reward it it helps
    Edited by: Apan Kumar Motilal on Jun 24, 2008 1:57 PM

Maybe you are looking for