Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2007

Tip: Looking for answers? Try searching our database.

Help with custom error-page in Spring

Thread view: 
ballpointpenthief - 25 Nov 2007 15:07 GMT
Hello,
I've not been able to set-up a custom error page, and I haven't found
the reason for the problem.

The application is using Spring, and I am declaring an <error-page> in
the web.xml file for a 404 page.
The directive is in the correct place and the custom page exists, yet
a blank page is returned rather than my custom page.

Google turns up nothing; can anyone shed any light as to why I am
seeing a blank page rather than my custom 404 page?

Thanks,
Matt.
Manish Pandit - 25 Nov 2007 20:55 GMT
On Nov 25, 7:07 am, ballpointpenthief <ballpointpenth...@yahoo.co.uk>
wrote:
> Hello,
> I've not been able to set-up a custom error page, and I haven't found
[quoted text clipped - 10 lines]
> Thanks,
> Matt.

Can you paste the declaration ? To give you an idea, here is the one
that works for me.

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

Make sure the path has a leading /.

-cheers,
Manish
ballpointpenthief - 26 Nov 2007 08:40 GMT
> On Nov 25, 7:07 am, ballpointpenthief <ballpointpenth...@yahoo.co.uk>
> wrote:

> > The directive is in the correct place and the custom page exists, yet
> > a blank page is returned rather than my custom page.

> Can you paste the declaration ? To give you an idea, here is the one
> that works for me.
[quoted text clipped - 3 lines]
>                 <location>/notfound.jsp</location>
>         </error-page>

I tried exactly that example, and put a /notfound.jsp in the web
folder.
The declaration is placed at the end of <web-app>, and after the
<welcome-file-list>. I'm still getting a blank page, with no source.
Could something be clobbering it?

Thanks,
Matt
ballpointpenthief - 26 Nov 2007 09:45 GMT
On Nov 26, 8:40 am, ballpointpenthief <ballpointpenth...@yahoo.co.uk>
wrote:

> > On Nov 25, 7:07 am, ballpointpenthief <ballpointpenth...@yahoo.co.uk>
> > wrote:
[quoted text clipped - 16 lines]
> Thanks,
> Matt

Sorted now. There was a gap in my knowledge of the servlet-mappings.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.