PDA

View Full Version : Servlets



Xull
6th January 2009, 12:00 AM
so... I'm a bit sick of servlets taking away basic functionality that I take for granted...
thought I'd find out some reasons from people who might be more familiar with them :p

main points
multiple instances of the site (eg, wanting to view a list of search results and a specific entry in two different tabs, or one page with info and another with a related form to fill out) back button

anyway, is that simply a limitation of servlets, lazyness on the site coder's part, or some other thing?
I'm assuming servlets are quite capable of fully functioning, but given that every one I can think of has the same symptoms - can't open multiple copies and they can't handle the back button properly, I'm guessing it's quite inconvenient for the coder.
Any word on that?

I'm also curious about the speed... I find servlets to have quite slow response speed compared to most every other site I use with similar (actually, more) functionality... most of which being php but I've found perl scripts to be faster too. I'd understand it much more if it were just the first access, but I'm talking about consistent usage.

snoop
7th January 2009, 09:32 AM
It's not really a limitation of servlets in general so much as a limitation of data passed through the URL followed by a redirect... You know when you go to a site that has all sorts of shit like

blah.jsp?cocks=invaginas&longcat=looooooooong&sessionid=123oefihj23489awefhasdfasdf&pageid=323&booze that then refreshes to blah2.jsp without a long URL?

That and a lot of people also use post data between different pages, like "click this button to continue" rather than using data in cookies and sessions. The URL thing would be perfectly understandable and allowable without the redirect afterwards that a lot of people use.

Servlets are actually a lot faster than the scripted languages for larger applications... If you're talking about JSP. Also you need a lot of server to run them a lot of the time... and underpowered servlet will be slow, a properly powered one will outperform PHP on the same hardware, and under really high loads the servlet will still be available and PHP will slow close to a crawl. Really the speed advantage has to do with precompiling and the stylistic advantages of java.

The other issue with JSP servlets is doing it right. You really can't just write it like any other web app. Many web app developers do not realize that, or are just not talented enough to write efficient java code.

Carnage
4th February 2009, 03:51 PM
My latest site project is based written in python using (if i can get it working) mantisa if not twisted and nevow. As i understand it, this is a fairly similar developement concept to using jsp and servlets.

From what i've seen with my test sites, the problems you describe dont exist. So, it is possible to do it right; weather its a limitation of jsp or lack of programmers skill I dont know thou.