/*
After few minor corrections every thing compiled fine for me on an XP
workstation with j2sdkee1.4. One thing you might check is if your CLASSPATH
environment variable is pointing to the correct packages. I had to add the
package name to my classpath on XP but not on other machines so try both.

[localdrive]:\j2sdkee1.4\lib\j2ee.jar
where localdrive is where you have the sdk installed.
*/

package com.vtr.taglibs;
import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
/**** added io for the out.println *****/
import java.io.*;

public class Hello extends TagSupport{
 private String name=null;

 public void setName(String value) {
  name=value;
 }

 public String getName(){
  return(name);
 }
 /**** added the throws declaration ***/
 public int doStartTag() throws JspTagException{
  try{
   JspWriter out=pageContext.getOut();
   if(name!=null)
    out.println("Hola "+name);
   else
    out.println("Hola World");
  }catch (IOException e){
   throw new JspTagException("I/O Exception "+e.getMessage());
  }
 return SKIP_BODY;
 }
}
----- Original Message -----
From: "V.T.R.Ravi Kumar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, December 14, 2002 1:54 AM
Subject: problem in compiling tag


> package com.vtr.taglibs;
> import javax.servlet.jsp.*;
> import javax.servlet.jsp.tagext.*;
>
> public class Hello extends TagSupport {
> private String name=null;
> public void setName(String value) {
> name=value;
> }
> public String getName()
> {
> return(name);
> }
> public int doStartTag()
> {
> try{
> JspWriter out=pageContext.getOut();
> if(name!=null)
> out.println("Hola "+name);
> else
> out.println("Hola World");
> }catch (IOException e)
> {
> throw new JspTagException("I/O Exception "+e.getMessage());
> }
> return SKIP_BODY;
> }
> }
>
> I am unable to compile the above program i get the message that
> unable to import
>
> import javax.servlet.jsp.*;
> import javax.servlet.jsp.tagext.*;
>
> what should i do
> ----------------------------------------------------
>         V.T.R.Ravi Kumar
> Engineer,CCX,BHEL, Haridwar
> Phone : Office-91-01334-285260
>              Res  -91-01334-226121
> -----------------------------------------------------
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to