Hello sir

i am really very much thankful to you
I have done the same as you have told me
It was really great.I was trying a lot to extend a servlet from a jsp.But can
we do this.i think we can do this.But the Problem was my servlet used to
execute fine but after that the control was not comming to the JSP.It use to
trow some exception at that time.
Then i tried as you told me,and it worked fine
but have you seen a JSP extending a servlet
Ok bye for now

Girish

>===== Original Message From A mailing list about Java Server Pages
specification and reference <[EMAIL PROTECTED]> =====
>Girish B Mohite wrote:
>
>> Hi EveryBody
>>
>> I am trying to create a pool of Database connections
>> I want this code to be executed only once that is as wee do in the init()
>> method of servlets.Thats why i have written a servlet for this
>> Now here onwards all my JSP's should be extending this servlet.Will i be
able
>> to do this.
>> Finally i have done this and the code excutes the init method of the
servlet
>> first,but after that the control doesnt comes to my JSp.It gives an error
at
>> that point
>>
>> Has anyone tried this type of thing
>> Thanx in advance
>>
>
>Here's an easy way to deal with this situation, without even needing to have
your
>JSP pages extend a servlet:
>
>* Create a servlet whose init() method creates the connection pool
>  in the usual way.
>
>* Once the pool is created, store it as an servlet context attribute (which
>  is the same as an application scope bean in JSP pages):
>
>    com.mycompany.mypackage.ConnectionPool myPool =
>        new ConnectionPool(...);
>    getServletContext().setAttribute("pool", myPool);
>
>* In the web.xml file, configure this servlet to be loaded at startup time,
>  so that the connection pool will be established immediately (rather than
>  on the first request).
>
>* In a JSP page that needs access to the pool, use a <jsp:useBean>
>  tag like this:
>
>    <jsp:useBean id="pool" class="com.mycompany.mypackage.ConnectionPool"
>     scope="application"/>
>
>
>>
>> Girish
>>
>
>Craig McClanahan
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
>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

------------------------------------------------------------
 Get your FREE web-based e-mail and newsgroup access at:
                http://MailAndNews.com

 Create a new mailbox, or access your existing IMAP4 or
 POP3 mailbox from anywhere with just a web browser.
------------------------------------------------------------

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
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