Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > sample jsp servlet application required

Reply
Thread Tools

sample jsp servlet application required

 
 
ramiz
Guest
Posts: n/a
 
      07-16-2006
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...

 
Reply With Quote
 
 
 
 
dimebt@gmail.com
Guest
Posts: n/a
 
      07-16-2006
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. )

 
Reply With Quote
 
 
 
 
Mark Space
Guest
Posts: n/a
 
      07-16-2006
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.
 
Reply With Quote
 
ramiz
Guest
Posts: n/a
 
      07-17-2006

http://www.velocityreviews.com/forums/(E-Mail Removed) 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

 
Reply With Quote
 
ramiz
Guest
Posts: n/a
 
      07-17-2006

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

 
Reply With Quote
 
shwetaoberoi shwetaoberoi is offline
Junior Member
Join Date: Apr 2008
Posts: 3
 
      04-24-2008
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,
 
Reply With Quote
 
shwetaoberoi shwetaoberoi is offline
Junior Member
Join Date: Apr 2008
Posts: 3
 
      04-24-2008
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 by shwetaoberoi; 04-24-2008 at 07:28 AM.. Reason: To give the detailed info...
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening new child window - Running servlet (JSP and Servlet) agapitolw@yahoo.es Java 4 08-27-2007 12:57 PM
Servlet.service() for servlet jsp threw exception java.lang.IllegalStateException: getOutputStream() has already been called for this response javadev Java 5 11-16-2006 11:22 AM
[JSP] difference between jsp:forward and jsp:include alexjaquet@gmail.com Java 0 06-02-2006 01:21 PM
Session variable in JSP/servlet application Steve Sobol Java 5 02-16-2006 04:17 AM
Servlet question(Tomcat, web.xml, servlet-class, servlet-name) circuit_breaker Java 2 04-04-2004 03:26 AM



Advertisments