aspose file tools *
The moose likes JSP and the fly likes problem to call errorpage in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "problem to call errorpage in jsp" Watch "problem to call errorpage in jsp" New topic
Author

problem to call errorpage in jsp

Arun Maalik
Ranch Hand

Joined: Oct 25, 2005
Posts: 216
[code for jsp]

<%@ page language="java"%>
<%@ page errorPage="errorpage.jsp"%>
<%
String[] str={"Arun","Kumar","maalik"};
String str1=request.getParameter("script");
int n=Integer.parseInt(str1.trim());
out.println(str[n]);
%>
[/code]
-----------------------------------------------------------

[code for errorpage]

<%@ page isErrorPage="true"%>

<%=exception.getClass()%>
<%=exception.getMessage()%>

[/code]
------------------------------------------------
[code gor user input]
<html>
<body bgcolor=#87FFFF>
<form name="f1" action="test1.jsp">
<table>
<tr>
<td>Enter script number</td>
<td><input type=text name="script"></td>
</tr>

<tr>
<td><input type=submit value="OK"</td>
</tr>
</table>
</form>
</body>
</html>
[/code]
-----------------------------

Dear sir i have deployee all above three file within same context root. I am using the sun microsystem deployment tool.
As swon by code when i am sending array subscript 4 or 5 (any number except 0,1,2) it is not calling errorpage, can you tell me what wrong with my code. when i am sending number within array limit it is working fine. But when i am sending number out of limit browser showing error mesage as follow



The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed.

--------------------------------------------------------------------------------

Please try the following:

Open the localhost:8080 home page, and then look for links to the information you want.
Click the Refresh button, or try again later.

Click Search to look for information on the Internet.
You can also see a list of related sites.

HTTP 500 - Internal server error
Internet Explorer

what wrong with me sir? would you please tell me?

with regard

Arun kumar maalik
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

MSIE, by default, does not show you the error screen generated by the server.
It sees the 500 response code and shows you it's own page.

To disable this, go to Tools -> Options -> Advanced (tab), and uncheck the "Show Friendly HTTP Errors" checkbox. You might need to restart MSIE or Windows to get this to take.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Arun Maalik
Ranch Hand

Joined: Oct 25, 2005
Posts: 216
Thanks sir thank a lot.as you told me i did same work and it is working now.

thanks
Arun kumar maalik
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: problem to call errorpage in jsp