I work with multiple languages like PHP, C, JAVA etc. I am trying to fully understand how session is implemented in java.
Question : In php I can create a session and use the session in any class even utility classes. In Java why session is meant to be handled normally only in servlet classes? why not in any basic POJO classes without actually passing session or context object ? (I know other classes can, using complex techniques, but why not easily as servlet or as in other languages ).
I do know that the correct way to do things is use session in Servlet to retrieve object/values and pass object/values to other utility classes and get results.
Please let me know if there is in fact an easy way to get session in basic POJO classes.
Aucun commentaire:
Enregistrer un commentaire