my dog learned polymorphism*
The moose likes Struts and the fly likes How to call struts application through JSON Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to call struts application through JSON " Watch "How to call struts application through JSON " New topic
Author

How to call struts application through JSON

Mumtaz Khan
Ranch Hand

Joined: Feb 21, 2008
Posts: 53
Hi,

How can I make a call to struts 2.0 based webapplication from a mobile application as client ? I know this can be done with JSON, but I am a newbie to both struts and JSON. Can anyone help me.


SCJP 5.0 -- 97%
Mumtaz Khan
Ranch Hand

Joined: Feb 21, 2008
Posts: 53
Hi,

I have a struts2 based web application and I am using json-default to return json result type as response from my action class. I am able to call this action from browser but not from another application, which is a mobile based application that is developed in javascript. Here is my javascript code to call the action in struts web application:
Entry in struts.xml is:

Do I need an interceptor in struts application to receive request from mobile application?What is the other way to call struts 2.0 application from a mobile application to receive JSON response? Looking from some help.Thanks in advance.


 
GeeCON Prague 2014
 
subject: How to call struts application through JSON