How to run jsp using javabean class in tomcat

hello all,
i have bean class placed in classes folder of tomcat and placed jsp and html in root directory. i am not able to run it , if i have do any setting in web.xml, pls let me know from u

No XML required, but you must put the class into a package.
Packages are folders with some files that identify whats in them, so you will end up with something like
yourWebbApp/classes/yourPackage/yourClass

Similar Messages

  • How to run jsp using  tomcat server?

    hai friends,
    i'm using jsp for my application and for that i'm using tomcat server.
    i was runing my jsp files like this
    http://localhost:8080/examples/jsp/myapp/index.jsp but instead of this
    i need to run my jsp files like this
    http://localhost:8080/myapp/index.jsp
    what r the changes that i should do in tomcat installation to run myapplication in such a way.
    thanks in advance

    you need to redefine the server root...
    for that do the following...
    copy all the directory tree rooted at
    JAKARTA-HOME/webapps/ROOT/examples/jsp/myapp/ to
    JAKARTA-HOME/webapps/ROOT/myapp/
    -OR-
    in the server.xml, search for "Tomcat Root Context" and un-comment the code defining Root Context...
    change the docBase value from "ROOT" to "ROOT/examples/jsp"
    that shud help...
    -Pranav
    hai friends,
    i'm using jsp for my application and for that i'm
    using tomcat server.
    i was runing my jsp files like this
    http://localhost:8080/examples/jsp/myapp/index.jsp but
    instead of this
    i need to run my jsp files like this
    http://localhost:8080/myapp/index.jsp
    what r the changes that i should do in tomcat
    installation to run myapplication in such a way.
    thanks in advance

  • How to run exception using JSP?

    How to run exception using JSP?

    Why would you need the <%%> between the if else blocks? Even if you attempt to write some data within the blocks in java, you will still get an error. For example, this is illegal:
    if(done)
        System.out.println(true);
    System.out.println("Hello World");
    else
        System.out.println(false);
    }The compiler is expecting the 'else' to be directly after the body of the if. If it encounters anything else, it will complain. So you cannot do this in jsp either, regardless if it's a different technology, it's the same compiler.

  • The deployment problem in JSP using JavaBean

    Hi there,
    I followed the descriptions in Writing Enterprise Applications with
    Java 2 SDK, Enterprise Edition tutorial to build a set of programs to run JSP with JavaBean, and I also followed the steps in creating new WAR file, but some how it wouldn't work after I deployed them. I run the JSP in IE and got a message like this:
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 20 in the jsp file: /1bonus.jsp
    Generated servlet error:
    c:\j2sdkee1.3.1\repository\orbit\web\JSPRoot\$1bonus$jsp.java:63: Class org.apache.jsp.JBonusBean not found.
    JBonusBean jbonus = null;
    ^
    I used the deploytool to create the WAR file, and after I added the 1bonus.jsp, I also added JBonusBean into the WAR file. I found 1bonus.jsp was added into the WAR file, but there's no JBonusBean appeared under the WAR file.
    Could you please tell me is there anything wrong?
    Thanks for your time.
    Regards,
    Eric

    I think you have not imported 'BonusBean' in your jsp. Code this line in your jsp at the top.
    <%@page import="BonusBean" %>
    Sudha

  • How to run jsp file in Apache Tomcat 5.0?

    hi,
    i'm using jdk1.5,jsp1.2 & Apache Tomcat 5.0 as a web server.in my application i have 2 jsp files,1 html file & 1 javabean class.where i must place the html,jsp files and the .java file & .class file for a bean class.how to run this application.
    bean class:
    public class Userdata {
    private String username;
    private String email;
    private int age;
    public void setUsername( String value )
    username = value;
    public void setEmail( String value )
    email = value;
    public void setAge( int value )
    age = value;
    public String getUsername() { return username; }
    public String getEmail() { return email; }
    public int getAge() { return age; }
    getname.html file:
    <HTML>
    <BODY>
    <FORM METHOD=POST ACTION="Savename.jsp">
    What's your name? <INPUT TYPE=TEXT NAME=username SIZE=20><BR>
    What's your e-mail address? <INPUT TYPE=TEXT NAME=email SIZE=20><BR>
    What's your age? <INPUT TYPE=TEXT NAME=age SIZE=4>
    <P><INPUT TYPE=SUBMIT>
    </FORM>
    </BODY>
    </HTML>
    savename.jsp file:
    <jsp:useBean id="user" class="Userdata" scope="session"/>
    <jsp:setProperty name="user" property="*"/>
    <HTML>
    <BODY>
    Continue
    </BODY>
    </HTML>
    nextpage.jsp file:
    <jsp:useBean id="user" class="Userdata" scope="session"/>
    <HTML>
    <BODY>
    You entered<BR>
    Name: <%= user.getUsername() %><BR>
    Email: <%= user.getEmail() %><BR>
    Age: <%= user.getAge() %><BR>
    </BODY>
    </HTML>
    refer these source code and plz,give the result at the earliest.
    whether i want to write a web.xml file for this jsp file.
    if yes,means plz present the web.xml file for this application.
    plz,if anybody knows give me detailed description for this application.

    create a dir under webapps dir
    place your .html and .jsp files here
    also create WEB-INF dir here
    Under WEB-INF create classes and lib dir
    under classes dir put your .class file
    You also need to put web.xml under your WEB-INF dir.
    You ca keep your java file any where u want on your computer.

  • How to run jsp in tomcat server

    hi this is satish1529,
    i am new to jsp technology,i have written small jsp file and html file,i don't know where to place jsp and html files in tomcat server and where i have to do setting in the server and how to run jsp file. pls give me step by step describing how to run jsp in tomcat server.
    i am showing u files
    this is jsp file
    <html>
    <body>
    <center> data recieved from client <center>
    <%
    String s= request.getParameter("t1");
    String a= request.getParameter("t2");
    %>
    username :<%=s%><br>
    address :<%=a%>
    </body>
    </html>
    this is html file
    <html>
    <body>
    <form action="http://localhost:8080/form.jsp">
    enter name <input type="text" name="t1"> <br>
    enter address <textarea name="t2"> </textarea> <br>
    <input type="submit" vaule="login">
    </form>
    </body>
    </html>

    Thanx a lot for ur promt reply.
    we r succful in running simple jsp in tomcat6.0.
    bt one more problem occured as following when we r trying to run jsp file in tomcat.
    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: /main1.jsp(1,1) The value for the useBean class attribute webCounter is invalid.
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
         org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
         org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
         org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1200)
         org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1155)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
         org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
         org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2392)
         org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
         org.apache.jasper.compiler.Generator.generate(Generator.java:3374)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:210)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    note The full stack trace of the root cause is available in the Apache Tomcat/6.0.13 logs.

  • How to Run JSP in Tomcat Server 3.3.2

    Hi all,
    i have just installed tomcat server 3.3.2 in my system which as windows xp home edition as a operating system and no problem i can able to start the tomcat server.But the problem is that i dont no how to run jsp in tomcat i listed some of my problems below..
    How to put my jsp file in the virtual directory(default and also i want to create ) then tell me how use IE to run the JSP file.
    Thanks in advance..
    With Regards
    Vijay

    Hi all,
    i have just installed tomcat server 4.1 in my
    system which as windows NT 4.0 home edition as a
    operating system and no problem i can able to start
    the tomcat server.But the problem is that i dont no
    how to run jsp in tomcat i listed some of my problems
    below..
    How to put my jsp file in the virtual
    directory(default and also i want to create ) then
    tell me how use IE to run the JSP file.
    Thanks in advance..
    With Regards
    Baliram

  • How to run jsp in weblogic server

    hi,
    how to run jsp application in weblogic server,plz send the procedure how to deploy..
    Thanks

    How to run JSP and EJB program using weblogic server

  • How to run JSP in Tomcat

    Hi i am new to java web application, i am running JSP(edited in notepad) in tomcat
    <html>
    <head>
    <title>first jsp page</title>
    </head>
    <body>
    <%! String st = "shyam your JSP Code" %>
    Welcome ::<%= st %>
    </body>
    </html>
    i saved this jsp as first.jsp and D:\shyam\Apache Software Foundation\Tomcat 5.0\webapps\ROOT putting jsp in this folder.
    then started tomcat webserver
    then opeand browser giving URL: http://localhost:8080/first.jsp
    the error coming like--> HTTP status 500
    exception
    org.apache.jasper.JasperException: Unable to compile class for JSP
    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
    Error coming like this, plz tell how to rectify this, I want to set any thing in web.xml, tell where i did mistake.

    hi,
    your problem is you didn't set java home in your path..
    before running your application create a ".bat" file like,
    set JAVA_HOME="path where you installed jdk eg: c:\jdk1.5";

  • How to run jsp program

    is i can able to run my jsp program by using appache server..

    To get JSP working in Apache HTTP Server you have to install Apache Tomcat.
    You can either choose to run JSP's solely on Apache Tomcat, or to use mod_jk2 to link Apache HTTP Server with Apache Tomcat so that the Apache HTTP Server can forward the JSP requests to the Apache Tomcat engine, because the Apache HTTP Server really doesn't know how to compile/run JSP's.

  • How to run JSP/Servlet in AIX?

    how to run JSP/Servlet in AIX?
    I am no ideas about it,
    can anyone tell me?
    what webserver i should use?
    have to install JDK?

    The only successful way that I have been able to run servlets in an AIX environment is with the IBM Http Server (specific version of Apache)/WebSphere combination, with WebSphere as the servlet engine. I have tried (unsuccessfully) to use JRun and Apache in AIX environment, but could never get JRun to function properly.

  • How to run JSP pages in weblogic 8.1 sp2

    hi frnzs,
    plese give me some idea about how to run JSP pages in weblogic server.

    enen i dont know hw to fly palne otherwise i can definitely give u sm guides abt that......

  • How to run VI using bolean control?

    How to run VI using bolean control? Do I need to use invoke node or something else?
    Thank you in advance.

    You cannot start running a vi using a boolean on the front panel of that same VI. Detecting the state of the control requires the VI to be running.
    Maybe you can clarify WHY you need to do this. The run button is for VI development. Once you have a final application, it should be set to "run when opened". The actual code could start out in a wait loop (or wait event) such that pressing a certain button will trigger execution of the main code as needed.
    LabVIEW Champion . Do more with less code and in less time .

  • How to run java using xcode?

    i have to install "java developer " but i can't find, where i can run Java, Please give me information about "how to run java use xcode " ?

    Download the SDK from Oracle, code, enjoy.

  • Running JSP 2.0 pages on Tomcat 4.1

    I have web-application written in JSP 2.0. I use custom tags in tag-files and EL.
    How can I run this application on hoster's Tomcat 4.1 server.

    But hoster do not have Tomcat 5 :( only Tomcat 4.1
    May I run JSP 2.0 app on Tomcat 4.1 with some tricks

Maybe you are looking for

  • I just cut and pasted photos from the phone into my HP and now I can't open the files in the computer.

    I just cut and pasted photos from my Iphone into my HP. NOw when I go and try to open the files from the computer it's giving me an error: INVALID IMAGE The file format is not supported or is invalid WHat's confusing is that all files copy into my co

  • UDF help

    Dear All, Kindly let me know what am I doing wrong in the below code? I am getting errors in the UDF ... int I_Length = 0; int H_Count = 0; String flag; H_Count = I_Val.replaceAll("-","").length();  // Count all "-" in the string I_Length = I_Val.len

  • System Management container in Multidomain environment (same forest)

    Greetings, The scenario is the following: 1 root domain. 5 child domains. The schema was extended for Win2008 R2. 1 primary parent SCCM site (implemented in a child domain. 1 sccm server). 4 primary child SCCM sites (implemented in the 4 remaining ch

  • Music playlists do not play in order

    Music playlists do not play in order. How do turn off that function and get playlists to play in order?

  • PLS-00394 error

    Hi i have create a procedure to retrieve data and when i compile i receive an error with this "PLS-00394- wrong number of values in the INTO list of a FETCH statement" here is the code vLine VARCHAR2(4000); CURSOR CurseurCRC IS SELECT O.OPPORTUNITY_I