• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

[Ask] Handle Wrong Actions?" Error Code 404 (Http Not Found)

 
Ranch Hand
Posts: 494
Eclipse IDE Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends..

how to handle the action which not configured?
example i just configure action for :
http://localhost:8080/MyApplication/MyPackage/new.action
http://localhost:8080/MyApplication/MyPackage/add.action

now what i have to do to handle wrong action?..
example anybody try to go to URL : http://localhost:8080/MyApplication/MyPackage/xyz.action

i have configure the error code in web.xml like this one :


but its doesn't work..

Thank's alot


 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://struts.apache.org/2.x/docs/unknown-handlers.html
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank's David ..

is it only used in Struts2 especially for 2.1++ version?..

if iam using Struts2 with version 2.0.12.. how to i configure it?..

i have made an error page which named error404.html.., i want to all of the UnknownAction will redirecting to error404.html..
and display it..

Thank's in advance David..
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Action default.

http://struts.apache.org/2.0.12/docs/action-configuration.html

It'd probably be worth your time to read through much of the documentation.
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Alright.. Thank's David for your reply.. :)

i have tried it before, and but we have to configure it in all packages..
and it will work if any action behind the "namespace" which we configured..

now how to handle UnknownError behind our "servlet context"?..
example i have configured package like this one :

and the application name is MyApplication..

when i go to the URL : http://localhost:8080/MyApplication/guest/someError.action (Wrong Action)
the error404.html can be displayed..

then.. i try to go to URL behind of servlet context which not of packages or actions..
example i go to URL : http://localhost:8080/MyApplication/test.action (Wrong Action)
and the error404.html can't be displayed.. :(

how to configure it?..

Thank's in advance David :) ...
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic