Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JSP calling methods on a base servlet - how

Reply
Thread Tools

JSP calling methods on a base servlet - how

 
 
Will
Guest
Posts: n/a
 
      08-21-2005
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?

 
Reply With Quote
 
 
 
 
Raymond DeCampo
Guest
Posts: n/a
 
      08-21-2005
Will wrote:
> 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

--
XML is the programmer's duct tape.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
calling a Servlet from a jsp vaneric Java 2 12-09-2008 04:41 PM
Opening new child window - Running servlet (JSP and Servlet) agapitolw@yahoo.es Java 4 08-27-2007 12:57 PM
Servlet.service() for servlet jsp threw exception java.lang.IllegalStateException: getOutputStream() has already been called for this response javadev Java 5 11-16-2006 11:22 AM
Servlet question(Tomcat, web.xml, servlet-class, servlet-name) circuit_breaker Java 2 04-04-2004 03:26 AM
Calling Cocoon in Servlet/JSP Jawahar XML 1 09-23-2003 05:09 PM



Advertisments