1

What is the cause of this exception, whats wrong with it? Thanks in Advance.

WARNING: No configuration found for the specified action: 'ActionAnnotation' in namespace: '/'. Form action defaulting to 'action' attribute's literal value.

HTML:

        <s:form action="ActionAnnotation" >            
            <s:submit  value="ActionAnnotation"/>
        </s:form>

Action :

@ResultPath(value="/")
@Result(name="success",location="differenactions.jsp")
public class ActionAnnotationAction extends ActionSupport{
    private String message;


    public String execute() {
        System.out.println("ActionAnnotation : Hello How are you execute() method got called.....");
        setMessage("ActionAnnotation : Hello How are you");
        return "success";

    }
Roman C
  • 49,761
  • 33
  • 66
  • 176
sunleo
  • 10,589
  • 35
  • 116
  • 196

1 Answers1

1

The following annotations needed

@Namespace("/")
@Action(value="ActionAnnotation", results=@Result(name="success", location="/differenactions.jsp"))
public class ActionAnnotationAction extends ActionSupport{
Roman C
  • 49,761
  • 33
  • 66
  • 176
  • Thanks for reply.Default namespace is ""(emptystring) then why we need add "/" ? – sunleo Dec 18 '13 at 17:07
  • and still am getting the same exception. – sunleo Dec 18 '13 at 17:13
  • The path is evaluated by adding namespace to action name and this should be absolute, if Struts didn't find a namespace from the action config it's trying to fallback to default namespace but default namespace doesn't have slash and it could be a problem. – Roman C Dec 18 '13 at 17:13
  • The @ParentPackage annotation also required if you are not configured it globally. – Roman C Dec 18 '13 at 17:16
  • am not adding any xml configuration , then I have to add parent package or what ? please let me know.Thanks for reply. – sunleo Dec 18 '13 at 17:19
  • You don't have to, until you don't need to define custom configuration. have you added convention plugin to the classpath? – Roman C Dec 18 '13 at 17:30
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/43440/discussion-between-sunleo-and-roman-c) – sunleo Dec 18 '13 at 17:31