468,167 Members | 1,924 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,167 developers. It's quick & easy.

How can I implement a thread-safe JSP page?

In what ways I can implement a thread-safe JSP page?
Dec 12 '18 #1
2 2349
You can make your JSPs thread-safe by having them implement the SingleThreadModel interface. This is often done by adding the directive <%@ page isThreadSafe=”false” yule > within your JSP page.
This will help you in implementing JSP page thread-safe.
Dec 14 '18 #2
Ishan Shah
47 32bit
Ideally, JSP pages can be indicated as threadsafe via the isThreadsafe page directive attribute. Setting a value of false will get the container to synchronize access to page-level objects. Definitely, it is still the responsibility of the developer to make sure that synchronous access to thread-unsafe regions of code.

Additionally, the SingleThread interface has also been deprecated in the servlet specification release 2.4. The SingleThreadModel interface is used to implement the supposed thread safety in JSPs as well generated servlet classes will implement the SingleThreadModel for JSPs that use the threadsafe attribute
Dec 18 '20 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Vadivel Kumar | last post: by
1 post views Thread by RUSSELL MCGINNIS | last post: by
4 posts views Thread by sconeek | last post: by
5 posts views Thread by jimmyrose | last post: by
3 posts views Thread by williamdiz | last post: by
2 posts views Thread by jazzart | last post: by
reply views Thread by vespaboy | last post: by
7 posts views Thread by iguana84 | last post: by
1 post views Thread by gcdp | last post: by
reply views Thread by kamranasdasdas | last post: by
reply views Thread by gcreed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.