As per #1: I'm not sure about what you said that all the get and set methods of your second bean were called. That sounds weird.
Also if you use jsp:useBean tag in session context for example it should not be calling anything if it already exists in that session. d. GOKHAN TUNA wrote: > Hi, > > im developing servlets, simple beans and jsp pages with JBuilder 4. > I have 2 questions: > > 1. > In my jsp pages i generally use two beans, one is a bean related with > security issues the other is the bean that processes the requests in the > page. SecurityBean simply checks whether session exists and has the right > value or not. if session does not exist or does not have the correct value, > it redirects the user to the login page with authentication failed message. > It works fine, but in my tests i saw that the second bean is also loaded > while SecurityBean is making the necessary checks. SecurityBean is loaded, > after 0.3 seconds, the other bean is also loaded. I also saw that nearly > all the get and set property s of the second bean was called. After this, > the page is redirected to login page but there exists unclosed connection > to db etc... I can set a variable for the second bean telling that it > should omit the get and set property calls but this requires some if checks > which is not very convenient.. I need your opinions about this.. > > 2. > i simply use request dispatcher like this, it works fine with the tomcat in > JBuilder 4, but when i use it in ApacheTomcat 4 standalone, i get 404.. > Interesting thing is that response.sendRedirect works fine for the same > addressStr. why can this happen? did i miss sth in my web.xml file? > > addressStr = "/MobilePBX/jsp/index.jsp"; > rd = this.getServletContext().getRequestDispatcher(addressStr); > //response.sendRedirect(addressStr); > rd.forward(request, response); > > > gokhan, > > ___________________________________________________________________________ > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > of the message "signoff SERVLET-INTEREST". > > Archives: http://archives.java.sun.com/archives/servlet-interest.html > Resources: http://java.sun.com/products/servlet/external-resources.html > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html > > > > -- David Mossakowski [EMAIL PROTECTED] Instinet Corporation 212.310.7275 ******************************************************************************* <<Disclaimer>> This message is intended only for the use of the Addressee and may contain information that is PRIVILEGED and/or CONFIDENTIAL or both. This email is intended only for the personal and confidential use of the recipient(s) named above. If the reader of this email is not an intended recipient, you have received this email in error and any review, dissemination, distribution or copying is strictly prohibited. If you have received this email in error, please notify the sender immediately by return mail and permanently deleting the copy you received. Thank you. ******************************************************************************* ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
