VIKRANT JAIN wrote:
> can anybody reply to the above query please?
> unlike in the previous version of JSP1.0 there does not appear to be any
> page directive named "method" (or any other way) through which the
> scriptlet code may form a part of some method other than the default
> "service"

You can write methods by using the declaration tag:

<%!
    public returntype methodname(paramtype1 param1...) {
        // do something
        // return something
    }
%>

though I would certainly NOT try to override the jspService(...) method.

Note that this will not help you build re-usable code.  A better bet
would be to use a "Utility" bean or some other java class that you
write, perhaps with static methods so it doesn't need to be
instantiated.

Using beans and taglibs are the best way to structure a web app,
maximizing reusability.  You should strive to minimize the amount of
scriptlet/declaration/expression code in your .jsp pages.

                        -=- D. J.

===========================================================================
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