Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Implication of having code inside jsp.

Status
Not open for further replies.

Derf123

Programmer
Apr 19, 2011
2
HI everyone.
I stepped on a web application where there's a lot code in the jsp's. I also heard that this application has performance issues. I would like to know if it could be related.

Also, i would like to have an idea of the implication of having long scripts (java) inside jsp's. Is the code executed client side instead of server side? Would it be better to have some kind of back end execute this code?
 
I'm a .net developer, but I'm assuming jsp is very similar to aspx. if this assumption is correct then code in the jsp is the template for how to render dynamic content.

the problem with large amounts of code/logic in the view is that it's difficult to test. you could put the same code in another object to assist with testing, but that doesn't make it faster. it can still suffer from the same poor performance.

you will need utilities (profilers) to pinpoint and quantify where the bottleneck is. you will want to profile the code and the sql queries (assuming there is a relational database involved) typically this is the place to gain the biggest performance boost: optimizing sql queries and balancing the number of remote calls with the volume of data returned by the queries.

Jason Meckley
Programmer

faq855-7190
faq732-7259
 
First of all, thanks for your support.
Yes, there's a database involved. There's even some sql queries in the jsp's.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top