How to Send particular error to another page in Servlet from web.xml

How to Send particular error to another page in Servlet from web.xml

How to Send particular error to another page in Servlet from web.xml

View Answers

October 5, 2011 at 1:09 PM

Hi you can forward particular error from web.xml file as

<error-page>
    <error-code>404</error-code>
    <location>404Error.jsp</location>
</error-page>

You can also send error from Servlet as

response.sendError(404, "Resource Nor Found");

When an error related to 404 occurs the page 404Error.jsp will be called automatically









Related Tutorials/Questions & Answers:
How to Send particular error to another page in Servlet from web.xml
How to Send particular error to another page in Servlet from web.xml  How to Send particular error to another page in Servlet from web.xml   Hi you can forward particular error from web.xml file as <error-page>
how to send sms from my website to mobile of particular user.
how to send sms from my website to mobile of particular user.  i had created a website and aim of pjt is whoever the client register for site..... so can u tell the process and how to implemnt this using java
Advertisements
how can i send a mail to a particular user from a many user dropdown list in jsp
how can i send a mail to a particular user from a many user dropdown list in jsp  how can i a sent a user question to a particular person from a drop down list in jsp
How to send boolean array to servlet from java application?
How to send boolean array to servlet from java application?  Hi, I want to send randomly generated array of boolean values. I used Random function and boolean array length to generate values. My question is I want to send
how can we pass parameters from jsp href to another servlet
how can we pass parameters from jsp href to another servlet  how can we pass parameters from jsp href to another servlet
how to pass an array from one jsp to another jsp - JSP-Servlet
how to pass an array from one jsp to another jsp  hi friedns, can any One tell me how to send an array from one jsp to another jsp,pls any one send the code for this.also porvid the code how to retrive the arry in another jsp
How do I throw a 404 error from within a java servlet?
How do I throw a 404 error from within a java servlet?  How you can write code in Servlet for throwing the httpd error 404? How to add the configuration for handling the not found error in the web.xml file? Thanks   
Send Email From JSP & Servlet
J2EE Tutorial - Send Email From JSP & Servlet... As for sending mail from webserver, using JavaMail API, the following code shows how the required data such as 'from', 'to', 'subject' and 'message
regarding web.xml - JSP-Servlet
regarding web.xml  I am the java beginner, please send the web.xml code and how to run a servlet for apache5.0.... my problem is in tomcat manager am getting the message 'fail' in web.xml  Hello,Please check the tomcat
How to use web.xml in Servlet 3.0
How to use web.xml in Servlet 3.0 In this tutorial you will learn how to use web.xml in Servlet 3.0. Here I am giving the simple example of a Servlet in which I make a simple servlet class using @WebServlet annotaion into which
How to send mail - JSP-Servlet
How to send mail  Thanks a lot ODBC is cleared to me now. Now,have another query about how we can send mail by using jsp. Actually i want to make a web page for a user feedback ,it must be send to our mail id
How to send the data selected from drop down menu from html page to sql 2005 database.
How to send the data selected from drop down menu from html page to sql 2005... by user from html drop down menu such as check-in date for hotel reservation system ,how can I save these data in database and how to retrieve later .Thanks
how to pass arraylist data from one jsp to another jsp - JSP-Servlet
how to pass arraylist data from one jsp to another jsp  hi to all iam... the following >XXX/ ? is required to send a value from one jsp to another... to receive all employee id's that are retrived from the database in the first jsp
How to send data by ajax to servlet? - Ajax
How to send data by ajax to servlet?  Hi, Can i send a value from a HTML file to servlet via Ajax? If it is possible please give me a sample code Thanks
How can I call a Servlet that is declare on web.xml with spring framework
How can I call a Servlet that is declare on web.xml with spring framework ... is declare on web.xml, but the spring dispacher don't find it so how I can make spring dispacher to call a servlet that is declare on my Web.xml here is my
Populate values from html to another html
Populate values from html to another html In this tutorial, you will learn how to send values from one html page to another. Here, we have create a html... on another html page. page1.html: <html> <form type=get action="
passing from 1 jsp to another - JSP-Servlet
passing from 1 jsp to another  Hi Sir, What are the ways and means of passing from 1 jsp page to another page.what are the different types of methods?  Hi Friend, You can use tag,sedRedirect() method
how to insert the bulk data into the data base from the table of jsp page to another jsp page
how to insert the bulk data into the data base from the table of jsp page to another jsp page  pls help i'm doing the project called centralized... and i have to insert the mark for n number student in the table i don't how
how to send a mail - JSP-Servlet
how to send a mail  Dear sir, I am able to send a mail.But... public String sendMailWithAttachment(String from, String to, String ccList... how to get a matter as it is what am sending..please help me sir if any changes
web.xml - servlet - Java Beginners
application. I was suggested to use tag in the web.xml file to run that servlet...web.xml - servlet  Hi All, In my web application, I have one servlet that has to run automatically when ever I start my web application
JSP error page - JSP-Servlet
JSP error page  Hi i have 1000 of JSP. but we coded it without adding the . but now i have to forward the page to the specific page when... or web.xml is good. but thoes are trigged only when the exception thrown in the action
How to pass parametes from JSP page to HTML page? - JSP-Servlet
How to pass parametes from JSP page to HTML page?  Hi all, In my project I have one JSP page and one HTML page. In JSP page I have created HTML... to pass the values from my JSP page to HTML page. Pls help me out. Hitendra 
Loading a jsp page (with record from database) from another jsp page
Loading a jsp page (with record from database) from another jsp page  ... with records from database(against Serial no and year).That is, as soon as Getdata.jsp will be loaded, it will show the first record. How can I do
How to make a servlet to automatically call another servlet at some time instant.
How to make a servlet to automatically call another servlet at some time instant.  Can some one assist me How to make a servlet to automatically call another servlet at some time instant. currently I have a single servlet which
calling one jsp from another jsp page
calling one jsp from another jsp page  need coding for calling one jsp from another jsp including the xml file.Its urgent
How to display Jfreechart from servlet in jsp web page at specified location
How to display Jfreechart from servlet in jsp web page at specified... to display the chart in web page. I generated the chart using Jfreechart in Servlet which is in image format.plz sir give me the code to display this chart
Calling a jsp page from Servlet
Calling a jsp page from Servlet  How can I do this? Suppose I have jsp page aaa.jsp. From aaa.jsp on form action I have made a call to a servlet... List and data is being retrieve. Now I want to pass this List to another jsp page
how to call servlet from html page at anchor tag ?
how to call servlet from html page at anchor tag ?  I have a very... to other page and at that place i give url of a servlet but in server that url... it is not working properly. I split and merge template. In the header part of my page i use
how to send html email from dreamweaver
how to send html email from dreamweaver  how to send html email from dreamweaver
to bring checked data from one page to another
to bring checked data from one page to another  thanks for your help... jsp page which is connected with servlet at the back and through which i am fetching data from the database on second jsp page with checkbox corresponding each
calling one jap page from another jsp page
calling one jap page from another jsp page  i created a button in one jsp page i need to call another jsp page as an action to that button. so how can i call.. plz any one explain. its urgent
web.xml deployment descriptor - JSP-Servlet
web.xml deployment descriptor  Pls guide about how to write the web.xml file to deploy our web applications that uses JSP, by using tomcat... ... servlet into web.xml file.<!-- Hello World Servlet --><servlet> <
Why <servlet-name> use in web.xml - JSP-Servlet
Why <servlet-name> use in web.xml  WHY DO WE USE THE <SERVLET-NAME>TAG IN WEB.XML APPLCATION   WHY DO WE USE THE <SERVLET-NAME>TAG IN WEB.XML APPLCATION AND HOW A simple program of using <servlet
loacation of errorpage in web.xml for 404 error
loacation of errorpage in web.xml for 404 error   The webpage cannot be found HTTP 404 Most likely causes: â?˘There might be a typing error... can try: Retype the address. Go back to the previous page. Go
how to add Arraylist filter for a jsp page showing results from a servlet
how to add Arraylist filter for a jsp page showing results from a servlet ... page table of given contents of database, i want to add a filter to it to show only the matched contents from list, the table which is coming out
can u plz help out how to attach file directly & send to a particular mail id
can u plz help out how to attach file directly & send to a particular mail... mini project so if a faculty write all details abt leave & shd send to HOD for approval so i need ur guidance how to tackle this problem
How to send URL in Post request from local server to remote server?
How to send URL in Post request from local server to remote server?  I am having currently a Portal client(created using JSP and Servlet) and Portal... to another server remotely?What to do in code??? 2> How to send a Post Request
send email with attachments in servlet
send email with attachments in servlet  How can we send an email with attachments in servlet?   Send attached email in Java Servlet
how to write to java program to get the particular data from the website
how to write to java program to get the particular data from the website   i have to get the particular data by selecting the just numbers.. from the site .. how to get the ful details from the website by clicking the number
how to retreive data from database of a particular user after login
how to retreive data from database of a particular user after login  sir am doing project in ASP.NET useful for my college that is placement portal...please help in display details of particular student after he login ...i want
how to retreive data from database of a particular user after login
how to retreive data from database of a particular user after login  ... the user information.. now their is a login and registration page for newuser. after the user has filled the form he should go to the welcome page where he
How to redirect from a HTML page?
How to redirect from a HTML page?  Hi, Is it possible to redirect from HTML page to another page on the net? I have one page and I want to redirect it to another page. What will be the code for redirecting the page to another
How to Configure Spring in web.xml file ?
How to Configure Spring in web.xml file ?  How to Configure Spring in web.xml file ?   Hi you need to map the DispatcherServlet in web.xml as <servlet> <servlet-name>dispatcherServlet<
Assembling web.xml from fragments
This section contains detailed description on assembling web.xml from web fragments with an example
How to get the focus from a particular textarea for some action?
How to get the focus from a particular textarea for some action?  Hi All, I have created one small swing applications with two textarea. I want... in textarea-1... Can somebody please tell me ..How to find a component which had
How to retrive a particular record from database in php with mysql?
How to retrive a particular record from database in php with mysql?  Am using phpMyAdmin Database.In mysql database having 10 records. The field... record based on username and password. I dont know how to retrive in php with mysql
calling one jsp from another jsp - JSP-Servlet
calling one jsp from another jsp  Hi All, In my web application... in two.jsp by using jsp declarative tag. Now from one.jsp file I want to call... start from where we call this two.jsp files method. i.e. in one.jsp file at line
SERVLET ERROR
an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: Error instantiating servlet class ServletDemo... in web.xml: <servlet> <servlet-name>ServletDemo</servlet-name>
how to send email please give me details with code in jsp,servlet
how to send email please give me details with code in jsp,servlet  how to send email please give me details with code in jsp,servlet
how to text send from list to textbox - Swing AWT
how to text send from list to textbox  dear sir/madam I whant to send text from list to textbox. plz give me solution for this problem.  ... the technology you have used like JSP/Servlet/Struts/JSF etc.. Thanks

Ads