struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Milos Negovanovic <milos.negovano...@googlemail.com>
Subject Re: configuring json action
Date Tue, 15 Dec 2009 15:23:16 GMT
On Mon, Dec 14, 2009 at 09:31:02PM +0000, Milos Negovanovic wrote:
> 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?
> 

Fixed. Solution was to add json plugin dependency in pom.xml.

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