aspose file tools*
The moose likes JSP and the fly likes Can Replace completely Servlet with JSP? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Can Replace completely Servlet with JSP?" Watch "Can Replace completely Servlet with JSP?" New topic
Author

Can Replace completely Servlet with JSP?

chinu goyal
Greenhorn

Joined: Dec 31, 2007
Posts: 22
Hi

Can we replace completely Servlet with JSP in our code . If not what's reason
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Ouch. Check what JSP are really used for in this FAQ.


[My Blog]
All roads lead to JavaRanch
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61187
    
  66

That's like asking "Can a hammer be used to replace all the other tools in the toolbox?"

Do you really want to try and saw boards with a hammer?

JSPs should be used as view components only. Servlets are required for performing control and processing.

You might want to also read this article.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41800
    
  62
Apart from the good reasons already mentioned, JSPs can't handle binary content, whereas servlets can.


Ping & DNS - my free Android networking tools app
chinu goyal
Greenhorn

Joined: Dec 31, 2007
Posts: 22
what binary content like sounds, streaming video, pdf files . But Streaming video , pdf files we can do by JSP also .

So I think Processing , Controlling are the things which can't be handled by JSP . Am I Correct
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41800
    
  62
But Streaming video , pdf files we can do by JSP also .

No, you can't. It may incidentally work in some special cases, but generally it doesn't.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

chinu goyal wrote:So I think Processing , Controlling are the things which can't be handled by JSP . Am I Correct

No. JSPs *are* servlets once the JSP is compiled. You *can* do all of that with a JSP. You *shouldn't*.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can Replace completely Servlet with JSP?