• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

JSON response in Struts 2

 
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am using struts 2 action to send a JSON response. The struts 2 Action is having a transient variable which is having the JSON response, and it been sucessully sent to the client. my question here is how the transient variable is sent to the client. Since the transient variable cannot be serializable. i have the code below that i used. i would like to know the is their any interceptor will take care of reading the Transient Objects.

from the Below url its clear that struts 2 serialize the action object and send it to the client in case of JSON response. Plese help me to understand how the transient data is sent to the client
webpage




Struts config


 
Ranch Hand
Posts: 662
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does your definition of transient associated with the class Test or with jsonResponse?
What is transient and to which class does it apply??
 
Amirtharaj Chinnaraj
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can any one tell me why in the below URL transient variables are declared in the Action form

URL
 
Arun Kumarr
Ranch Hand
Posts: 662
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You still haven't responded to the questions above;

1. Does your definition of transient associated with the class Test or with jsonResponse?
2. What is transient and to which class does it apply??

Additional ones;
3. What is transient got to do with serializable interface or sending objects over the wire?
4. What is the role of action form and why is it implementing serializable interface?
 
Amirtharaj Chinnaraj
Ranch Hand
Posts: 242
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Arun,

I am working in a Maintenance project,

The code that i have put is not written by me , So i don't know the exact reason to have transient variable in actionform. however that author has used the transient variable consistently throughout the project. the application is also running fine in production.

i dont understand the technical reason of having a transient variable in a action form.
 
Arun Kumarr
Ranch Hand
Posts: 662
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was talking about the transient setting in the actionform class of struts framework. I believe it has got nothing to do with the implementation.
As a good started I would want you to read this.
 
Space pants. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic