Hi All,

First, Daniel, if you reading this, I am having troubles sending email to
you..so I will ask my questions here.

Concerning the approach Daniel and Craig have discussed with me here, I have
to say I am quite pleased how easy it is and how simplistic the design is.
Oh yeah..I finally got it working.

For those of you just reading this, I posted a number of emails to the list
concerning I needed help with some Model 2 dilemas I was having. Daniel and
Craig both responded with a number of good emails. See the list archive if
your interested.

Ok..so here goes the questions:

When my action class places a bean in the request object with
request.setAttribute("MyBeanName", myBean); and a JSP page uses request
scope, first..does the getAttribute() get the bean out in the <jsp:usebean
id="MyBeanName" scope="request".. />? Also, because its request scope, does
it destroy the bean object after each request and automatically gc the
object(s) used? I assume the answer is yes to both of these.

Next, I am having compiler errors when I do
request.setAttribute(javax.servlet.jsp.PageContext.EXCEPTION, myException);
It can't find the .jsp.PageContext.EXCEPTION stuff. I assume my classpath
isn't set up to the right place or something. But, my question is, is there
really any big deal if I just say setAttribute("EXCEPTION", myException). In
my header.inc file, which is included in evey JSP page (static and dynamic
pages alike), I can just check for the existence of the EXCEPTION attribute
and if it exists, display the exception, couldn't I? I mean..is there any
"harm" so to speak in doing it this way? Or do I gain some specific
functionality by using the javax... approach which is the standard way? Does
it forward to a specific page or something?

Some stuff about threading. If I use a single controller servlet, and 100
requests come in at one time (hypothetical..but possible), and 20 of them
are all ENROLL actions, does each incoming request get its own thread, and
thus when it uses the ENROLL action class, and private variables in that
class are specific to each thread/request calling on it? Or do I have to
take special precautions to make it thread safe? My worry is that up until
now, I have believed that by using Servlets, I am completely thread safe.
All incoming requests each get their own thread and their own Servlet
instance variables that are defined in the servlet. If this is true, does
this apply to the action class that is called as well? Does each thread
create its own instance of that class and its tied to the thread given to
the incoming request?

If not, what is the course of action to make sure everything is absolutley
thread safe?


Daniel, I did get your links and recall reading about the threading issues.
Its possible I just dont comprehend the exact message they are saying there.
:)

Thanks again.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to