Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is it just my imagination, or is dynamic jsp a mess?

 
Joe McIntyre
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is not a sarcastic question. I am on HF chapter 10 - custom tag development. By now I'm bewildered at the complexity of putting dynamic stuff in a jsp. Standard action, scripting, custom tags and so forth - it seems like a schizophrenic mess. My question is as follows: Is it really a schizophrenic mess, or is all this stuff just a natural consequence of trying to keep java out of a JSP, and make the stuff in a JSP friendly for web page designers?

And here's another question. I remember back in the foggy beginnings of all this, they said that proper use of MVC would eliminate everything smacking of control logic from the JSP. So are we memorizing most of this stuff just for the test, or are JSPs in the real world full of this stuff as well?

Again, this is really an honest question, not a rant. I'm just trying to make sense of what I'm learning and why. Thanks for any insight.
 
Kishore Dandu
Ranch Hand
Posts: 1934
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sure is. It is beyond imagination for a some one who tries for readable, clean development approaches.

That is why other alternatives like JSF, Velocity are getting some traction.
 
Joe McIntyre
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do JSF and/or Velocity relate to Struts? How do they deal with the problem?
 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using JSP and JSTL (in few words there is no a Java line of code in my JSPs) and I must tell you that I've never found that easy separating the HTML from the part of the Controller which is responsible for delegating business behaviour to the Model. I remember that once, I downloaded an open source portal (it was working well, anyway); I opened the first JSP...and I closed the editor immediately. I felt sick. It was full of Java code.

I find JSTL easy to use. As an example, our designer at work (who hasn't got a clue about Java), designs our JSPs using JSTL, and it creates some very nice websites. All I had to do was to introduce him to the concept of Value object and scopes, and now he works in complete autonomy. He has also realized a page that transforms a XML file into HTML through XSL (with the <x:...> family)
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nowadays, more and more people tend to use custom tags to replace JSP scriptlet, developers keep on developing new features on the custom tags.

I think this maybe a good way for readiblilty, however, this introduces a bigger problem: taglib versions.

As you may know, you may develop your own tag, but at the same time, Struts, JSTL, JSF, etc, got their own taglib as well.

This always makes me feel painful, when we try to migrate or make use of the features of these technologies.

Nick
 
Mary Wallace
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nowadays, more and more people tend to use custom tags to replace JSP scriptlet, developers keep on developing new features on the custom tags.


Will that affect performance?

For some case using custom tags is good to avoid lot of code. but in some case
is it necessary to use custom tag?
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since JSPs are complied once, and thus, I suppose the 1st time the page was invoked maybe slow (due to the compliation with those taglibs), the general performance should be ok.

Nick
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic