• 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

Avoiding "there is no Action" errors

 
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I

I was just wondering, is there a standard configurable (or coding if in fact it can e done) way of avoiding the horrid Struts error



When your user enters a URL/Action that does not exist?

So they get reirected to a nice 404 error or something rather than the nasty "Oh my god the sites crashed" type error that a standard user wouldn't probably understand.

Cheers
 
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Whenever we hit url in the browser struts filter search's respective action using actionMapping to execute the action. So now user is modified the class name so it couldn't found any action to execute it such cases we can tell if no action is found execute default action. And do whatever you want to do in the default action as per your business requirements. or else you can modify the default error pages in server which is bad approach i feel.


<default-action-ref name="defaultAction" />

<action name="defaultAction" class="com.yourcompany.DefaultAction">
<result name="success">/underconstruction.jsp</result>
</action>
 
Ranch Hand
Posts: 188
Hibernate Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Kev Bellion,
i do agree with Mohana Rao,
i generally follow this approach, for your help here is the documentation link.
http://struts.apache.org/2.2.3.1/docs/action-configuration.html#ActionConfiguration-ActionDefault
hope this would help you.
reply
    Bookmark Topic Watch Topic
  • New Topic