JSP calling methods on a base servlet - how

W

Will

I have a servlet called Register
that extends a base servlet
called BaseServlet (which is an
EJB I think). Then in the Register
servlet I can use methods from
BaseServlet easily - because it
extends it. My boss told
me to use JSP and not servlets.
But then my JSP cannot 'extend'
BaseServlet. Neither can I use
<jsp:useBean id="BaseServlet" class="common.servlet.BaseServlet" />
because it returns an error.
So how can I use BaseServlets methods
if I cannot 'extend' it
in the normal way.
I can do <jsp:useBean id="myBean" class="java.lang.String"
scope="session" /> OK but when I try my BaseServlet bean it returns 500
Server error.
Is it that one can't 'extend' other servlets from a jsp?
 
R

Raymond DeCampo

Will said:
I have a servlet called Register
that extends a base servlet
called BaseServlet (which is an
EJB I think).

It is very unlikely that your servlet is also an EJB.
Then in the Register
servlet I can use methods from
BaseServlet easily - because it
extends it. My boss told
me to use JSP and not servlets.

Is your boss a technical boss or a manager? If he or she is a manager,
you should explain which technology is right for the job. If he or she
is a technical boss, then ask him or her to explain how to accomplish it.
But then my JSP cannot 'extend'
BaseServlet.

There is a page attribute in JSP for specifying the base class, although
its use is frowned upon.
Neither can I use
<jsp:useBean id="BaseServlet" class="common.servlet.BaseServlet" />
because it returns an error.
So how can I use BaseServlets methods
if I cannot 'extend' it
in the normal way.
I can do <jsp:useBean id="myBean" class="java.lang.String"
scope="session" /> OK but when I try my BaseServlet bean it returns 500
Server error.
Is it that one can't 'extend' other servlets from a jsp?

HTH,
Ray
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top