404 error code .. help plz

Hi all,
how can I catch the 404 errors in my jsp page to throw these excptions to My errorPage ??
I write in My home Page (index.jsp) to catch this error :
try {
// My code
} catch(FileNotFoundException ex) {
throw new FileNotFoundException("page not found");
and I write in the web.xml Page :
<web-app>
<display-name>Orange Whip Studios</display-name>
<description>JRun Web Application Construction Kit Demo</description>
<context-param>
<param-name>CompanyName</param-name>
<param-value>Orange Whip Studios</param-value>
</context-param>
<context-param>
<param-name>Datasource</param-name>
<param-value>ows</param-value>
</context-param>
<error-page>
<error-code>404</error-code>
<location>/errorPage.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/errorPage.jsp</location>
</error-page>
<error-page>
<exception>java.sql.Exception</exception>
<location>/errorPage.jsp</location>
</error-page>
</web-app>
the 500 error code and the java.sql.Exception work finally .. but the 404 error code didn't ??? can anyone tell me why????

You aren't forwarding the request to a JSP at any way. Use RequestDispatcher#forward() for that.
I also recommend to separate your logic. Use DAO class for the database logic. Use servlet class for the business logic and use JSP for the view logic. E.g.
// Process request parameters.
String username = request.getParameter("username");
String password = request.getParameter("password");
// Get User from DAO.
User user = yourUserDAO.loadUser(username, password);
// Check User.
if (user != null) {
    // User exist.
    request.getSession().setAttribute("user", user);
    request.setAttribute("isLoggedIn", Boolean.TRUE);
} else {
    // User doesn't exist.
    request.setAttribute("isLoggedIn", Boolean.FALSE);
// Forward request back to login JSP file.
request.getRequestDispatcher("login.jsp").forward(request, response);login.jsp:<p>Login ${isLoggedIn ? 'succesful' : 'failed'}</p>or use JSTL c:if / c:choose.
Besides, why don't you trust the database? You're querying the database for a single row matching the username and password. If it returns a row, then you're comparing the username and password once again in Java. Why?

Similar Messages

  • Inquiring minds may find this error code helpful: 0x207

    Hopefully I'm asking this in the right forum. I just downloaded the update for Microsoft Remote Desktop for Windows Phone 8.1 (I am actually running Denim on a 1520 but that may not matter). The version is 8.1.8.13 released 3/4/2015. I am trying to connect
    to a RemoteApp application but I am receiving the following error message shortly after it tries the redirection process (I think it fails at the securing remote connection part after it attemps the redirction to the RemoteApp application collection server):
    Connection error
    We couldn't connect to the remote PC. This might be due to an expired password. If this keeps happening, ask your admin or tech support for help.
    Inquiring minds may find this error code helpful: 0x207
    I am able to connect directly to both the broker server as well as the RemoteApp collection server with this application with the same credentials and am only experiencing this when trying to connect to a RemoteApp application.
    We are running Server 2012 R2 for both the broker/web and the collection servers. We are not using a gateway server as we use an SSL VPN concentrator instead for access outside of our network. We have server farms set up as well in the RemoteApp topology.
    Any info would help or let me know if I'm not posting in the right forum for this issue. I know this is a very recent release so I'm trying to figure out if I should wait for a bug fix or if there's something that I can do on my end.
    Thank you in advance for your time!

    Hi Scott,
    Please check your configuration once again and the certificate must be well configured. Also for accessing RemoteApp there might be the permission issue for your use, recheck once and verify. You can also got through
    this article for information.
    Hope it helps!
    Thanks.
    Dharmesh Solanki
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • I just had to buy a new computer because my "vintage" Mac died. after migrating my backup drive over my Adobe creative suite no longer wroks I get a 150:30 error code HELP!

    I just had to buy a new computer because my "vintage" Mac died. After migrating my backup drive over to my New mac book my Adobe CS no longer works. I get a 150:30 error code HELP!

    You need to reinstall it properly, not use migration.
    Mylenium

  • OSX DVD/CD Burner Error Code - HELP!

    Hey everyone. I hope someone might be able to help me out with a problem I am having.
    I just purchased a Plextor DVD/CD burner, and every time I put a blank in it, it gives me an error code (0x80020025). I thought it just might be my burner, but I tried to burn a disc with my buddy's Lacie, and had the same issue. The drive reads all discs fine, it just won't let me set it up to burn one.
    Can anyone help, please?! Thank you all so much.

    The drive is an external drive. It is a Plextor PX-740UF. I am running it with USB. Just to let you know, I had the same issue with my buddy's Lacie drive when I plugged it in.
    The drive recognizes everything BUT unburned discs. When I put one in and I try to open it in Finder, or in iTunes, it gives me that error code.
    I have also tried to do the force quit from Finder, and then re-launching, but this doesn't help either.
    Thanks for your help.

  • Trying to use Airport Extree in Time Capsule nned error code help

    I am a log time apple supporter but I have been messing with this since last night trying to get the @^#&# thing to work. I got conencted erlier to the internet now when i come back from dinner i can;t connect and and i get error code 6765. Earlier i got a message somethinga bout a bios but i did nto write it downa nd now can;t get it to produce it.
    Can;t they ever make anything that works the first time out of box for us older non techy guys.
    HELP
    Dan

    Thank you for your quick answer, smorkerz. However, I did it and it doesn't work.
    I tried to check separately the time capsule and the airport extreme, switching one off when using the other one. The result is that each one works alone but when I use them both, just time capsule appears, works well, and I can't use the airport to print for instance.
    Do you understand anything ?

  • Internal Update Server Error Code help

    Error code in FlashInstall.log 
    [warning] 1407 12044 vs [warning] 1403 12030
    I am trying to figure out why my internal update server wont connect past the certificate handshake. I can get it to work with a self signed certificate from the machine name but am trying to build a solution for my whole organization using our Root CA with a custom name for the particuler site.
    Any information would be helpful or suggestion for an alternative to using the internal update server since it is near impossible to troubleshoot when i have no idea what these warning codes mean.
    Thanks,
    Xenon

    Now i am getting these in my log but no update is being applied.
    2013-10-10+17-32-25.523 [info] 1628 adobeupdate.domain.net
    2013-10-10+17-32-25.527 [info] 1629 adobeupdate.domain.net
    2013-10-10+17-32-25.530 [info] 1614
    2013-10-10+17-32-25.534 [info] 1615
    2013-10-10+17-32-25.537 [info] 1618
    2013-10-10+17-32-25.542 [info] 1608
    2013-10-10+17-32-25.546 [info] 1612
    2013-10-10+17-32-25.550 [info] 1620
    2013-10-10+17-33-8.143 [info] 1628 adobeupdate.domain.net
    2013-10-10+17-33-8.147 [info] 1629 adobeupdate.domain.net
    2013-10-10+17-33-8.151 [info] 1614
    2013-10-10+17-33-8.154 [info] 1615
    2013-10-10+17-33-8.157 [info] 1618
    2013-10-10+17-33-8.162 [info] 1608
    2013-10-10+17-33-8.166 [info] 1612
    2013-10-10+17-33-8.171 [info] 1620
    2013-10-10+17-33-9.762 [info] 1628 adobeupdate.domain.net
    2013-10-10+17-33-9.767 [info] 1629 adobeupdate.domain.net
    2013-10-10+17-33-9.771 [info] 1614
    2013-10-10+17-33-9.774 [info] 1615
    2013-10-10+17-33-9.778 [info] 1618
    2013-10-10+17-33-9.782 [info] 1608
    2013-10-10+17-33-9.786 [info] 1612
    2013-10-10+17-33-9.790 [info] 1620
    2013-10-10+17-33-11.84 [info] 1628 adobeupdate.domain.net
    2013-10-10+17-33-11.88 [info] 1629 adobeupdate.domain.net
    2013-10-10+17-33-11.91 [info] 1614
    2013-10-10+17-33-11.94 [info] 1615
    2013-10-10+17-33-11.98 [info] 1618
    2013-10-10+17-33-11.102 [info] 1608
    2013-10-10+17-33-11.106 [info] 1612
    2013-10-10+17-33-11.123 [info] 1620

  • ERROR CODE HELP

    Hello everytime I try tpo restore my Iphone after the new update I keep getting this error code:
    A Error occurred while restoring this Iphone (-20)
    Itunes could not restore the IPhone (the name) because the backup was corrupt or not compaitable with the I phone that is being restored...
    I need all of my things I have no contacts notes or anyting.
    Please help.

    I'd suggest a clean re-install of iTunes & related applications:
    Go into Control Panel > Add/Remove Programs
    Remove these applications:
    1. Apple Software Update
    2. Apple Mobile Device Support
    3. iPod for Windows (this may or may not exist, either way, it's not needed so we can remove it)
    4. iTunes
    5. QuickTime
    Restart the computer
    Download & Install the Windows Installer Cleanup Utility:
    http://support.microsoft.com/kb/290301/
    Launch the Utility: Start > Programs > Windows Install Clean Up
    Select any of the above mentioned applications, and click Remove
    Restart the computer again
    Download & install iTunes again from here: http://www.apple.com/itunes/download/
    CG

  • Changing a 302 code to 404 error code

    Hi,
    I'm working on a web site that tries to handle errors typical 404 errors differently.
    If a user enters an incorrect url like http://domain.com/products/software/web_verver.html [note the incorrect spelling of file name], then instead of returning the normal 404 - page not found error, the request would be redirected to an app that can guess what url the user might really have wanted. It's uses fuzzy matching of sorts.
    This works fine - and will often send a sensible suggestion to the user.
    The problem is that it returns a 302 redirect code. We also have many delilberate redirects on the site. So with link checkers, I've no way of knowing if a 302 report is the result of a bad link request or a legitmate redirect. And it's very tedious to check.
    Q: Is it possible to have the jsp/servlet app set a 404 error in the http header instead of the 302 code? If so, how?
    Or is this a web server config issue?

    indeed. Unless you change the redirect to a forward which is executed serverside.
    In that case the response would be a 201 (success) and the client would never know he typed a bad URL (which is what you want...).
    If you run the site and want to log bad attempts the place to do it is the forwarding/redirecting servlet and not the response log.

  • Blue Screen and Error code help

    I got up for a few moments then come back to see my computer Blue Screened, first time ever for me. Its running win XP and is roughly 1 1\2 years old and i have no idea what even caused the blue screen much less how to fix it so it wont happen again
    The error code
    c:\DOCUME~1\0\Owner\Locals~1\Temp\WER309f.dir00\Mini072409-01.dmp
    c:\DOCUME~1\0\Owner\Locals~1\Temp\WER309f.dir00\sysdata.xml
    BCCode 10000007e
    BCP1 C00000005
    BCP2 000000000
    BCP3 EDEDDBB8
    BCP4 EDEDD8B4
    OSVer 5_1_2600
    SP 2_0
    Product 256_1

    Not 100% sure without looking at it honestly. If it happens again I would take it in to your local store for a diagnostic.
    Adam
    Best Buy Community - Retail, Americas
    Forum Guidelines | Terms & Conditions | Community Guidelines | Blogging Guidelines
    *Remember to mark your questions solved and click the star under the user's name to show your thanks!

  • PowerMac G4 Dual Optical [Error Code Help]

    [IMG]http://img251.imageshack.us/img251/8568/powermacg4mdd300x363.jpg[/IMG]
    I recently got rid of my old PowerMac G4 Dual Optical.
    It was a solid machine, never broke down, as I constantly maintained it for about 8 years, I only upgraded due to Intel (and some new apps I wanted to use).
    Fortunately, I found a good home for it, and I told the guy, what to do to maintain it, and to call me if he has an issue.
    Anyways, low and behold he now has an issue, in the form of a Error Code when he turns the machine on (See below).
    I've spoke to him over the phone, and walked him through resetting the Pram, and reinstalling the disks (start up and boot from the disk, while holding down cmd+C), but no joy.
    He said: "I managed to get onto the desktop again today but again it crashed with in a minute of being on it. It came up with the error message unable to find driver so I copied it down"
    Personally I think the internal Hard Drive has gone and needs to be replaced, but I could be wrong.
    If somebody can somebody please shed some light on this, as I'd be very grateful.
    Cheers,
    K.
    panic(cpu 0 caller 0x00373A34): “Unable to find driver for this platform: \”PowerMac3,6\”.\n”@/SourceCache/xnu/xnu-1228.15.4/iokit/kernel/IOPlatformExper t.cpp:1407
    Latest stack backtrace fo cpu 0:
    Backtrace:
    0x009CC88 0x0009D63C 0x00029DA0 0x00373A34 0x00348ED8 0x0034A02C 0x0034BEDC 0x0034AFFC 0x000B1DD4
    Proceeding back via exception chain:
    Exception state (sv=0xc8ca00)
    PC=0x00000000; MSR=0x0000D030; DAR 0x00000000; LR=0x00000000; R1=0x00000000; XCP=0x00000000 (Unknown)
    BSD process name corresponding to current thread: Unknown
    Mac OS version:
    Not yet set
    Kernel version
    Dawrwin Kernel Version 9.8.0: Wed Jul 15 16:57:01 PDT 2—9; root:xnu-1228.15.4~1/RELEASE_PPC
    System uptime in nanoseconds: 18699638756
    No debugger configured – dumping debug information
    MSR=00001030
    Latest stack backtrace for cpu 0:
    Backtrace:
    0x0009CC88 0x0009D7A8 0x00029DA0 0x00373A34 0x00348ED8 0x0034A02C 0x0034BEDC 0x0034AFFC 0x00B1DD4
    Proceeding back via exception chain:
    exception state (sv=0xc8ca00)
    PC=0x00000000; MSR=0x0000D030; DAR 0x00000000; LR=0x00000000; R1=0x00000000; XCP=0x00000000 (Unknown)
    BSD process name corresponding to current thread:Unknown
    panic: We are hanging here…

    Try a PMU reset.
    DALE

  • Source code help plz

    hi
    ineed help with source codes of undeniable digital signature implementation and subliminal channals...plz any1 help
    regards

    Stop crossposting!
    http://forum.java.sun.com/thread.jspa?threadID=575408

  • REALLY bizarre - 10210 stopped - replaced w/an 10810 error code - HELP?

    Absolutely BIZARRO! So frustrating - I have done everything except re-install SL - am reluctant to do that as I do not want to mess up BootCamp - I use AutoCAD extensively in my work - so need to run XP....
    The 10210 error message stopped - was replaced by 10810 message code - exact same results/process - system will not allow the initiation of a new program - must re-boot.....
    How come Apple is so MADDENINGLY non-involved in this question? It's plain not fair....
    GRRRRR!

    Clearly, I'm seen as a 'village idiot' in this pursuit......if I logged the HOURS of Google searches/hits I've chased down, and the myriad suggestions/solutions I HAVE followed up on - all to NO avail, you would be astounded.
    There is little else I can tell you about the problem....system just goes into 'lockdown' at an indeterminable point - I can continue with open programmes, but whenever I attempt to initiate a new program, it generates the message/code.......It is baffling to me that Apple has not seen fit to address this issue......based on all the message traffic out there, many, many others have the same issue - with no known solution as yet.
    If it helps, my system is a MacPro (2008), 6Gb RAM, 2.5 Tb HD space, an Apple Cinema Screen monitor + an HP 24" 2nd monitor....don't know what else I can tell you. BTW - if I'm in XP under Vmware, or in Bootcamp, no such problem occurs in the Windows environment.

  • CD Burn Error - need help plz

    My iBook is 3 yrs old now, and its worked flawlessy until about a month ago when I inserted a cd-r into the drive and it started making a grinding sound, very loud. Now it wont burn cds, gives me an error every time. Ive experienced this in iTunes, and Roxio Toast. The drive can read fine, and it imports ok most of the time, although the grinding sound is there when im importing as well. Im wondering what my options are. Any and all help is appreciated.

    Hi Becca:
    Just click on the little  in the upper left-hand corner, click ' About this Mac', More Info..and open your System Profiler. Under ATA you should se something like this:
    MATSHITA DVD-R UJ-825:
    Manufacturer: MATSHITA
    Model: MATSHITA DVD-R UJ-825
    Revision: DBN7
    Serial Number:
    ---> Drive Type: CD-RW/DVD-RW
    Disc Burning: Apple Supported/Shipped
    Removable Media: Yes
    Detachable Drive: No
    Protocol: ATAPI
    Unit Number: 0
    Socket Type: Internal
    That will tell you.
    Sue

  • Cant burn a CD off of itunes error (4000) help plz

    have already tried the other problems solutions suggested .. like slower x12 and going into computer thing to fix the problems .. any help here would be great thanls

    Could you post your diagnostics for us please?
    In iTunes, go "Help > Run Diagnostics". Uncheck the boxes other than DVD/CD tests, as per the following screenshot:
    ... and click "Next".
    When you get through to the final screen:
    ... click the "Copy to Clipboard" button and paste the diagnostics into a reply here.

  • SharePoint Workflow HTTP 404 Error

    Hey guys,
    I'm testing the functionality of workflow manager 1.0 on my SP 2013 SP1 environment. Both installed at the same Windows Server 2012 Standard.
    I'm able to create and publish a WF using SP designer but when I tested it I got the following error message and status 'Suspended':
    RequestorId: e3e4be0c-8745-2ea6-0000-000000000000. Details: An unhandled exception occurred during the execution of the workflow instance. Exception details: System.ApplicationException: HTTP 404 {"Transfer-Encoding":["chunked"],"X-SharePointHealthScore":["0"],"SPClientServiceRequestDuration":["21"],"SPRequestGuid":["e3e4be0c-8745-2ea6-92a6-b85c9ebf4f31"],"request-id":["e3e4be0c-8745-2ea6-92a6-b85c9ebf4f31"],"X-FRAME-OPTIONS":["SAMEORIGIN"],"MicrosoftSharePointTeamServices":["15.0.0.4617"],"X-Content-Type-Options":["nosniff"],"X-MS-InvokeApp":["1;
    RequireReadOnly"],"Cache-Control":["max-age=0, private"],"Date":["Tue, 18 Nov 2014 13:25:49 GMT"],"Server":["Microsoft-IIS\/8.0"],"X-AspNet-Version":["4.0.30319"],"X-Powered-By":["ASP.NET"]}
    at Microsoft.Activities.Hosting.Runtime.Subroutine.SubroutineChild.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor
    executor, BookmarkManager bookmarkManager, Location resultLocation)
    Although that message makes no sense to me I can see a HTTP 404 error code but I can't identify what cause that problem!
    In SP log file I can't find any information related to my problem mainly because the file also has events from other services of SP as it is a production environment...it's just too complicated. Also I'm not sure of what to look for in there
    Has anyone ever went through this issue and solved it? Or could anyone help me to find a way to solve it?

    try this:
    1- Create normal user account grant it permission to the site where you will create workflow.
    2- Make sure that you have User Profile Synchronization run and all user profiles are imported
    3-when you create workflow, log with different account than the farm account, normal user that you grant access to the site, then recreate the workflow by this account.
    4- log to the site with the user that you created and create the workflow by using this account.
    Kind Regards,
    John Naguib
    Technical Consultant/Architect
    MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation
    Please remember to mark your question as answered if this solves your problem

Maybe you are looking for