• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

why sun people declared config variable as transient in generic class?

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
why sun people declared config variable as transient in generic class?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now that we know the question is about the GenericServlet class, let's slide it back to the servlet forum. The question is still not entirely clear, though: where did you get the notion of the ServletConfig object being transient or not being transient?
 
ranjithkumar.gendhe kumar
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i noticed this thing in generic servlet class

they declared servletconfig ref variable as transeint in generic servlet. why they are declaring like that.

this class look like

"
public abstract class GenericServlet
implements Servlet, ServletConfig, java.io.Serializable
{

private transient ServletConfig config;

.....
.
.
.
.
}"
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I understand correctly, Servlets are serialisable and for example can be deployed to multiple nodes in a cluster. The config is specific to a node in the cluster though, so this prevents the config being moved to another node when it should not be, and allows the next node to set its own configuration.
 
ranjithkumar.gendhe kumar
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
k. thanks for your explanation.

i still have some confusing

could you explain with an example

in which cases it will helpful
 
Think of how stupid the average person is. And how half of them are stupider than that. But who reads this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic