aspose file tools
The moose likes Servlets and the fly likes Scriptlet ... Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Scriptlet ..." Watch "Scriptlet ..." New topic
Author

Scriptlet ...

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
if a particulat scriptlet is repeated in several places withing a JSP..what JSP V1.0 tag would be best to code this?
JSP Expression ? TagLib directive? or JSP declaration..?
Tony Alicea
Desperado
Sheriff

Joined: Jan 30, 2000
Posts: 3219
JSP 1.0 does not support custom tags. Only JSP 1.1.
Sounds like a "job for" <jsp:include page="scriptlet.jsp"/>
Off the top of my head (or what's left of it!), you could code the scriptlet solely in that JSP.
Admonition: (In general) don't use scriptlets especially in Enterprise environments where HTML coders and so-called "Page Designers" are the ones who are going to be "doing" the JSPs.
They are not programmers (nor do they play one on TV!) and they wish they didn't have to learn Java just to keep their jobs.
This need has been recognized from day one and in the "old days", the name "Architecture type 2" was coined for the architecture in which "presentation" (the coding of a JSP which of course is translated to HTML so any browser can see it) is as much separated as possible from business logic (the "if then elses" and new thisOrTheOther() of Java code etc...)


Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Scriptlet ...
 
Similar Threads
Login/Register based web page presentation
scripting-invalid
extending a servlet
scriptlet
tag body-content JSP