some thoughts....(more heads are better than one)

As far as my expriance goes I have never come across keyword "model" , but
this  message usually comes if the variable scope(not jsp's usebean scope)
is unclear i.e, declared in a diffrent scope,

the variable name "model" has to be

1. the ID of the bean you are using
2. declared in the declaration directive

It could also be what Craig said,

but let see this,

if the usebean tag were there with id="model" and if the bean were not
found, it would give the error "classdef not found" exception, if this were
to happen your page would not have returned any o/p in the first place.

ITH

Amit

> -----Original Message-----
> From: Craig R. McClanahan [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, December 23, 1999 4:01 AM
> To:   [EMAIL PROTECTED]
> Subject:      Re: Servlets and JSPs
>
> Boy, that is definitely a strange one.  A couple of off the wall thoughts:
>
> * Have you enabled JSP 1.0 support in JRun?  If you are using
>   0.92 support the <jsp:useBean> tag would have been ignored.
>
> * Could "model" be a reserved word somehow?  Try a different
>   variable name just to make sure.
>
> Craig
>
>
> Reg Sherwood wrote:
>
> > Craig,
> >   As requested.... here is the error I receive in my client window:  I
> am using
> > JRun 2.3.3, Servlet API 2.1, JSP 1.0.
> > Any ideas as to why.  I am under the impression this should work ok.
> Any help
> > would be appreciated.
> >
> > 500 Internal Server Error
> > com.livesoftware.scripting.CompilerException:
> > <blah>/jsm-default/services/jseweb/servlets/jsp/thepage.java:71:
> Undefined variable
> > or class name: model
> > out.print("" + ( model.getName(0) ) );
> >                  ^
> > 1 error
> >
> >  at java.lang.Throwable.(Compiled Code)
> >  at java.lang.Exception.(Compiled Code)
> >  at com.livesoftware.scripting.CompilerException.(Compiled Code)
> >  at com.livesoftware.scripting.JavaCompiler.compile(Compiled Code)
> >  at com.livesoftware.jrun.plugins.jsp.JSPCore.getPage(Compiled Code)
> >  at com.livesoftware.jrun.plugins.jsp.JSP.callPage(Compiled Code)
> >  at com.livesoftware.jrun.plugins.jsp.JSP.service(Compiled Code)
> >  at javax.servlet.http.HttpServlet.service(Compiled Code)
> >  at com.livesoftware.jrun.JRun.runServlet(Compiled Code)
> >  at
> com.livesoftware.jrun.JRunServletContext$JRunRequestDispatcher.forward(Com
> piled
> > Code)
> >  at
> com.imagicTV.iBDS.Servlet.ListAccountsJSP.ListAccountsJSP.service(Compiled
> > Code)
> >  at javax.servlet.http.HttpServlet.service(Compiled Code)
> >  at com.livesoftware.jrun.JRun.runServlet(Compiled Code)
> >  at com.livesoftware.jrun.JRunGeneric.handleConnection(Compiled Code)
> >  at
> com.livesoftware.jrun.service.web.JRunWebServiceHandler.handleOutput(Compi
> led
> > Code)
> >  at
> com.livesoftware.jrun.service.web.JRunWebServiceHandler.handleRequest(Comp
> iled
> > Code)
> >  at com.livesoftware.jrun.service.ThreadConfigHandler.run(Compiled Code)
> >
> > The actual JSP page is something like this:
> >
> > <html>
> >   <%@ page import="<blah>.MyClass.*" %>
> >   <jsp:useBean id="model" scope="session" class="<blah>.MyClass.MyBean"
> />
> >   <%= model.getName(0) %>
> > </html>
> >
> > Thanks
> >
> > "Craig R. McClanahan" wrote:
> >
> > > Reg Sherwood wrote:
> > >
> > > > Q.  Is it possible to maintain the state of a bean for a particular
> > > > client for use in a JSP page.  I have tried placing the bean
> instance I
> > > > wish to save on the session object in the hopes of later retrieving
> it
> > > > via a get method in the servlet.  After reviewing docs I think it
> may be
> > > > possible to do something along the lines of:
> > > >
> > > > SERVLET:
> > > >          HttpSession session = request.getSession(true);
> > > >          session.putValue("theBean", myBean);
> > > >
> > > > JSP PAGE:
> > > >          <jsp:useBean id="theBean" scope="session" class="..." />
> > > >
> > > > Now in the JSP page I wish to retrieve values on the bean instance
> from
> > > > a specified method.  So,
> > > >
> > > > JSP PAGE:
> > > >         <% int x = theBean.getSize(); %>
> > > >
> > > > But when I try this the above fails as it does not know what the
> > > > variable "theBean" is, even though I named it in the id portion with
> the
> > > > jsp:useBean tag.  Any thoughts? Thanks
> > > >
> > >
> > > This is exactly the way it is supposed to work, as long as your
> <jsp:useBean>
> > > directive comes *before* the scriptlet in your page.  What JSP system
> are you
> > > using?  What is the exact compile error that you get?
> > >
> > > Craig McClanahan
> > >
> > >
> ==========================================================================
> =
> > > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> > > FAQs on JSP can be found at:
> > >  http://java.sun.com/products/jsp/faq.html
> > >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >
> >
> ==========================================================================
> =
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> > FAQs on JSP can be found at:
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
>
> ==========================================================================
> =
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> FAQs on JSP can be found at:
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to