struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Matthieu.M...@ensam.eu>
Subject JSon, includeProperties and modelDriven
Date Mon, 05 Mar 2012 15:29:26 GMT
Hi,

I am trying to make an action build a JSON result.

The action is defined in the struts.xml file as : 

<action name="evts" class="org.project.controllers.json.EventsAction" method="executeEvts"
>
  <result name="success" type="json">
    <param name="includeProperties">  		
	^day,
	events,
    	events\[\d+\],
    	events\[\d+\].id,
    </param>
  </result>
</action>

My Java action class EventsAction is defined as : 

public class EventsAction extends baseAction implements ModelDriven<TimetableManager>,
Preparable { 

	public String getDay(){ return day; };
	public myModel getModels(){return ...;};
}

The JSON is working for events\[\d+\].id   :   getModels().getEvents().get(i).getId();

But not working for day : getDay() is not called.

I tried without ^, but no result.

My problem is I do not managed to make JSON result working without using the modelDriven returned
object.

What I missed ? 

Cordialy and thanks for responses, 	


Matthieu MARC

---
Matthieu MARC
Responsable du Service Informatique
Centre Arts et Métiers Angers
Tel : 02 41 20 73 61



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


Mime
View raw message