aspose file tools*
The moose likes Servlets and the fly likes How to use both JSP and Servlets in an application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to use both JSP and Servlets in an application" Watch "How to use both JSP and Servlets in an application" New topic
Author

How to use both JSP and Servlets in an application

Sunny Raj
Greenhorn

Joined: Apr 23, 2002
Posts: 6
Is it possible to use both JSPs and Servlets in developing a single application? Call Servlets from JSPs?
I am fairly new to server-side programming and I was looking for tutorials on this subject but have been unsuccessful so far. Can anyone help?
Thanks.
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8898

It is possible to call servlets from JSP and vice-versa. For tutorial on servlets visit http://java.sun.com/docs/books/tutorial/servlets/ and http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Servlets.html.
For JSP http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPIntro.html.


Groovy
Gagan Indus
Ranch Hand

Joined: Feb 28, 2001
Posts: 346
Links at this page might help too :
http://www.javaranch.com/scwcdlinks.jsp


Gagan (/^_^\) SCJP2 SCWCD IBM486 <br />Die-hard JavaMonk -- little Java a day, keeps you going.<br /><a href="http://www.objectfirst.com/blog" target="_blank" rel="nofollow">My Blog</a>
Jessica Sant
Sheriff

Joined: Oct 17, 2001
Posts: 4313

And two more resources.... check out Core Servlets and JavaServer Pages by Marty Hall -- it's available online. It covers the Servlet 2.2 and JSP 1.1 specifications.
More Servlets and JavaServer Pages by Mary Hall is the follow-upbook which covers the Servlet 2.3 and JSP 1.2 specifications.
Both are excellent books.


- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
Darryl Failla
Ranch Hand

Joined: Oct 16, 2001
Posts: 128
Thanks for the information. You always learn something when you visit the Ranch.


Darryl Failla
Sun Certified Java 2 Programmer
Angela Margot
Ranch Hand

Joined: Feb 07, 2002
Posts: 80
Marty's tutorial on Servlets is at:
http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/
And yup, you can implement servlets in JSP!


Angela Margot <img src="smile.gif" border="0"> <br />Sr. Software Engineer<br />SCJP2 SCWCD MCSD MCP
arun sahni
Ranch Hand

Joined: Jan 16, 2002
Posts: 91
After learning you can use MVC framework like Struts to make life easier.


Arun Sahni<br />SCJP2,SWCD,<br />BEA Certified Specialist: Server <br />JCert Enterprise Developer for BEA.
Sunny Raj
Greenhorn

Joined: Apr 23, 2002
Posts: 6
Thanks for all the information. So far, it is only in the "Core Servlets..." book by Marty Hall that I noticed a chapter on "Integrating JSPs and Servlets". While I am waiting to get this book, can someone give me a quick example of how a Servlet can be called from a JSP? I know how to call beans and XML parsing and SAX etc.
Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to use both JSP and Servlets in an application
 
Similar Threads
Listener in JSP
Do web container and ejb conatiner share the same JVM
Is Tomcat an app server.
diff b/w servlet&jsp
Struts-config.xml