Redirect to Error Page Example ?

Hi,
Anybody, have an error page working example of how to redirect to error page in 10.1.3, i tried it many ways , followed the ADF Dev Guide PDF page 395 and 396 and no luck.
where i should write the <error-page> and <dispatcher>REQUEST</dispatcher>
and <dispatcher>ERROR</dispatcher>
tags in web.xml
any tricks in that ???
thanks in advance

Hi Frank,
thanks for replying , unfortunately it did not work , it give me
"The page cannot be displayed" , it seems that the Exception have been caught but it can't display the error page
here is my web.xml
<?xml version = '1.0' encoding = 'windows-1252'?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee">
<description>Empty web.xml file for Web Application</description>
<context-param>
<description>Makes Security View Handler printing debug messages at runtime</description>
<param-name>com.groundside.jsf.security.print_debug_messages</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<description>Customize error message shown upon unauthorized access attempt</description>
<param-name>com.groundside.jsf.security.unauthorized_access_error_messages</param-name>
<param-value>User is not authorized to perform requested action</param-value>
</context-param>
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>CpxFileName</param-name>
<param-value>view.DataBindings</param-value>
</context-param>
<filter>
<filter-name>adfBindings</filter-name>
<filter-class>oracle.adf.model.servlet.ADFBindingFilter</filter-class>
</filter>
<filter>
<filter-name>adfFaces</filter-name>
<filter-class>oracle.adf.view.faces.webapp.AdfFacesFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>adfBindings</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>adfBindings</filter-name>
<url-pattern>*.jspx</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>adfFaces</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>adfFaces</filter-name>
<url-pattern>*.jspx</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>resources</servlet-name>
<servlet-class>oracle.adf.view.faces.webapp.ResourceServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>JsfAuthenticationServlet</servlet-name>
<servlet-class>com.groundside.jsf.pagesecurity.authentication.J2eeAuthenticationServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>resources</servlet-name>
<url-pattern>/adf/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>JsfAuthenticationServlet</servlet-name>
<url-pattern>/jsfauthentication</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>35</session-timeout>
</session-config>
<mime-mapping>
<extension>html</extension>
<mime-type>text/html</mime-type>
</mime-mapping>
<mime-mapping>
<extension>txt</extension>
<mime-type>text/plain</mime-type>
</mime-mapping>
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>errorpage.jsp</location>
</error-page>
</web-app>
here is how i make the exception
public void commandButton1_action() throws Exception {
throw new java.lang.Exception();
here is the code of the page that have the button that throws the exception
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=windows-1252"
import="java.lang.Exception"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af"%>
<%@ taglib uri="http://xmlns.oracle.com/adf/faces/html" prefix="afh"%>
<f:view>
<afh:html binding="#{backing_untitled3.html1}" id="html1">
<afh:head title="untitled3" binding="#{backing_untitled3.head1}" id="head1">
<meta http-equiv="Content-Type"
content="text/html; charset=windows-1252"/>
</afh:head>
<afh:body binding="#{backing_untitled3.body1}" id="body1">
<h:form binding="#{backing_untitled3.form1}" id="form1">
<af:commandButton text="commandButton 1"
binding="#{backing_untitled3.commandButton1}"
id="commandButton1"
action="#{backing_untitled3.commandButton1_action}"/>
</h:form>
</afh:body>
</afh:html>
</f:view>
<%-- oracle-jdev-comment:auto-binding-backing-bean-name:backing_untitled3--%>
here is the errorpage.jsp
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=windows-1252"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af"%>
<%@ taglib uri="http://xmlns.oracle.com/adf/faces/html" prefix="afh"%>
<f:view >
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=windows-1252"/>
<title>untitled4</title>
</head>
<body>eeeeeror</body>
</html>
</f:view>
<%-- oracle-jdev-comment:auto-binding-backing-bean-name:backing_untitled4--%>
by the way , in the error page if i change the f:view to f:subview , the page itself will not run
thanks very much for your time.
Message was edited by:
bassem.farouk

Similar Messages

  • How Can I redirect to Error Page

    Hi
    I have below requirement to insert records into a table based on entered search criteria. And same time don't want to insert the records if there are already records for same search criteria. For this we have done below steps
    1) We have a page with two Date fields.
    i) Date From
    ii) Date To
    2) User enters Date From and Date To values and he press "Go" Button.
    We have created a Validation at page level of type "Function Returning Boolean".
    We are passing two searching Date From and Date To values to function and returning TRUE if there are already records.
    Now when condition is TRUE then we want to redirect to a new Page.
    How can we do this?
    Appreciate if somebody can help me.
    Regards
    Kiran Akkiraju

    Scott
    Here is the actual situation.
    Let us assume I want to populate EMP_TMP table from EMP table.
    For this on my first page I have two Fields which are
    1) From Date
    2) To Date
    I am going to give some values to these two fields and I press a button.
    Basically what I have to do is
    INSERT INTO EMP_TMP
    SELECT * FROM EMP
    WHERE TRUNC(HIREDATE) BETWEEN TO_DATE(:P_DATE_FROM, 'DD-MON-YYYY') AND TO_DATE(:P_DATE_TO, 'DD-MON-YYYY')
    But before doing this I want to validate whether for given date range already data exist in EMP_TMP table or not?
    If Already data exist then I have to redirect to User to one page which showing some details.
    IF data is not there then I have to insert these records into EMP_TMP table and show those records into another page.
    I have given this example on EMP table. But I was having similar example here.
    Could you please let me know how can I achieve this.
    Regards
    Kiran Akkiraju

  • JSP error page does not displayed on its own, includes in the original JSP

    Problem Description: - Exceptions in a Condition cause pages to fail to render.
    The actual issue is, the JSP error page does not displayed on its own, included in the original JSP Page when exception occurs.
    Problem Cause: As per the JSP specification when jsp content reached the buffer size (default 8KB) the page being flushed (Part of condent displays). The default �autoFlush� value is true.
    When the page buffer value is default size (8KB), and if any exception occurs after flushing the part of the content, instead of redirecting into error page, the error page content included in the original page.
    If i specify autoFlush="false" and with default buffer size, at the runtime if the buffer size is reached, i am getting stackoverflow error.
    To solve the above problem we can make it autoFlush=�false� and buffer=�100KB�. But we can�t predict the actual size of the page.
    I found in one of the weblogic forum as no solution for this issue. Ref.
    http://support.bea.com/application?namespace=askbea&origin=ask_bea_answer.jsp&event=link.view_answer_page_clfydoc&answerpage=solution&page=wls/S-10309.htm
    Please provide me any solution to resolve the problem.

    Error-Page tags work best with an error.html pages. If you have an error.jsp page what I would do, and I have, is wrap my classes and jsp pages in a try catch block where you forward to the error jsp page and display anything you want. YOu can also do this with if else statements. I have used the tomcat error pages before but when I've implemented them I used java.lang.Exception as the error to catch not Throwable. I don't know if this would make a difference or have anything to do with your problem.

  • IPad browser automatically redirecting to adobe flash error page

    This is very annoying. I have had iPad for a few days but first noticed this just now.
    While perusing used cars on cars.com I found that clicking on a link to a detail listing would first take me to that page, but then almost immediately redirect to an adobe flash error page. Feels like a sleazy trick by adobe to annoy iPad users.
    Example link below, this is just a listing for a used Porsche in northern Va:
    1975 Porsche 911 S - $10,350 (obo)
    <link edited by host>

    It's not something Adobe is doing. The cars.com site is redirecting you to adobe.com because you're missing a plugin that cars.com is using to display that page.

  • In safari, On my Ipad2,I get the error message, "too may redirects" and the page won't load. Anyone with advice? I have cleared the cache, cookies, and history and restarted.

    In safari, on my Ipad2, I get the error message " too many redirects" and the page won't load. I have cleared the cache, cookies, and history and have rebooted and I still get the same problem. Any advice?

    In safari, on my Ipad2, I get the error message " too many redirects" and the page won't load. I have cleared the cache, cookies, and history and have rebooted and I still get the same problem. Any advice?

  • How to redirect to an error page when database is down

    We have build an struts/jsp-application with JDeveloper 10g and ADF. If the connection to the database fails, we get a plain page with header "500 Internal Server Error" and the exception and a stack trace. Of course we want to catch this exception and redirect the user to an error page with all of the standard design elements of our site and with a textual description of the error of our one choice.
    Our attempts to solve this includes adding error-page tags with error-code and exception-type:
    <error-page>
    <exception-type>javax.servlet.jsp.JspTagException</exception-type>
    <location>error.jsp</location>
    </error-page>
    <error-page>
    <exception-type>java.lang.Exception</exception-type>
    <location>error.jsp</location>
    </error-page>
    <error-page>
    <exception-type>oracle.jbo.JboException</exception-type>
    <location>error.jsp</location>
    </error-page>
    <error-page>
    <exception-type>oracle.jbo.DMLException</exception-type>
    <location>error.jsp</location>
    </error-page>
    <error-page>
    <exception-type>java.sql.SQLException</exception-type>
    <location>error.jsp</location>
    </error-page>
    <error-page>
    <error-code>500</error-code>
    <location>error.jsp</location>
    </error-page>
    Are there other ways to do this, or are there things we have forgotten to do, that has to be done for this solution to work.
    We have also tried try and catch in a variety of the lifecycle methods in the DataAction subclass for the page, but none of these are ever called. It seems the error happens before the first lifecyle method starts. We can't figure out where to catch this exception.
    In other cases the web.xml mechanism seems to work.

    Try the Global Exception Mechanism within Struts...

  • Redirect to a custom error page when Forms Server shuts down

    Hi,
    I want the forms application to redirect to a custom error page whenever Forms Server goes down. (like network issues, unscheduled shutdown...) Whenever this happens, the user gets a pop up with FRM messages and user has to acknowledge the pop up. Since the application is used in the shop floor, there will not be any user always in front of the screen and will be a very big issue as there are at least 70-80 PC's on the floor which will be attended fewer times(only when there is issue with the machine) other wise the application displays important events of the machine,etc.,
    I am trying to develop a simple HTML error page(may be with applet) which will keep querying the forms server and once the forms server is up and running, the error page will revert back to the application which the user was working earlier to shutdown. Other option is the redirect to main menu of the application (this may be a PSP or a JSP or a Oracle Forms Menu ).
    Is there any event in forms to capture the loss of connection to forms server ??
    BTW, I am using Oracle Application Server 10g Forms and Reports on Windows 2000 Server...
    Any ideas...
    Thanks in advance
    Purush

    I don't think it will be easily possible in Forms for a couple of reasons.
    1. In Forms you do not have query rights, and as soon as you want to edit data, you have to log in. In Forms you log in once, and this sets your rights for the whole session. You will have to do some programming in Forms to achieve what you want. E.g. as soon as you hit the Save button you are asked for a username and password.
    2. A refresh cannot be done in Forms. Remember that Forms is a Java applet. The URL in the browser is just pointing to the startup page only. If you refresh your screen, you are taken back to the login screen of Forms again.
    Well, there will probably be ways around these problems. I'm thinking in the line of calling every form in a separate URL instead of starting a Forms application where one form is called from another form. The default 'query only' form can be called from a startup html page. This page can be refreshed. As soon as the user wants to update data, he clicks on a link or button and is taken to a login form.
    If the refresh is unsuccessful you are taken to a custom error page, like in your ASP application.
    A problem with an automatich refresh may be hanging sessions. Forms server does not always kill sessions.
    And also, how would you avoid a refresh if a user is currently using the form?

  • JSON error when trying to redirect to another page in same application

    I'm trying to set up a PL/SQL dynamic action that is triggered by clicking on a button.  The dynamic action sets two values in a table and then I would like to redirect to another page.  Setting the values works fine.  The code is below:
    declare
    l_information varchar2(255) := :P94_FILENAME;
    BEGIN
    commit;
    UPDATE VDI_METADATA
    SET CREATEUSERLISTNAME = l_information,
        CREATEUSERLISTON = sysdate();
    commit;
    htp.init;
    owa_util.redirect_url('f?p=&APP_ID.:81:&APP_SESSION.::NO:::');
    END;
    The redirect fails with the following eror:
    "Error: parseerror: JSON.parse: unexpected non-whitespace character after JSON data"
    I've tried several approaches, using the suggestions in this forum on how to redirect to a page from within PL/SQL .  None of them result in success.
    Can anyone tell me: What is the system complaining about?  And is there a work-around?
    Thank you.

    John,
    I would recommend adding another true action in your dynamic action that executes javascript.  the logic would just be redirect('f?p=&APP_ID.:81:&APP_SESSION.::NO:::');
    Then remove everything after the commit in your pl/sql action.
    David

  • Unexpected error forwarding or redirecting to login page

    Hello Everybody!!
    I am having problem with JEE 5 update 3.
    after starting the server http://localhost:4848/ fails to open the login page .
    The log in >domain>domain1>log>server shows the following error
    Unexpected error forwarding or redirecting to login page
    java.lang.NoSuchMethodError: javax.servlet.ServletContext.getContextPath()Ljava/lang/String;
    Please help me .I have installed JEE 5 from java_ee_sdk-5_03-windows-nojdk.
    I am working on win XP and have jdk1.6.0 installed.
    please help.I am really getting irritated as i am stuck at this place for very long.
    Thanks in advance.

    Is there any body who can figure it out what i should do.
    Common plz help.

  • I click on link, for example story on ESPN I want to read, and I get redirected to another page, often ad site

    I own a MacBook Air.  On really any site I go to I click on a link and get redirected to another page, often an advertisement.  For example, I am on ESPN and want to click on a story, when I click on the link, a new page or tab opens up.  I have to x out to get to my story.  I use Google and Safari.  In Safari, I click on a story in ESPN and new page opens up as well.  Can any one help?

    There is no need to download anything to solve this problem. You may have installed a variant of the "VSearch" ad-injection malware. Follow Apple Support's instructions to remove it.
    If you have trouble following those instructions, see below.
    Malware is always changing to get around the defenses against it. This procedure works as of now, as far as I know. It may not work in the future. Anyone finding this comment a few days or more after it was posted should look for a more recent discussion, or start a new one.
    The VSearch malware tries to hide itself by varying the names of the files it installs. To remove it, you must first identify the naming pattern.
    Triple-click the line below on this page to select it, then copy the text to the Clipboard by pressing the key combination  command-C:
    /Library/LaunchDaemons
    In the Finder, select
              Go ▹ Go to Folder...
    from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.
    A folder named "LaunchDaemons" may open. Look inside it for two files with names of the form
              com.something.daemon.plist
    and
               com.something.helper.plist
    Here something is a variable string of characters, which can be different in each case. So far it has always been a string of letters without punctuation, such as "cloud," "dot," "highway," "submarine," or "trusteddownloads." Sometimes it's a meaningless string such as "e8dec5ae7fc75c28" rather than a word. Sometimes the string is "apple," and then you must be especially careful not to delete the wrong files, because many built-in OS X files have similar names.
    If you find these files, leave the LaunchDaemons folder open, and open the following folder in the same way:
    /Library/LaunchAgents
    In this folder, there may be a file named
              com.something.agent.plist
    where the string something is the same as before.
    If you feel confident that you've identified the above files, back up all data, then drag just those three files—nothing else—to the Trash. You may be prompted for your administrator login password. Close the Finder windows and restart the computer.
    Don't delete the "LaunchAgents" or "LaunchDaemons" folder or anything else inside either one.
    The malware is now permanently inactivated, as long as you never reinstall it. You can stop here if you like, or you can remove two remaining components for the sake of completeness.
    Open this folder:
    /Library/Application Support
    If it has a subfolder named just
               something
    where something is the same string you saw before, drag that subfolder to the Trash and close the window.
    Don't delete the "Application Support" folder or anything else inside it.
    Finally, in this folder:
    /System/Library/Frameworks
    there may an item named exactly
                v.framework
    It's actually a folder, though it has a different icon than usual. This item always has the above name; it doesn't vary. Drag it to the Trash and close the window.
    Don't delete the "Frameworks" folder or anything else inside it.
    If you didn't find the files or you're not sure about the identification, post what you found.
    If in doubt, or if you have no backups, change nothing at all.
    The trouble may have started when you downloaded and ran an application called "MPlayerX." That's the name of a legitimate free movie player, but the name is also used fraudulently to distribute VSearch. If there is an item with that name in the Applications folder, delete it, and if you wish, replace it with the genuine article from mplayerx.org.
    This trojan is often found on illegal websites that traffic in pirated content such as movies. If you, or anyone else who uses the computer, visit such sites and follow prompts to install software, you can expect more of the same, and worse, to follow. Never install any software that you downloaded from a bittorrent, or that was downloaded by someone else from an unknown source.
    In the Security & Privacy pane of System Preferences, select the General tab. The radio button marked Anywhere  should not be selected. If it is, click the lock icon to unlock the settings, then select one of the other buttons. After that, don't ignore a warning that you are about to run or install an application from an unknown developer.
    Then, still in System Preferences, open the App Store or Software Update pane and check the box marked
              Install system data files and security updates (OS X 10.10 or later)
    or
              Download updates automatically (OS X 10.9 or earlier)
    if it's not already checked.

  • Tab closes with no error msg when I click on "Allow". Msg: Firefox prevented this page from automatically redirecting to another page. I had to uncheck the Advance/General/Accessibility option for it to work. Why?

    Msg: Firefox prevented this page from automatically redirecting to another page. When I click on "Allow", The 2nd tab closes with no error msg This was Home Depot redirecting to CitiGroup.
    When I unchecked the Advance/General/Accessibility option to be notified of a "redirect" then things worked.
    Why did clicking on "Allow" not work?
    I posted step by step detail in the Trouble Shooting box below.

    Thank you for your answer. It does stop the redirection notices, but now I have no idea if potentially unsafe sites are redirecting me. I cannot figure out why it has only recently started to happen on my home page though, when nothing has changed on there and I've had it set to show redirections, ever since I set up Firefox.
    I guess I'll just have to make the decision as to whether I want to risk redirections or put up with the semi permanent notice.
    Thanks again mha007

  • Special error page redirection

    Hi everybody,
    When there's an end session or when Tomcat has been restarted, i have a java exception error page, which is norml. But how can i redirect to a special error page i have made instead of this java exception error ?
    Thank you very much !

    I add this comment to my error page because of a "feature" in Internet Explorer
    <!--
         DO NOT REMOVE see below.
         Internet Explorer has a feature "Show friendly HTTP error message" that causes
         application specific error page not to be show if the content is less than 512 bytes.
         This comment is here to inform the developer of the problem and to increase the content
         above 512 bytes. Do not remove this comment.
    -->

  • How to cancel the event in Item Adding and display javascript message and prevent the page from redirecting to the SharePoint Error Page?

    How to cancel the event in Item Adding without going to the SharePoint Error Page?
    Prevent duplicate item in a SharePoint List
    The following Event Handler code will prevent users from creating duplicate value in "Title" field.
    ItemAdding Event Handler
    public override void ItemAdding(SPItemEventProperties properties)
    base.ItemAdding(properties);
    if (properties.ListTitle.Equals("My List"))
    try
    using(SPSite thisSite = new SPSite(properties.WebUrl))
    SPWeb thisWeb = thisSite.OpenWeb();
    SPList list = thisWeb.Lists[properties.ListId];
    SPQuery query = new SPQuery();
    query.Query = @"<Where><Eq><FieldRef Name='Title' /><Value Type='Text'>" + properties.AfterProperties["Title"] + "</Value></Eq></Where>";
    SPListItemCollection listItem = list.GetItems(query);
    if (listItem.Count > 0)
    properties.Cancel = true;
    properties.ErrorMessage = "Item with this Name already exists. Please create a unique Name.";
    catch (Exception ex)
    PortalLog.LogString("Error occured in event ItemAdding(SPItemEventProperties properties)() @ AAA.BBB.PreventDuplicateItem class. Exception Message:" + ex.Message.ToString());
    throw new SPException("An error occured while processing the My List Feature. Please contact your Portal Administrator");
    Feature.xml
    <?xml version="1.0" encoding="utf-8"?>
    <Feature Id="1c2100ca-bad5-41f5-9707-7bf4edc08383"
    Title="Prevents Duplicate Item"
    Description="Prevents duplicate Name in the "My List" List"
    Version="12.0.0.0"
    Hidden="FALSE"
    Scope="Web"
    DefaultResourceFile="core"
    xmlns="http://schemas.microsoft.com/sharepoint/">
    <ElementManifests>
    <ElementManifest Location="elements.xml"/>
    </ElementManifests>
    </Feature>
    Element.xml
    <?xml version="1.0" encoding="utf-8" ?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <Receivers ListTemplateId="100">
    <Receiver>
    <Name>AddingEventHandler</Name>
    <Type>ItemAdding</Type>
    <SequenceNumber>10000</SequenceNumber>
    <Assembly>AAA.BBB, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8003cf0cbff32406</Assembly>
    <Class>AAA.BBB.PreventDuplicateItem</Class>
    <Data></Data>
    <Filter></Filter>
    </Receiver>
    </Receivers>
    </Elements>
    Below link explains adding the list events.
    http://www.dotnetspark.com/kb/1369-step-by-step-guide-to-list-events-handling.aspx
    Reference link:
    http://msdn.microsoft.com/en-us/library/ms437502(v=office.12).aspx
    http://msdn.microsoft.com/en-us/library/ff713710(v=office.12).aspx
    Amalaraja Fernando,
    SharePoint Architect
    Please Mark As Answer if my post solves your problem or Vote As Helpful if a post has been helpful for you. This post is provided "AS IS" with no warrenties and confers no rights.

    Recommended way for binding the list event handler to the list instance is through feature receivers.
    You need to create a feature file like the below sample
    <?xmlversion="1.0"encoding="utf-8"?>
    <Feature xmlns="http://schemas.microsoft.com/sharepoint/"
    Id="{20FF80BB-83D9-41bc-8FFA-E589067AF783}"
    Title="Installs MyFeatureReceiver"
    Description="Installs MyFeatureReceiver" Hidden="False" Version="1.0.0.0" Scope="Site"
    ReceiverClass="ClassLibrary1.MyFeatureReceiver"
    ReceiverAssembly="ClassLibrary1, Version=1.0.0.0, Culture=neutral,
    PublicKeyToken=6c5894e55cb0f391">
    </Feature>For registering/binding the list event handler to the list instance, use the below sample codeusing System;
    using Microsoft.SharePoint;
    namespace ClassLibrary1
        public class MyFeatureReceiver: SPFeatureReceiver
            public override void FeatureActivated(SPFeatureReceiverProperties properties)
                SPSite siteCollection = properties.Feature.Parent as SPSite;
                SPWeb site = siteCollection.AllWebs["Docs"];
                SPList list = site.Lists["MyList"];
                SPEventReceiverDefinition rd = list.EventReceivers.Add();
                rd.Name = "My Event Receiver";
                rd.Class = "ClassLibrary1.MyListEventReceiver1";
                rd.Assembly = "ClassLibrary1, Version=1.0.0.0, Culture=neutral,
                    PublicKeyToken=6c5894e55cb0f391";
                rd.Data = "My Event Receiver data";
                rd.Type = SPEventReceiverType.FieldAdding;
                rd.Update();
            public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
                SPSite sitecollection = properties.Feature.Parent as SPSite;
                SPWeb site = sitecollection.AllWebs["Docs"];
                SPList list = site.Lists["MyList"];
                foreach (SPEventReceiverDefinition rd in list.EventReceivers)
                    if (rd.Name == "My Event Receiver")
                        rd.Delete();
            public override void FeatureInstalled(SPFeatureReceiverProperties properties)
            public override void FeatureUninstalling(SPFeatureReceiverProperties properties)
    }Reference link: http://msdn.microsoft.com/en-us/library/ff713710(v=office.12).aspxOther ways of registering the list event handlers to the List instance are through code, stsadm commands and content types.
    Amalaraja Fernando,
    SharePoint Architect
    Please Mark As Answer if my post solves your problem or Vote As Helpful if a post has been helpful for you. This post is provided "AS IS" with no warrenties and confers no rights.

  • Error page redirection in tomcat 4.1

    Hi,
    I have error page directive in web.xml as follows
    <error-page>
    <exception-type>javax.servlet.ServletException</exception-type>
    <location>/jsp/system_error.jsp</location>
    </error-page>
    But tomcat wouldnt show up this page. But this very same application would work fine when I invoke tomcat using my netbeans IDE. wouldnt work with a standalone tomcat. any clues?

    Hi,
    Yes that's a bug/feature of tomcat 4.1. You need to declare a Logger in your tomcat server configuration file :
    <?xml version="1.0" encoding="UTF-8"?>
    <Server debug="0" port="8084" shutdown="SHUTDOWN">
      <Service name="Tomcat-Standalone">
        <Connector acceptCount="10" className="org.apache.coyote.tomcat4.CoyoteConnector" connectionTimeout="60000" debug="0" maxProcessors="75" minProcessors="5" port="8083"/>
        <Engine debug="0" defaultHost="localhost" name="Standalone">
          <Logger className="org.apache.catalina.logger.SystemOutLogger"/>
          <Host appBase="C:\Tomcat\webapps" debug="0" name="localhost" unpackWARs="true"/>
        </Engine>
      </Service>
    </Server>

  • Session Time Out and Redirect to login page - urgent

    My problem is I want to display alert message and redirect to the home page when session expires.
    Iam using TimeOutListener in my application as follows.
    public PhaseId getPhaseId() {
    return PhaseId.ANY_PHASE;
    public void beforePhase(PhaseEvent phaseEvent) {
         FacesContext facesContext = phaseEvent.getFacesContext();
    HttpSession sessionx = (HttpSession)facesContext.getExternalContext().getSession(false);
    if(sessionx == null) {
         FacesUtils.sessionCheck = true;
    String ampee = (String)((HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest()).getAttribute("ampee");
    if(ampee != null && ampee.equals("ampee")) FacesUtils.sessionCheck = false;
    if(phaseEvent.getPhaseId() == PhaseId.RENDER_RESPONSE) {
         if(FacesUtils.sessionCheck){
         facesContext.getApplication().getNavigationHandler().handleNavigation(facesContext, "", "sessionExpired" );
         FacesUtils.sessionCheck = false;
    ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
              HttpServletRequest request = (HttpServletRequest) externalContext.getRequest();
              HttpSession session = request.getSession();
              if (session.isNew()) {
                   try {
                   String errorPageURL = externalContext.getRequestContextPath() +
                   "/index.jsf?errorpage=true";
                   externalContext.redirect(errorPageURL);
                   }catch(Exception e){
                        e.printStackTrace();
    here i have appended param errorPage=true...
    in jsp page i have used following code to get the param<% if(request.getParameter(errorPage)!=null && request.getParameter(errorPage).equals("true")){%>
    <script>alert("session expired");</script>
    <%
    %>
    Can any one help me how to Implement this?
    Do u know another way pls let me know...

    Consider using the Javascript setTimeout() function in conjunction with HttpSession#getMaxInactiveInterval(). The HttpSession#getMaxInactiveInterval() returns the remaining seconds of the session lifetime.
    Basic example:<script>
        setTimeout("alert('The session will timeout after one minute.')", <%= (session.getMaxInactiveInterval() * 1000) - 60000 %>);
    </script>I've given the client one minute (60000ms) extra time space to respond accordingly.
    Use this in combination with the following head:
    <meta http-equiv="refresh" content="<%= session.getMaxInactiveInterval() %>;url=login.jsf">which will redirect to login.jsf if the session is timed out. You can also redirect to another page of your taste, e.g. error.jsf or so.

Maybe you are looking for

  • Reg.Stock transfer from Sale order into Production order

    Dear All We want to transfer the sale order stock in to production order. What I have to do ? Pls help me. Thanks Rajakumar.K

  • [cs4] [js] place images in a folder

    Hello, I'm sure this is pretty simple, but I can't manage to wrap my head around it... How do I place all images in a folder in an indesign document? I want to be able to simply run the script, select the folder, and have the all images placed in the

  • Objects in an Array

    I'm having trouble getting my objects into an array. The program compilies just fine, but when you run it, it just outputs all null values. //import necessary classes import java.util.Scanner; import java.io.File; import java.io.IOException; import j

  • Portal will not load in web browser

    Hello, I have a clustered portal and the second portal (<b>Ep6 SP2 Patch 29</b>) server in the cluster will not load in a web browser.  The portal appears to start correctly and joins the cluster with the other server but when you try to access it in

  • Export SQL View to Flat File with UTF-8 Encoding

    I've setup a package in SSIS to export a SQL view to a flat file and it's working fine.  I now need to make that flat file UTF-8 encoded.  The package executes but still shows the files as ANSI encoded. My package consists of a Source (SQL View) -> D