29 Sep 2010 12:34 PM #1
Creating mobile web app from traditional Struts web app
We're investigating how we can create mobile web apps by reusing existing web apps created using Struts. The existing web app sets several session/request attributes with data in the response before returning to the jsps. Is there a way to access this data using the Sencha APIs? I've been looking over the several different Proxys in the API (MemoryProxy, SessionStorageProxy) and I'm not sure if this is even the route I should take.
As an example, my Struts Action class sets a request attribute called 'sources' which is an array of LabelValueBeans. It then forwards to the jsp. In my jsp, I just access the attribute by name ('sources') and print out their label and values. But I'm getting very confused looking at the Sencha examples. I'm not sure if I need to be using a Store and which kind of Proxy (if any).
Any help or direction is appreciated.
29 Sep 2010 3:58 PM #2
- Join Date
- Apr 2007
- Sydney, Australia
- Vote Rating
The model is the same, you make requests to the server using Ajax and it returns JSON data in a particular format that can be read by a store.Evan Trimboli
Twitter - @evantrimboli
Don't be afraid of the source code!
30 Sep 2010 6:07 AM #3
Thanks for the reply Evan. Just to be clear, I'm not really modeling anything, as in a User object or anything. My web app screen has several drop down lists that contain several options. (It's a search screen) They are being populated by several arrays passed from the Action class to the jsp via request attributes.
In my mobile app, I was going to do the same thing, except with Ext.form.Select objects. So I was assuming that the Selects would be populated by the same arrays from the request. In other words, the request has already been made (via the existing login screen and Struts framework, not AJAX) and the data is already in the session. I'm just not sure how to access those arrays in the session. Is there a particular Sencha example that does this sort of thing?
5 Oct 2010 6:06 AM #4
Can anyone comment about this? Is this even possible? In a nutshell, I'm trying to reuse my existing web app and just rewrite new GUIs with "touch". Can session information stored by my servlet be retrieved by the Sencha touch APIs? I don't see any examples of this. The current web app doesn't make AJAX calls, it just makes traditional Struts Action class calls.
By swagat321 in forum Sencha Touch 1.x: DiscussionReplies: 0Last Post: 17 Sep 2010, 8:35 PM
By bitse in forum Ext GWT: DiscussionReplies: 0Last Post: 13 May 2009, 6:33 AM
By daemach in forum Ext 2.x: Help & DiscussionReplies: 12Last Post: 12 Jan 2008, 5:45 AM
By firstname.lastname@example.org in forum Community DiscussionReplies: 5Last Post: 9 Jun 2007, 2:34 PM
By email@example.com in forum Community DiscussionReplies: 8Last Post: 3 May 2007, 9:16 PM