aspose file tools*
The moose likes Servlets and the fly likes I want to write a jsp in servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "I want to write a jsp in servlet" Watch "I want to write a jsp in servlet" New topic
Author

I want to write a jsp in servlet

rames tirrupur
Greenhorn

Joined: Jul 25, 2006
Posts: 13
Hi,

I want to have a jsp in servlet.when i call that servlet, in built jsp should call database, fetch values and load it in jsp.

Suggest me how to approach this.

Thanks,
ramesh
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Is there a good reason to do this ? Why don't you call the database stuff from a servlet and pass the data to a JSP ?


[My Blog]
All roads lead to JavaRanch
Pratibha Malhotra
Ranch Hand

Joined: Dec 21, 2003
Posts: 199
Hi Ramesh,

What are you trying to do here?
A Jsp in Servlet, that to for Database operations.

I want to have a jsp in servlet.when i call that servlet, in built jsp should call database, fetch values and load it in jsp.


Hmmm, Definatly not a good Architecture. Infact if I may say so, there is no Architecture at all.

What comprise your UI here?

JSP/JSF -> Servlet -> Facade -> DAO -> Database
is the flow we generally follow.

If you some specific business requirement to do stuff like you have decided to do, Pls elaborate more
[ July 31, 2006: Message edited by: Rewa Dev ]

~ Pratibha Malhotra<br /> <br />Sun Certified Java Programmer<br />SCEA 1.4 (In Progress)<br />~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />"Many of life's failures are people who did not realize how close they were to success when they gave up!!"
rames tirrupur
Greenhorn

Joined: Jul 25, 2006
Posts: 13
Hi,

Yes. what satao is telling right and I need the same to be done.

Suggestion on this how to approach.

Thanks,
Ramesh
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Look at the API for the RequestDispatcher interface.

If you look up MVC or "Model View Controller" you will find lots of information on this subject.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60058
    
  65

You may also find this article interesting.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I want to write a jsp in servlet
 
Similar Threads
how to call Jsp in servlet
.EAR FILES
Servlet to Jsp parameter calling
how to call jsp page from servlet
Login Page creation help