struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Milos Negovanovic <milos.negovano...@googlemail.com>
Subject configuring json action
Date Mon, 14 Dec 2009 21:31:02 GMT
Hi,

I am trying to get JSON response from struts2 action.


My struts.xml contains the fallowing:

<struts>
  <package name="example" extends="json-default">
    <action name="testjson" class="tutorial.example.JSONAction">
      <result type="json" />
    </action>
  </package>
</struts>


Class JSONAction.java is empty at the moment:


package tutorial.example;


import com.opensymphony.xwork2.ActionSupport;


public class JSONAction extends ActionSupport {
    public String execute() throws Exception {
        //setMessage(getText(MESSAGE));
        return SUCCESS;
    }
}


When I try to access JSON action under
http://localhost:8080/tutorial/testjson URL I get the fallowing error
page:


Struts Problem Report

Struts has detected an unhandled exception:
# Messages: 	There is no Action mapped for namespace / and action name testjson.


Any suggestions on how to make JSON action work?

Regards
-- 
Milos Negovanovic
milos.negovanovic@googlemail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message