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
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Effect of Non-Serialization in the remote Server?

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I've a plain Java bean which I used as a model in the MVC architecture. My application is running in the remote server. In this situation whether my model should implement the Serializable Interface. If yes, what will be a error/exception if I failed to implement a Serializable interface?
 
Rancher
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
How is your Java bean running on the remote server. That is, is it running in a Java EE container? Spring? The server documentation should tell you the rules of when and what to serialize. It also depends on how you use your Java Bean. Do you store references to it in the session or application object (if you run in a web container) or do you just create, use, and destroy it in a single function? A quick Google search found java.io.NotSerializableException.
 
Vijayakumar Rengaraj
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Thanks for the reply.

My web application is running in one of the webservers. I just create a javaBean and set some values and put it in the request scope. In my JSP I just get the bean from the request scope and print the value... simple.

For this simple process whether my been need to implement the serializable interface. And what are all the risks involved if I didn't implement the Serializable interface. I heard that we need to implement serializable to avoid accessing/changing the data through the network. Is it true?

Thanks in advance.
 
Tom Reilly
Rancher
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I suggest learning more about your server architecture. You mentioned it runs on one of your web servers but a web server alone won't run your JSP. You need a JSP container to do that. Do you have a distributed environment in which it's possible to create your Java Bean on one server and have the JSP process on another server? Do your servers support fail-over? Yes, you must implement Serializable if your JavaBean is sent across the network or is saved to disk at any time.
 
Vijayakumar Rengaraj
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Just tell me what are all the risks involved if my bean doesn't implement the Serializable interface?
 
Marshal
Posts: 80749
486
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Moving to our JSP forum.
 
Sheriff
Posts: 67754
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

Vijayakumar Rengaraj wrote:Just tell me what are all the risks involved if my bean doesn't implement the Serializable interface?


I do not care for the tone that you have taken with people who are volunteering their time to help you. I have closed this topic. Please feel free to open a new topic on this subject where you will have the opportunity to show the proper level of politeness and gratitude for any help that you will receive.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic