sample jsp servlet application required

Discussion in 'Java' started by ramiz, Jul 16, 2006.

  1. ramiz

    ramiz Guest

    Hi geeks,
    I'm a beginner in jsp and servlets, i want a sample JSP-SERVLET
    applicaton with source code. Can you please tell me where can i get the
    sample applications.
    Thanks in advance...
     
    ramiz, Jul 16, 2006
    #1
    1. Advertising

  2. ramiz

    Guest

    Here is the simplest :))


    =======================================================
    index.jsp :


    <html>
    <body>
    <jsp:useBean id="myBean" class="MyServlet" scope="session"/>
    Here is the value of the String from the Servlet:
    <%= myBean.getMyString() %>

    </body>
    </html>


    =======================================================
    MyServlet.java



    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;

    public class MyServlet {

    public String getMyString(){

    return "This is my return String";

    }

    }

    =======================================================

    And that should be it. :))
     
    , Jul 16, 2006
    #2
    1. Advertising

  3. ramiz

    Mark Space Guest

    ramiz wrote:
    > Hi geeks,
    > I'm a beginner in jsp and servlets, i want a sample JSP-SERVLET
    > applicaton with source code. Can you please tell me where can i get the
    > sample applications.
    > Thanks in advance...
    >


    Doesn't Tomcat install a default application? I'm sure it does,
    although I'm not certain that it installs any JSP servlets. I think it
    does because you can self test Tomcat with some of the default servlets.

    Anyhoo, check your default app, probably some good examples there.
     
    Mark Space, Jul 16, 2006
    #3
  4. ramiz

    ramiz Guest

    wrote:
    > Here is the simplest :))
    >
    >
    > =======================================================
    > index.jsp :
    >
    >
    > <html>
    > <body>
    > <jsp:useBean id="myBean" class="MyServlet" scope="session"/>
    > Here is the value of the String from the Servlet:
    > <%= myBean.getMyString() %>
    >
    > </body>
    > </html>
    >
    >
    > =======================================================
    > MyServlet.java
    >
    >
    >
    > import javax.servlet.*;
    > import javax.servlet.http.*;
    > import java.io.*;
    >
    > public class MyServlet {
    >
    > public String getMyString(){
    >
    > return "This is my return String";
    >
    > }
    >
    > }
    >
    > =======================================================
    >
    > And that should be it. :))


    thanks for ur reply

    regards,
    ramiz
     
    ramiz, Jul 17, 2006
    #4
  5. ramiz

    ramiz Guest

    Mark Space wrote:
    > ramiz wrote:
    > > Hi geeks,
    > > I'm a beginner in jsp and servlets, i want a sample JSP-SERVLET
    > > applicaton with source code. Can you please tell me where can i get the
    > > sample applications.
    > > Thanks in advance...
    > >

    >
    > Doesn't Tomcat install a default application? I'm sure it does,
    > although I'm not certain that it installs any JSP servlets. I think it
    > does because you can self test Tomcat with some of the default servlets.
    >
    > Anyhoo, check your default app, probably some good examples there.


    thanks for ur reply
    regards,
    ramiz
     
    ramiz, Jul 17, 2006
    #5
  6. ramiz

    shwetaoberoi

    Joined:
    Apr 24, 2008
    Messages:
    2
    hi i m new to j2ee application wants to creat e a new web application. plz help me . i have apache tomcat, and eclipse 3.0.1 installed with me.
    plz tell how 2 create servelet class,
     
    shwetaoberoi, Apr 24, 2008
    #6
  7. ramiz

    shwetaoberoi

    Joined:
    Apr 24, 2008
    Messages:
    2
    J2EEApplication

    Hi
    I would like 2 know how 2 create the web application...in j2ee with Jsp and servlet. and got 2 know that v have 2 create .. own directory structure. and or it 'll automatically created.. with eclipse/...
    tell me ASAP...
     
    Last edited: Apr 24, 2008
    shwetaoberoi, Apr 24, 2008
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jake
    Replies:
    0
    Views:
    605
  2. circuit_breaker
    Replies:
    2
    Views:
    2,081
    Jack Jia
    Apr 4, 2004
  3. javadev
    Replies:
    5
    Views:
    13,087
    javadev
    Nov 16, 2006
  4. Replies:
    4
    Views:
    844
  5. Tim Chase
    Replies:
    0
    Views:
    98
    Tim Chase
    Feb 16, 2014
Loading...

Share This Page