• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • 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


 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • 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
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • 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 Java Postgres Database
  • Mark post as helpful
  • send pies
  • 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 :) ...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic