Lance Prais wrote:

> doc.field returns a string from a document the error I am getting is as
> follows:
>
> Unable to compile class for
> JSP/usr/local/netscape/server4/https-kb-dev/config/../ClassCache/_jsps/_resu
> lts_jsp.java:498: Undefined variable or class name: doc

This means that you have not created the doc object.
Somewhere you need to do something like -

Document doc = new Document();
or
Document doc = something.getDocument(); //would return a Document

>
>                                 String skurl=doc.field("VdkVgwKey");
>
> anyone have a clues to as why this is erroring out
>
> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
> Bhushan_Bhangale
> Sent: Monday, April 29, 2002 3:00 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Endswith()
>
> What is "doc.field"? What error you are getting when it says unable to
> compile class?
>
> -----Original Message-----
> From: Lance Prais [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, April 27, 2002 3:53 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Endswith()
>
> It seems to be working fine with one exception "doc.field", I have used this
> through my app with out any problems. Iam getting an "Unable to compile
> class" error. The string "url" is being read from a bif file in verity which
> contains a string similar to this:
>
> /data/verity/custom-kb/content/solutions/gold/55.0.13769927.2880318.html
>
> This is my code:
>                 String image="";
>                 String url=(doc.field("VdkVgwKey"));
>                 String file=url.substring(url.lastIndexOf("/"),
> url.length());
>                         if(file.endsWith(".txt") || file.endsWith(".TXT")) {
>                                 image="test";
>                             }
>
> Anyone see whaere I am going wrong.. Thank you again in advance.
>
> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Lance
> Prais
> Sent: Friday, April 26, 2002 4:05 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Endswith()
>
> Thanks
>
> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Erik
> Morton
> Sent: Friday, April 26, 2002 3:56 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Endswith()
>
> Yeah, or toUpperCase/toLowerCase.
>
> "Galbreath, Mark" wrote:
>
> > do an equalsIgnoreCase() then....
> >
> > -----Original Message-----
> > From: Erik Morton [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, April 26, 2002 4:46 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: Endswith()
> >
> > If I understand your question correctly, you may want to try this:
> >
> > String url =
> >
> "/data/verity/custom-kb/content/solutions/gold/55.0.13769927.2880318.html";
> > String file = url.substring(url.lastIndexOf("/"), url.length());
> > if(file.endsWith(".html") || file.endsWith(".HTML")) {
> > ///yada yada yada
> > }
> >
> > Now, notice that comparing the last characters of the file string is
> > imprecise,
> > because in theory a url like http://host.com/myFile.HtMl is valid.
> >
> > Lance Prais wrote:
> >
> > > I am new to Programming, Can anyone explain how to use endswith()
> > >
> > > For example I want to check this field to see what the .filetype is: I
> can
> > > not seem to grasp it with this field:
> > >
> > >
> /data/verity/custom-kb/content/solutions/gold/55.0.13769927.2880318.html.
> > >
> > > Thank you in advance
> > > Lance
> > >
> > >
> >
> ___________________________________________________________________________
> > > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> > body
> > > of the message "signoff SERVLET-INTEREST".
> > >
> > > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > > Resources: http://java.sun.com/products/servlet/external-resources.html
> > > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
> >
> > --
> > Erik I Morton
> > Developer
> > ------------------
> > CommerceHub
> > http://www.commercehub.com
> > 518-886-0704
> > 21 Corporate Drive
> > Clifton Park, NY 12065
> >
> >
> ___________________________________________________________________________
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> > of the message "signoff SERVLET-INTEREST".
> >
> > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > Resources: http://java.sun.com/products/servlet/external-resources.html
> > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
> >
> >
> ___________________________________________________________________________
> > To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> > of the message "signoff SERVLET-INTEREST".
> >
> > Archives: http://archives.java.sun.com/archives/servlet-interest.html
> > Resources: http://java.sun.com/products/servlet/external-resources.html
> > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> --
> Erik I Morton
> Developer
> ------------------
> CommerceHub
> http://www.commercehub.com
> 518-886-0704
> 21 Corporate Drive
> Clifton Park, NY 12065
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

--
Erik I Morton
Developer
------------------
CommerceHub
http://www.commercehub.com
518-886-0704
21 Corporate Drive
Clifton Park, NY 12065

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to