Generating error page(in jsp) when session expires....
hello,
i want to generate error page(in jsp) when session get expires...
plz help me out.............
You could do it according to the line BalusC supplied in another topic:
<meta http-equiv="refresh" content="<%= session.getMaxInactiveInterval() %>;url=login.jsp">The only thing you gotta change, is the URL, make it:
<meta http-equiv="refresh" content="<%= session.getMaxInactiveInterval() %>;url=error.jsp">Create 'error.jsp' and have the message 'Session expired, sorry!' or something printed. If you want to use error.jsp for more than just the session expiration, add a parameter to it:
<meta http-equiv="refresh" content="<%= session.getMaxInactiveInterval() %>;url=error.jsp?error=sessionexpired"> Place the following lines in your error.jsp:
String errormessage = request.getParameter("error");
if(errormessage.equals("sessionexpired")){
out.println("Your session has expired, sorry!");
}else if(errormessage.equals("whatever")){
// To do code here.
}
Similar Messages
-
Error Page in JSP Having Problems.
Hi all,
I am having some issues with error pages in JSP.
I am trying to display one simple error image when my JSP is having any kind of error, lets say when it throws any exception. Here goes the code
throwError.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ page errorPage="errorPage.jsp" %>
<html>
<body>
Hello All,
<%! int x = 12/0; %>
</body>
</html>errorPage.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ page isErrorPage="true" %>
<html>
<body>
<img src="error.jpg" height="100" width="100">
</body>
</html>web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" 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">
<error-page>
<error-code>500</error-code>
<location>/errorPage.jsp</location>
</error-page>
<error-page>
<exception-type>java.lang.ArithmeticException</exception-type>
<location>/errorPage.jsp</location>
</error-page>
</web-app>Please see if you can help
Currently when I run the throwError.jsp in Eclipse, nothing happens. It shows "500 Internal server error". But the error.jpg doesn't appear on browser. I have copied the error.jpg properly in the WebContent folder of the Web App root.
Thanks much...
GoldestRaghu,
You need to fix your syntax:
<%=someObje.getNo()>
not
<=someObje.getNo()>
Your concept of how to use error.jsp seems correct.
--BobC -
Graceful logout page when session expires.
Dear SDN community,
When the session is timed out, the WD application displays a message : "
The webdynpro application has expired.Restart the application using the application or the following link...". Is there way to catch the session time out and throw a graceful logout page.
Thanks!Hi
You can make a custom error page as suggested in this link.
[http://help.sap.com/saphelp_nw2004s/helpdata/en/9a/e74d426332bd30e10000000a155106/frameset.htm]
Thanks
Puneet -
Which seeded page is called when session timeout happens
Hi All,
Our requirement is to route to custom page when session timeout happens. We are working on R11.
Any suggestions which seeded JSP/JAVA file is called when we try to access application after session time out ?
How to route to custom page when session timeout happens ?
Thanks in advance.
Regards,
S.K.Hi Sk;
Please check below and see its helpful for your issue,similar topic discussed before here,
EBS connection time out
Re: ICX : Session Timeout
Forms session timeout
Also check:
http://www.solutionbeacon.com/best7.htm
Hope it helps
Regard
Helios -
Question about redirecting user when session expires
I have several pages that get and post variables sent to
them. Is it possible to retain these values when the user's session
expires? I want to be able to have the user re-log into the system
and then have them redirected back to the page they were just on
and preserver the get and post variables so that the data on the
page can be rendered back to themis there anyway to manipulate the headers and store the
information there and still have it accessible if the session were
to time out? -
Determining when session expires
I want to be able to track the amount of time that the user spends on my site. I am going to insert a record into a database when the user logs on. I also want to insert a record when the user's session expires either from timing out or closing the browser window or leaving my site. Is it possible to determine when a user's session ends, particularly when it ends via the last two ways.
Thanks!First, you can use a javax.servlet.http.HttpSessionBindingListener object put into the session as an attribute and implement the valueUnbound() method to do the database update. This will be called when you invalidate the session (unless you remove the attribute manually first).
So the problem is when will the session be invalidated..... There are really 4 things you are looking for:
1) session times out
2) user logs out (assuming you provide a log out link that invalidates the session)
3) browser closes
4) user leaves site (I assume you mean just goes to some other site in the same browser window)
1 and 2 are okay, cuz it invalidates the session and calls the valueUnbound method of the object you create as mentioned above.
For 3 and 4, you can do this in one of 2 ways:
A) Use frames in your web pages and in the top window, you can have a Javascript call some logout page. However, I'm not convinced that this will work in all situations.
B) Have an applet in the pages that does something to keep the connection alive. This requires an applet and a JVM in the client to run it. Probably not a good thing to rely on for public sites.
So really, there is no foolproof or simple way to handle 3 and 4, except to use session timeouts and rely on that. -
How to show an error Page in Weblogic when the server is down
Hi ,
I heard that every container has the facility to show an error page when the server is down and (when the request has arrived at that time ).
Please tell me how to configure this in BEA weblogic ??
Thanks .Hi,
From my understanding weblogic dose not provide the thing which you are asking for, reason is given below.
- An application is deployed only on managed server one (MS-1)
- Now if the request comes to the server (MS-1) when it was running and then for some reason MS-1 goes down then weblogic server would be able to send any response back to the client as its down.
- Hence nothing can be done as the request object is been lost when the server goes down or even cant redirect to an error page as for doing that too the server has to be up and running.
However there are other way round which can help you overcome this issue as shown below
- Use Clusters with few managed servers in it which gives you high availability and load-balancing.
- Use any web servers like Apache in front of weblogic servers.
Using the above things you can also use customized HTTP Error Responses with error-page element in web.xml and create your own error pages which can be re-directed for the web server side also. For more information go through the below links
Topic: Customizing HTTP Error Responses
http://download.oracle.com/docs/cd/E13222_01/wls/docs92/webapp/configurejsp.html#wp157884
Topic: error-page
http://download.oracle.com/docs/cd/E13222_01/wls/docs81/webapp/web_xml.html#1017571
Topic: ErrorPage
http://download.oracle.com/docs/cd/E12840_01/wls/docs103/plugins/plugin_params.html#wp1155425
Hope above information helps you.
Regards,
Ravish -
How to forward automatically when session expires ?
Hi Techies,
whenever session expires , I want my struts action to forward to logout page automatically.
I know we can do it by implementing sessionlistener(session destroyed method).
But how to forward using action mapping .
any solution is appreciated.
Thanks,
shekarHI,
the other method for this is be prepared from the start
of making of the project make an action class that
extends
org.apache.struts.action.Action
class
check all such type of thing ie the session and redirect to global forwards
logout page
and other required things
always extend this ur own made action class
so that it has all functionality of the struts action
and ur own vlaidation too -
hi all,
i'm trying to find a way to catch when a session expires in oracle database but i don't know how.
can anyone give suggestions on how i can accomplish this?
thanks
allenNot sure you can do this and guarantee it, the usual would be to check a column in v$session periodically via a scheduled job , but doesn't PMON kick in and clean it up at intervals, thus making it unsure
perhaps a logoff trigger to fire ? -
Rdirect to another URL when session expires
public class sessionManager implements HttpSessionListener {
public void sessionCreated(HttpSessionEvent se) {
public void sessionDestroyed(HttpSessionEvent se) {
In this class for the sessionDestroyed() function i want to write RequestDispatcher .. so that i can redirect or forward my request to another URL so that i can delete my object that r present in ServletContext.
because for requestDispatcher i need to implement HttpServlet
which overrides service method ( doGet()/doPost()).which receives HttpServletRequest/HttpServletResponse object ...
Plz let me know if possible .... the main thing is that i want to go to that particular URL for delting my objects
any Plz let me knowAnd if the session expires because the user closed the browser how are you going to redirect him? You can not use the requestDispatcher in the HttpSessionListener because the session will expire because it doesn' have a request.
-
How to show error page in browser when Column cant be null
Hello everyone,
I've got a Record Insertion Form, and some of the fields are
set as "NOT NULL". When I miss out a few fields, the browser shows
the text - Column 'propertytype' cannot be null, which is fine, as
it cannot be null. But how do I redirect this to a user friendly
page which basically says, "sorry you havent written in all the
fields, please go back". How do I do this in dreamweaver?
Thank YouYou need to validate all user input prior to executing any
sql statement. That will do it. There are also techniques to trap
error messages, which vary depending on the scripting language you
are using. -
How to disable asking password when session expires
Hi,
When the session is timed out, I want application should automatically turned on when I click on alert/message box.
Please suggest me in what way I can do this.
Thanks in Advance!!!
Regards
Madhu KumarHi,
This is an expected behavior and you cannot let the user login again without entering the username/password.
One possible solution would be increasing the session timeout.
Note: 269884.1 - How To Fix The Forms Timeout Issue In Oracle Applications 11i
https://metalink2.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=269884.1
Regards,
Hussein -
Fireworks generated HTML page breaking apart when text resized
What's the best way to prevent the Fireworks generated slice
gifs from breaking apart when a browser increases the text size in
IE?#nav li {
list-style:none; }
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"AndyBute" <[email protected]> wrote in
message
news:ef5jb5$8hc$[email protected]..
> Hi,
> Thanks for the suggestions. I've rewritten the site
using a DIV layout in
> CSS.
> On small tjing that has cropped up is that I can't
remove the bullet
> images on
> my menu. Take a look at the site at
http://www.360iview.co.uk
> The bullet images are crampimg the already tight space
on the menu.
> Can you see where the problem is
>
> Thanks
>
> Andy
>
> Here's the CSS and XHTML code:
>
>
> #nav {
> list-style-image:none;
> position: absolute;
> top: 295px;
> left: 679px;
> width: 120px;
> }
> .menu a:link, .menu a:visited, .menu a:active {
> color: #FFFFFF;
> text-decoration: none;
> font-family: Verdana, Arial, Helvetica, sans-serif;
> font-variant: none;
> font-size: 12px;
> font-weight: bold;
> }
> .menu a:hover {
> color: #FF6600;
> text-decoration: none;
> }
>
>
> <div id="nav" class="menu">
> <?php page_menu(); ?></div>
> -
Error page shows up when I click download adblock
When I try to download ad block this pops up. (Error code: sec_error_ocsp_future_response)
What do I do?Make sure your computer's date and time are accurate.
* http://windows.microsoft.com/en-us/windows/set-clock -
please please help
as i really need my phone for the internet.
ThanksYou put the machine name as the host name. I would put the (internal) network address of the laptop there and try again - and make sure that Oracle is actually listening on your internal network address in stead of only the localhost. Or are you running the java application on the same laptop? Then you can simply use 'localhost' as the host name.
Maybe you are looking for
-
hi all, i have transported the infoset , user group and query in the production server from the test server through the download/upload feature of report RSAQR3TR all of the above infoset , query , user grp are transported properly. but when i am exe
-
Shared review PDFs - email invitation
We switched from Lotus Notes to Outlook a few months ago. Now when I create a shared review PDF, it asks me where to send the invitation to. I type in my Outlook e-mail address, but it then asks me to log in to Lotus Notes. I enter my Lotus Notes e-m
-
Visa write unsuccessf​ully
Hi there, Currently i integrate the ft232r usb uart ic chip with labview platform. I am conducting a basic test to check if the chip can communicate well with labview. The chip is set to send a feedback signal once it successfully recieve the comman
-
I would like to rename my report server that I see listed in OEM. I was reading the documentation on forms/reports integration and it states that there cannot be an underscore in the report server name. My report server does have an underscore. I wou
-
The audio book icon disappeared
I have 2 related problems. First, the audio book icon disappeared from my iPod nano. Second, when I add audio books to my iPod using iTunes (even when I had the audio book icon) it puts the audio books in with music and then the books won't play in