Problem on reload a JSP file in Tomcat 3.3.1

I have a problem about Tomcat 3.3.1
I am developing a JSP application,
but Tomcat not recompile the JSP file after i modify it.
I need to "wait" the tomcat recompile it, so i can see the change.
This make the development really difficult...
Do I miss some important step on config Tomcat 3.3.1
how to force it to detect a newer version JSP in every request ??
Thanks

I believe there is a way to configure Tomcat to do this, but I don't know what it is.
Until someone can tell you the configuration steps, here is a workaround. Tomcat keeps the Java source and class files for your JSP code somewhere under its "work" directory. Find those files and delete them, which will force it to re-compile.

Similar Messages

  • Problem in running a jsp page on tomcat 5.0

    hi....
    i made a java class abc.java and then compiled it to get a java class file named abc.class in a package named pkg.
    Then i copied this package in the classes folder of the WEB-INF folder in tomcat 5.0.
    After that i created a jsp page in which i imported this class file. Now when i run the jsp page on tomcat 5.0 i get an error saying this:
    javax.servlet.ServletException: pkg/abc (Unsupported major.minor version 49.0)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:244)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.lang.UnsupportedClassVersionError: pkg/abc (Unsupported major.minor version 49.0)
         java.lang.ClassLoader.defineClass0(Native Method)
         java.lang.ClassLoader.defineClass(ClassLoader.java:502)
         java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
         org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1634)
         org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:860)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1307)
         org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1189)
         org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1214)
         org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
         org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
         org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
         org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
         org.apache.jasper.compiler.Generator.generate(Generator.java:3272)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:244)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:495)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:476)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:464)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    Can anyone please tell me the solution to this problem?
    thanks

    This post:
    http://mail-archives.apache.org/mod_mbox/jakarta-tomcat-user/200408.mbox/%[email protected]ys.com%3E
    Leads me to believe that you're compiling and targeting a java version that your tomcat installation doesn't support. What version of the JDK are you using?
    Good Luck
    Lee

  • Unable to run JSP file in TOmcat

    My Tomcat is running when i type http://localhost:8080/index.jsp , i'm able to see home page
    CLASSPATH=C:\j2sdk1.4.2_08\bin;E:\Grinder;E:\Grinder\lib\grinder.jar;C:\Program Files\Java\j2re1.4.2_08\lib\grinder.jar;
    JAVA_HOME=C:\j2sdk1.4.2_08
    I tried both pointing to JAVA_HOME C:\Program Files\Java\j2re1.4.2_08
    When i try to run the JSP file under C:\Tomcat 5.0\webapps\ROOT\add.jsp. I'm getting following error.
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:97)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:346)
         org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:414)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    Unable to find a javac compiler;
    com.sun.tools.javac.Main is not on the classpath.
    Perhaps JAVA_HOME does not point to the JDK
         org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory.getCompiler(CompilerAdapterFactory.java:106)
         org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:935)
         org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:764)
         org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:382)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:472)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

    I know the same.
    But problem is that whenever I am creating a new file containing single line say 'Hello world' and then try to run,
    the similar type of error msg comes.

  • Getting error when placing jsp file in tomcat root folder

    hello experts,
    i have developed an application on netbeans 6.1 for mail.
    It is working perfect when i run it from netbeans, but when we copy those jsp files to ROOT folder of tomcat5.5 server, it is showing me following error.
    rg.apache.jasper.JasperException: Unable to compile class for JSP:
    An error occurred at line: 14 in the jsp file: /Mailer1.jsp
    Session cannot be resolved to a type
    11: <%!
    12: String nam = null, email = null, suggestion = null;
    13: RequestDispatcher disp = null;
    14: public static Session sess = null;
    15:
    16: %>
    17: <%
    An error occurred at line: 38 in the jsp file: /Mailer1.jsp
    sess cannot be resolved
    35:
    36: //SecurityManager security = System.getSecurityManager();
    37:
    38: sess= Session.getInstance(props,new javax.mail.Authenticator() //if u uses getDefaultInstance it will raise Security Exception
    39: {
    40: protected PasswordAuthentication getPasswordAuthentication()
    41: {
    An error occurred at line: 38 in the jsp file: /Mailer1.jsp
    Session cannot be resolved
    35:
    36: //SecurityManager security = System.getSecurityManager();
    37:
    38: sess= Session.getInstance(props,new javax.mail.Authenticator() //if u uses getDefaultInstance it will raise Security Exception
    39: {
    40: protected PasswordAuthentication getPasswordAuthentication()
    41: {
    An error occurred at line: 38 in the jsp file: /Mailer1.jsp
    javax.mail.Authenticator cannot be resolved to a type
    35:
    36: //SecurityManager security = System.getSecurityManager();
    37:
    38: sess= Session.getInstance(props,new javax.mail.Authenticator() //if u uses getDefaultInstance it will raise Security Exception
    39: {
    40: protected PasswordAuthentication getPasswordAuthentication()
    41: {
    An error occurred at line: 45 in the jsp file: /Mailer1.jsp
    sess cannot be resolved
    42: return new PasswordAuthentication("[email protected]","ratatouille");
    43: }
    44: });
    45: sess.setDebug(true);
    46:
    47:
    48: //sess = Session.getDefaultInstance(props);
    An error occurred at line: 50 in the jsp file: /Mailer1.jsp
    Transport cannot be resolved to a type
    47:
    48: //sess = Session.getDefaultInstance(props);
    49: //sess.setDebug(true);
    50: Transport trans = sess.getTransport();
    51: Message msg = new MimeMessage(sess);
    52: msg.setRecipient(Message.RecipientType.TO, new InternetAddress("[email protected]"));
    53: msg.setFrom(new InternetAddress(this.email));
    An error occurred at line: 50 in the jsp file: /Mailer1.jsp
    sess cannot be resolved
    47:
    48: //sess = Session.getDefaultInstance(props);
    49: //sess.setDebug(true);
    50: Transport trans = sess.getTransport();
    51: Message msg = new MimeMessage(sess);
    52: msg.setRecipient(Message.RecipientType.TO, new InternetAddress("[email protected]"));
    53: msg.setFrom(new InternetAddress(this.email));
    An error occurred at line: 51 in the jsp file: /Mailer1.jsp
    Message cannot be resolved to a type
    48: //sess = Session.getDefaultInstance(props);
    49: //sess.setDebug(true);
    50: Transport trans = sess.getTransport();
    51: Message msg = new MimeMessage(sess);
    52: msg.setRecipient(Message.RecipientType.TO, new InternetAddress("[email protected]"));
    53: msg.setFrom(new InternetAddress(this.email));
    54: msg.setSubject(this.nam);
    An error occurred at line: 51 in the jsp file: /Mailer1.jsp
    MimeMessage cannot be resolved to a type
    48: //sess = Session.getDefaultInstance(props);
    49: //sess.setDebug(true);
    50: Transport trans = sess.getTransport();
    51: Message msg = new MimeMessage(sess);
    52: msg.setRecipient(Message.RecipientType.TO, new InternetAddress("[email protected]"));
    53: msg.setFrom(new InternetAddress(this.email));
    54: msg.setSubject(this.nam);
    An error occurred at line: 51 in the jsp file: /Mailer1.jsp
    sess cannot be resolved
    48: //sess = Session.getDefaultInstance(props);
    49: //sess.setDebug(true);
    50: Transport trans = sess.getTransport();
    51: Message msg = new MimeMessage(sess);
    52: msg.setRecipient(Message.RecipientType.TO, new InternetAddress("[email protected]"));
    53: msg.setFrom(new InternetAddress(this.email));
    54: msg.setSubject(this.nam);
    An error occurred at line: 52 in the jsp file: /Mailer1.jsp
    Message.RecipientType.TO cannot be resolved to a type
    49: //sess.setDebug(true);
    50: Transport trans = sess.getTransport();
    51: Message msg = new MimeMessage(sess);
    52: msg.setRecipient(Message.RecipientType.TO, new InternetAddress("[email protected]"));
    53: msg.setFrom(new InternetAddress(this.email));
    54: msg.setSubject(this.nam);
    55: msg.setContent(suggestion, "text/plain");
    An error occurred at line: 52 in the jsp file: /Mailer1.jsp
    InternetAddress cannot be resolved to a type
    49: //sess.setDebug(true);
    50: Transport trans = sess.getTransport();
    51: Message msg = new MimeMessage(sess);
    52: msg.setRecipient(Message.RecipientType.TO, new InternetAddress("[email protected]"));
    53: msg.setFrom(new InternetAddress(this.email));
    54: msg.setSubject(this.nam);
    55: msg.setContent(suggestion, "text/plain");
    An error occurred at line: 53 in the jsp file: /Mailer1.jsp
    InternetAddress cannot be resolved to a type
    50: Transport trans = sess.getTransport();
    51: Message msg = new MimeMessage(sess);
    52: msg.setRecipient(Message.RecipientType.TO, new InternetAddress("[email protected]"));
    53: msg.setFrom(new InternetAddress(this.email));
    54: msg.setSubject(this.nam);
    55: msg.setContent(suggestion, "text/plain");
    56: trans.connect();
    Stacktrace:
         org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:93)
         org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
         org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:435)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    i m unable to find out the solution,
    please help me to resolve it.
    thnaks.

    Hi shams.hq,
    I don't understand how you bother to copy an application in your server directories. It's really piece of cake to deploy with Tomcat.
    All you have to do :
    - with Netbeans, you build the project : a WAR file will be created in the dist directory of your project;
    - launch the server, if it's not running;
    - with your web browser, connect to the Tomcat Manager;
    - from there, you may upload and deploy the WAR file of your project.
    Et voilà ! Tomcat will unzip the WAR and install your classes and libraries at the right place.

  • Problem in executing a JSP file that includes a Custm tag

    Hi,
    I am very new to JSP,especially custom tags. I tried to run my first custom tag program but i cud not succeed.
    I tried to run it using Tomcat as well J2ee1.3. But still cud not c the output.
    I have placed jsp file,TLD etc in Web inf of root dir and class file inside classes folder..but i got some error saying tag with prefix not found in the tag library...
    i tried in all the ways but all in vain... I will post my code and exact error i faced.. can anyone help me soon to see the output?
    WelcomCtag.java
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    public class WelcomeCtag extends TagSupport
         private String Name=null;
         public String getName()
              return Name;
         public int doStartTag()
              try
                   JspWriter output=pageContext.getOut();
                   output.println("Welcome" + getName());
              }catch(Exception e)
                   throw new Error("Encountered an errer");
              return SKIP_BODY;
         public int doEndTag()
              try{}
              catch(Exception e)
                   throw new Error("Encountered an errer");
              finally
                   return SKIP_PAGE;
    [u]example.tld[/u]
    <taglib>
         <tlibversion>1.0</tlibversion>
         <jspversion>1.1</jspversion>
         <shortname>example</shortname>
         <info> A small example for usage of the tag library</info>
         <tag>
              <name> Welcome></name>
              <tagclass>WelcomeCtag</tagclass>
         <bodycontent>empty</bodycontent>
         <info>This tag is an example to display a welcome message</info>
         <attribute>
              <name>Name</name>
              <required>true</required>
              <rtexprvalue>true</rtexprvalue>
         </attribute>
         </tag>
    </taglib>
    [u]WelcomeCustomtag.jsp[/u]
    <%@ taglib prefix="example" uri="./example.tld" %>
    <html>
    <title>Welcome Handler</title>
    </head>
    <body>
    <example: Welcome Name="Panduranga"/>
    </body>
    </html>
    and the error i get while executing is here..........
    org.apache.jasper.JasperException: /WelcomeCustomtag.jsp(6,0) No tag "" defined in tag library imported with prefix "example"
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
         org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
         org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:196)
         org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1308)
         org.apache.jasper.compiler.Parser.parseElements(Parser.java:1564)
         org.apache.jasper.compiler.Parser.parse(Parser.java:126)
         org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
         org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:146)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    when i referred some other tutorials some have stored the tld file inside a folder called tags inside web inf and they have used like this <tags:example> etc and it wrked but if i want to specify some attributes i dunno how to give using <tags> style....
    Can anyone help me n tell me the difference in using tag like this <eample> and <tags: example> like this.....
    Thanks,
    Akshatha                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    1.
    Multiple tlds in web.xml
    Have multiple taglib elements in your web.xml - see below.
    <jsp-config>
      <taglib>
         <taglib-uri>http://example/taglib</taglib-uri>
         <taglib-location>/WEB-INF/example.tld</taglib-location>
      </taglib>
       <taglib>
          <taglib-uri>http://anotherexample/taglib</taglib-uri>
           <taglib-location>/WEB-INF/anotherexample.tld</taglib-location>
       </taglib>
    </jsp-config>The jsp-config element should be just after the servlet-mapping element in servlet 2.3 spec.
    For 2.4 spec, you can put it anywhere.
    In your jsp, to use the tags from the two tag libraries, use 2 taglib directives
    <%@ taglib prefix="example" uri="http://example/taglib" %>
    <%@ taglib prefix="anotherexample" uri="http://anotherexample/taglib" %>
    <example:tag1.................>
    <anotherexample:tag2.................> etc2.
    Mutliple tags per tld
    Have multiple <tag> elements in your tld.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN" "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
    <taglib>
       <tlib-version>1.0</tlib-version>
       <jsp-version>1.2</jsp-version>
       <short-name>j2ee</short-name>
       <tag>
          <name>tagName</name>
          <tag-class>pkgName.classname</tag-class>
          <body-content>JSP</body-content>
          <display-name>OverlapTag</display-name>
          <attribute>
             <name>attr1</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
          </attribute>
          <attribute>
             <name>attr2</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
          </attribute>
       </tag>
       <tag>
          <name>tag_2_Name</name>
          <tag-class>pkgName.classname</tag-class>
          <body-content>JSP</body-content>
          <display-name></display-name>
          <attribute>
             <name>attr1_2</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
          </attribute>
          <attribute>
             <name>attr2_2</name>
             <required>false</required>
             <rtexprvalue>true</rtexprvalue>
          </attribute>
       </tag>
    </taglib>
    Interesting snippet
    If you are using a 3rd party tag library, then the tags would come packaged in a jar file. The MTEA-INF directory of the jar file would contain the tlds and the tld would have an uri element. You can use it directly in the jsp without declaring the tld file in web.xml provided the jar file is in your classpath.
    For example, take the struts tag libraries, say the logic tags.
    The struts.jar contains, among other things, the tag class files and the tld files (inside /META-INF/tlds)
    All you have to do is put Struts.jar in the classpath (easy way to do this is put it in the WEB-INF/lib directory of your web-application).
    The jar file has struts-logic-1.1.tld in the META-INF/tlds directory.
    This tld file looks like this
    <taglib>
    <tlibversion>1.2</tlibversion>
    <jspversion>1.1</jspversion>
    <shortname>logic</shortname>
    <uri>http://jakarta.apache.org/struts/tags-logic</uri>
    ..................Now to use the tags in your jsp, you dont require the tld mappings in web.xml using the uri above in the taglib directive in your jsp
    <%@ taglib prefix="example" uri="http://jakarta.apache.org/struts/tags-logic" %> cool, right ? :)
    This is how you should pkg your own tags too. The tag classes have to be jarred and the tlds should go into the META-INF of the jar so that other users can simply add the jar to the cp and start using your tags.
    cheers,
    ram.

  • How to reference a DatabaseHandler servlet class from a jsp file in Tomcat

    Trying to create a database connection in the jsp file in webapps\project folder by referencing the DatabaseHandler class in webapps\project\WEB-INF\classes.
    Here is the code in the jsp to make the connection:
    DatabaseHandler db = new DatabaseHandler() ;
    String sql = "SELECT password FROM cms_users WHERE user =" + userName ;
    java.sql.ResultSet rs = db . selectQuery( sql ) ;
    Here is the DatabaseHandler class:
    import java.sql.*;
    public class DatabaseHandler
         // instance variables - replace the example below with your own
    private Connection connection;
         * Constructor for objects of class DatabaseHandler
         public DatabaseHandler()
    String url = "jdbc:odbc:javadatabase";
    // Load the driver to allow connection to the database
    try
    Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
    connection = DriverManager.getConnection( url );
    catch ( ClassNotFoundException cnfex )
    System.err.println( "Failed to load JDBC/ODBC driver." );
    cnfex.printStackTrace();
    System.exit( 1 ); // terminate program
    catch ( SQLException sqlex )
    System.err.println( "Unable to connect" );
    sqlex.printStackTrace();
    public ResultSet selectQuery( String query )
    Statement statement;
    ResultSet resultSet = null ;
    try
    statement = connection.createStatement();
    resultSet = statement.executeQuery( query );
    catch ( SQLException sqlex )
    sqlex.printStackTrace();
    System . exit( 1 ) ;
    return resultSet ;
    Here is the error i am getting when i try to run the jsp script:
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 2 in the jsp file: /ValidateLogon.jsp
    Generated servlet error:
    [javac] Compiling 1 source file
    C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\cms\ValidateLogon_jsp.java:47: cannot find symbol
    symbol : class DatabaseHandler
    location: class org.apache.jsp.ValidateLogon_jsp
    DatabaseHandler db = new DatabaseHandler() ;
    ^

    Just like in the class file you need to import any classes that you want to access in the JSP.
    http://java.sun.com/products/jsp/tags/11/syntaxref11.fm7.html

  • In which folder should i save my jsp file in tomcat

    Hi,
    Actually i have installed j2sdk1.4 as well as Apache tomcat 4.1.2 version. Now i m very confused that in which directory should i save my JSP files to run the files in tomcat.
    If possible pls give me alternate options also.I'll be highly thankful to u.Also is it needed to configure tomcat?
    In waiting
    thanx
    Jassi

    as far as i know, jsp can go anywhere in your webserver directory. if installed correctly that is. its like php, if u know anything about that.

  • Problem in web services wsdl file with tomcat 5

    Hi to all JGurus,
    I am sunil, i have one problem with simple web service, i made a simple web service and deployed on my tomcat 5, my tomcat showing the web service but when i click on the wsdl link it throws the exception:
    javax.servlet.ServletException: JAXRPCSERVLET35: failed to create a template object
         com.sun.xml.rpc.server.http.JAXRPCServletDelegate.doGetDefault(JAXRPCServletDelegate.java:351)
         com.sun.xml.rpc.server.http.JAXRPCServletDelegate.doGet(JAXRPCServletDelegate.java:157)
         com.sun.xml.rpc.server.http.JAXRPCServlet.doGet(JAXRPCServlet.java:111)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    please help me, thanks in advance.

    Hi Rama,
    I used JAX-RPC with WSDp 2.0 first i created my interface then implemented class then i have used the wscompile to generate wsdl. then i packed with jaxrpc-ri and web.xml in a war file, this raw war file i used to generate my original final war with the help of wsdeploy command.
    I deployed this file on tomcat its showing the service but while clicking on wsdl link it throws the above exception.
    Please let me know any thing else u want to know i can fwd my sample war file also to u.
    Thanks in advance.
    Sunil

  • Where to put shared JSP files in Tomcat?

    I'm building two different web applications. Both applications are deployed within Tomcat. Now these applications share some JSP files. I can not figure out where to put JSP files that are shared (with the include directive) among several applications. Can anyone help me?
    Thanx debeumers

    Well, now I'm not so sure anymore. But I have some
    checkboxes I want to share among different
    applications. So why can you share classes and jar
    files and can not share JSP's?Sounds like more trouble than it's worth. Disk space is cheap. I'd deploy them with each app.
    The only thing that would make me hesitate is the DRY principle. In that case, I might have "common" JSPs in my version control. I'd have the Ant script from each Web app check out the same "common" JSPs and build them into WARs. That would keep those JSPs common and not violate DRY. JMO - MOD

  • Not able to run a JSP file in Tomcat 5.5

    Hello friends i am new to JSP programming.
    I recently designed a application to enter values of certain field in a database (Using SQL Server Database)
    i used a file name Register.jsp, so when the action is performed by clicking submit button it use to call another file named Register_DB.jsp in which database insertion is performed this 2nd file includes another .java file which is actually creating the JDBC ODBC connection drivers
    but whenever i use to run the programme using tomcat-5.5 i use to get certain error as below ------------------->
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: Unable to load class for JSP
         org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:591)
         org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    java.lang.ClassNotFoundException: org.apache.jsp.Registration_jsp
         java.net.URLClassLoader$1.run(Unknown Source)
         java.security.AccessController.doPrivileged(Native Method)
         java.net.URLClassLoader.findClass(Unknown Source)
         org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:158)
         org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:71)
         org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:589)
         org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:137)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.
    Apache Tomcat/5.5.9***********************************************************************************************************
    So can anybody tell me what should i do to resolve this error
    here is the code what i have written
    File Name Registration.jsp
    <!--     *****     File Name Test.jsp     *****     -->
    <%@ import="Login.connectionBean" %>
    <%@ language="java" %>
    <%@ import="java.io.*" %>
    <%@ import="java.sql.*" %>
    <%@ import="javax.sql.*" %>
    <jsp:useBean id="sq" scope="page" class="Login.connectionBean" type="connectionBean"/>
         <jsp:setProperty name="sq" property="*"/>
    <html>
    <!-- DW6 -->
         <head>
              <!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
              <title>Registration Form</title>
         </head>
         <body>
              <form name="Test" action="Registration_DB.jsp" method="get">
                   <table width="100%" border="0">
                     <tr>
                        <td colspan="5"></td>
                     </tr>
                     <tr>
                        <td width="10%" height="250"></td>
                        <td width="90%" colspan="4"><div align="center">
                          <table width="437" border="1">
                               <tr>
                                  <td><div align="center">User ID </div></td>
                                  <td> </td>
                                  <td><div align="center">
                                         <input name="User_ID" type="text" size="25" maxlength="25" />
                                  </div></td>
                               </tr>
                               <tr>
                                  <td><div align="center"></div></td>
                                  <td> </td>
                                  <td><div align="center"></div></td>
                               </tr>
                               <tr>
                                  <td width="149"><div align="center">User name </div></td>
                                  <td width="27"> </td>
                                  <td width="239"><div align="center">
                                       <input name="User_Name" type="text" size="25" maxlength="25" />
                                  </div></td>
                               </tr>
                               <tr>
                                  <td><div align="center"></div></td>
                                  <td><div align="center"></div></td>
                                  <td><div align="center"></div></td>
                               </tr>
                               <tr>
                                  <td><div align="center">Password</div></td>
                                  <td> </td>
                                  <td><div align="center">
                                        <input name="Password" type="text" size="25" maxlength="25" />
                                       </div>
                                  </td>
                               </tr>
                               <tr>
                                  <td><div align="center"></div></td>
                                  <td> </td>
                                  <td><div align="center"></div></td>
                               </tr>
                               <tr>
                                  <td><div align="center">
                                    <input name="Button_Reset" type="reset" value="Reset Fields" />
                                  </div></td>
                                  <td> </td>
                                  <td><div align="center">
                                       <input name="Button_Submit" type="reset" value="Submit Details" />
                                                   <%
              String User_Id=request.getParameter("User_Id")
              String User_Name="";
              String Password="";
              %>
              <%
              try
              sq.connect();
              if(user_Id!==null && User_Id!="")
              ResultSet rs2.sq.execQuery("select User_Name FROM User_Login where User_Id='"+User_Id+"'");
              catch(Exception e)
                   out.println("Exception Caught" +e);
                   e.printStackTrace();
              %>
                                       </div></td>
                               </tr>
                               </table>
                        </div></td>
                     </tr>
                   </table>
              </form>
         </body>
    </html>***********************************************************************************************************
    File Name Registration_DB.jsp
    <!--     *****     File Name Test_DB.jsp     *****     -->
    <%@ language="java" %>
    <%@ import="Login.connectionBean" %>
    <%@ import="java.sql.*" %>
    <%@ import="javax.sql.*" %>
    <%@ import="java.io.*" %>
    <jsp:useBean id="sq" scope="page" class="Login.connectionBean" type="connectionBean"/>
         <jsp:setProperty name="sq" property="*"/>
    <html>
         <head>
              <title>Untitled Document</title>
         </head>
    <body>     
              <%
              String Button_Submit = request.getParameter("Button_Submit");
              String User_Id = request.getParameter("User_Id");
              String User_Name = request.getParameter("User_Name");
              String Password = request.getParameter("Password");
              %>
              <%!
              ResultSet rs1=null;
              ResultSet rs2=null;
              %>
              <%
              try
                   sq.connect();
                   if(Button_Submit!=null && Button_Submit!="")
                        String qry="INSERT INTO User_Login (User_Id, User_Name, Password) VALUES('"+User_Id+"','"+User_Name+"','"+Password+"')";
                        int i=sq.executeUpdae(qry);
                        if (i>0)
                             response.sendRedirect("Registration.jsp");
              catch(Exception e)
                   out.println("Exception Caught" +e);
                   e.printStackTrace();
    %>
         </body>
    </html>***********************************************************************************************************
    File name connectionBean.java
    package Login;
    import java.sql.*;
    public class connectionBean
         private Connection con;
         public connectionBean()
              super();
         public boolean connect() throws ClassNotFoundException, SQLException
               Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
               con=DriverManager.getConnection("jdbc:odbc:JAVA"," "," ");
               return true;
         public void close() throws SQLException
              con.close();
         public ResultSet execQuery(String qry) throws SQLException
              Statement stmt=con.createStatement();
              ResultSet rs=stmt.executeQuery(qry);
              return(rs==null)?null:rs;
         public int execUpdae(String qry) throws SQLException
              Statement stmt=con.createStatement();
              int i=stmt.executeUpdate(qry);
              return(i==0)?0:i;
    }

    hi
    here the problem is tat the server culdnt find the class for u page,
    check u hav deployed it properly or not,
    check the tomcat installation and is it working fine,
    regards
    venkat

  • Problem in loading few jsp files

    Hi,
    I am facing problem in loading very few jsp pages. The situation is something like this.
    Server: WebSphere
    I have a top frame and bottom frame.
    When the user keep on clicking the same link in the top frame, not giving time to get loaded in bottom frame,
    on the server the error "Servlet Error: Connection reset by peer: socket write error: java.net.SocketException: Connection reset by peer: socket write error" was coming.
    My bother is not on the server-side. but on the client side.
    On the client side, the html of two requests are getting overlapped and displaying(see at the end for sample output of html). In this HTML, if you observe, you can find the line "Error 500: Connection reset by peer: socket write error
    ". Above to this is the half-content of the previous request and bellow is the actual page need to be loaded. And the output was a merge of actual page with the code of the previous request.
    Is it the problem of Websphere or coding?
    Can you help me resolving this problem?
    thanks
    naveen
    Output HTML (for example):
         Contract Name:</td>
         <td class="Label" ><input type="text" id="contractName"
    size="25" maxlength = "100"></td>
         <td class="Label" >Owner:</td>
         <td class="Label" colspan="2"><select id="owner" class="Label"
    size="1" style="WIDTH:200px">
         <option value="_______________">_____________</option>
         </select></td>
                   </td>
    Error 500: Connection reset by peer: socket write error
    <html>
    <head>
    <title> welcome </title>
    <link rel="STYLESHEET" type="text/css" href="Scripts/SSheet.css">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <!-- This .js script files contains all components, which is used -->
    .... and so on
    </html>

    Hi
    I have Observed that "java.net.SocketException: Connection reset by peer" is caused due to manual malfunction performed by the user in the browser like sending multiple request to the server stopping, moving forward, moving backward when a request is placed to the server and waiting for it to get it done.
    More clearly if the User Selected an option from the browser and send a request to the server and followed by sending another request immediately to the server and by this time Server is processed the first request and is started writing the result to the JSP/Browser (Same client), by this time the 2nd reqest from the same Browser/Client is interrupted the first one and ohhhhhhh..... problem , you got an error "java.net.SocketException: Connection reset by peer".
    If any one could figure out more Please update me too appreciate !
    [email protected]
    Sr. Software Architect

  • Problem in reloading the .lsb file

    Hi All,
    We are using a CIN function to interface an external C code and created the LSB file with required parameters. This was integrated to our LabVIEW code succesfully.
    Later during the progress of the code development, we've created an additional output parameter in this CIN function. Accordingly we've modified the C code and updated the .lsb file.
    We could not reload the latest /lsb file into this CIN funtion because the three options (Relaod code resource, Reload code resource From... and Purge Bad Code Resource) are appearing disabled when we right click on the CIN function.
    Could you pls suggest me where exactly we are going wrong? Will there be any problem in creating additional parameters for the exisiting CIN?
    Thanks in advance.
    -Krishna.

    Krishna,
    It seems like your question is related to the problem mentioned in the following forum:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=242840&requireLogin=False
    At this point I would recommend you to reload all of your CINs by performing a Mass Compile. This KnowledgeBase has more information on how to reload your CINs automatically.
    I hope this helps!
    Mehak D.

  • Urgent: Parameter problem for portlet displaying jsp running inside tomcat

    Following jsp when run with portal 9.0.2 displays value of Name and Age but value of Telephone parameter is displayed as Null. Can anybody tell me the reason?
    Running this jsp on IBM WebSphere.
    <%@ page contentType="text/html;charset=UTF-8" %>
    <%@page import="java.util.*, oracle.portal.provider.v2.*" %>
    <%@page import="oracle.portal.provider.v2.http.HttpCommonConstants" %>
    <%@page import="oracle.portal.provider.v2.render.PortletRendererUtil" %>
    <%@page import="oracle.portal.provider.v2.render.PortletRenderRequest" %>
    <%@page import="oracle.portal.provider.v2.render.http.HttpPortletRendererUtil" %>
    <%@page import="oracle.portal.provider.v2.url.UrlUtils" %>
    <%
    // The form submit URL refers to the current Portal page. All portlets
    // on this page share this URL. This means that the per portlet parameters
    // are in the same request. Portlets must ensure that its paramerters don't
    // collide either with other portlets or other instances of itself. This
    // is generally accomplished by using "fully-qualified" parameter names. A
    // fully-qualified parameter name prepends the (unique) portlet reference to
    // the parameter. The JPDK provides a utility to accomplish this.
    String portletParamName = "mName";
    String portletParamAge = "mAge";
    String portletParamSubmit = "mSubmit";
    String fName = HttpPortletRendererUtil.portletParameter(request, portletParamName);
    String fAge = HttpPortletRendererUtil.portletParameter(request, portletParamAge);
    String fSubmit = HttpPortletRendererUtil.portletParameter(request, portletParamSubmit);
    // These are the session attribute names used to store the current values.
    // Because all instances of this portlet share the same user session we must
    // also fully-qualify these names to avoid collisions.
    String sName = HttpPortletRendererUtil.portletParameter(request, "sName");
    String sAge = HttpPortletRendererUtil.portletParameter(request, "sAge");
    String sTelephone = request.getParameter("TELEPHONE");
    PortletRenderRequest pRequest = (PortletRenderRequest)
    request.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);
    String formName = UrlUtils.htmlFormName(pRequest,null);
    ProviderUser user = pRequest.getUser();
    ProviderSession providerSession = user.getSession();
    if (providerSession == null)
    %>
    Your provider session has been terminated or has timed out
    and you need to logout and then login to re-establish the session.
    <%
    else
    // Record, in session storage, the last values submitted.
    if (pRequest.getQualifiedParameter(portletParamSubmit) != null)
    providerSession.setAttribute(sName, pRequest.getQualifiedParameter(portletParamName));
    providerSession.setAttribute(sAge, pRequest.getQualifiedParameter(portletParamAge));
    %>
    <!-- Output the HTML content -->
    <center>
    <table width="70%">
    <tr>
    <td>
    <b>This portlet shows how to post and process information from HTML forms.</b>
    </td>
    </tr>
    </table>
    <form name="<%= formName %>" method="POST"
    action="<%= UrlUtils.htmlFormActionLink(pRequest,UrlUtils.PAGE_LINK) %>">
    <%= UrlUtils.htmlFormHiddenFields(pRequest,UrlUtils.PAGE_LINK, formName) %>
    <table>
    <tr>
    <td>
    <b>Name :</b>
    </td>
    <td>
    <input type="text" size="20" name="<%= fName %>" value="">
    </td>
    </tr>
    <tr>
    <td>
    <b>Age : </b>
    </td>
    <td>
    <input type="text" size="3" name="<%= fAge %>" value="">
    </td>
    </tr>
    <tr>
    <td>
    <b>Telephone : </b>
    </td>
    <td>
    <input type="text" size="3" name="TELEPHONE" value="">
    </td>
    </tr>
    </table>
    <br>
    <INPUT TYPE=submit name="<%= fSubmit %>" Value="Submit">
    </form>
    <%
    if ((providerSession.getAttribute(sName) == null)&& (providerSession.getAttribute(sAge) == null)) {
    %>
    <b>No values have been submitted yet.</b>
    <%
    } else {
    %>
    <b> Last submitted values:</b><br>
    <table>
    <tr>
    <td>
    <b>Name: </b>
    </td>
    <td>
    <b><%= providerSession.getAttribute(sName) %></b>
    </td>
    </tr>
    <tr>
    <td>
    <b>Age: </b>
    </td>
    <td>
    <b><%= providerSession.getAttribute(sAge) %></b>
    </td>
    </tr>
    <tr>
    <td>
    <b>Telephone: </b>
    </td>
    <td>
    <b><%= sTelephone %></b>
    </td>
    </tr>
    </table>
    <%
    %>
    </center>
    <%
    %>
    <!-- End output the HTML content -->
    Can somebody please help me on this?
    Thanks

    Hello,
    Let me know if the answer that I made Help needed: JSP and portal parameter problem.
    Regards
    Tugdual Grall

  • Calling a java class in a JSP file

    Hello,
    I have a jsp file in which I call a java class.
    I work with Tomcat 4.0.1
    If I modify the java class and then I execute my JSP, it still be the old version of my class that is executed.
    I don't understand why since if I creates a main function and I execute it, it works correctly!
    Do you know what is the problem?
    Thanks

    i also have this problem.when i modify jsp file,it didn't execute inmediately. Then i restart tomcat,but problem also exist.
    a few minute age,i execute jsp file again,it can appear the modified jsp.i don't down why
    i work tomcat 5.0 windowxp

  • Error in running JSP files

    Hi,
    This is the first time I post message on the forum. The problem is that when I run the JSP files with Tomcat 4.0.1. It give the error messages. But I have put the class files under the root, such as ...\WEB-INF\classes, however, it doesn't work. Also I have set the classpath for tomcat. Is there any step I have missed?
    Please give me some solution as the problem has annoyed me for a long time.
    The error message is:
    org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
    An error occurred at line: 1 in the jsp file: /qms1_src/blank.jsp
    Generated servlet error:
    C:\Tomcat 4.0\work\localhost\_\qms1_src\blank$jsp.java:56: Class org.apache.jsp.DBSession not found.
    DBSession sess = null;
    ^
    An error occurred at line: 1 in the jsp file: /qms1_src/blank.jsp
    Generated servlet error:
    C:\Tomcat 4.0\work\localhost\_\qms1_src\blank$jsp.java:59: Class org.apache.jsp.DBSession not found.
    sess= (DBSession)
    ^
    An error occurred at line: 1 in the jsp file: /qms1_src/blank.jsp
    Generated servlet error:
    C:\Tomcat 4.0\work\localhost\_\qms1_src\blank$jsp.java:64: Class org.apache.jsp.DBSession not found.
    sess = (DBSession) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "DBSession");
    ^
    3 errors, 1 warning
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:284)
         at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:546)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177)
         at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:189)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:201)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:163)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1011)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106)
         at java.lang.Thread.run(Thread.java:536)

    Confused yet.
    Here's the deal. Every Java class is in a package. If it is not declared the it is the default package but the default package is based on the directory it is in.
    The DBSession class is in WEB-INF/classes and the jsp gets compiled into a class file that is placed in a different directory. Since the two class files are in different directories they are in different default packages. Thus the import.
    Most people don't run into this because they put their tags into packages and import the packages.
    To make everybody happy, put your tag in a package, recompile it and then import the package.

Maybe you are looking for