You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "dave ." <va...@hotmail.com> on 2006/11/21 03:14:57 UTC

Bean design for Struts and Axis webservice

Env: Struts 1.2.9, Axis 1.4
Where should the number of rooms (bed, bath, etc.) be calculated
so that the roomCount can be accessed in a Struts Action and displayed on a 
jsp page?

public class Property implements Serializable {
	private Set rooms = null;
....
}

public class Room implements Serializable {
	private Type type = null;
....
}

The following doesn't work in an Axis web client environment

	public Integer getRoomCount() {
		return roomCount;
	}
	public void setRoomCount(Integer typeId) {
		Integer count = 0;
		Set rooms = this.getRooms();
		for (Iterator itr=rooms.iterator(); itr.hasNext(); )
		{
	  		Room room = (Room)itr.next();
	  		Type type = room.getType();
	  		if(type.getId().equals(typeId)) {
	  			++count;
	  		}
		}
		this.roomCount = count;
	}
because the code auto-generated from WSDL looks like this
    public java.lang.Integer getRoomCount() {
        return roomCount;
    }
    public void setRoomCount(java.lang.Integer roomCount) {
        this.roomCount = roomCount;
    }

Any suggestions would be greatly appreciated.

_________________________________________________________________
Download now! Visit http://www.telusmobility.com/msnxbox/ to enter and see 
how cool it is to get Messenger with you on your cell phone.  
http://www.telusmobility.com/msnxbox/


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