File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can Replace completely Servlet with JSP?

 
chinu goyal
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Can we replace completely Servlet with JSP in our code . If not what's reason
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ouch. Check what JSP are really used for in this FAQ.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64205
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apart from the good reasons already mentioned, JSPs can't handle binary content, whereas servlets can.
 
chinu goyal
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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*.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic