advantage of using JSP tag over Java code

J

jrefactors

I want to know the advantage of using JSP tags over Java code?

For example,

<jsp:setProperty name="beanInstanceName" property="propertyName" /> is
using the JSP tag.

But we can also write Java scripplet code
<% beanInstanceName.setPropertyName(); %>

Another example is

<jsp:getProperty name="beanInstanceName" property="propertyName" /> and
beanInstanceName.getPropertyName();

Please advise.
thanks!!
 
R

Robert Maas, see http://tinyurl.com/uh3t

From: (e-mail address removed)
I want to know the advantage of using JSP tags over Java code?
For example,
<jsp:setProperty name="beanInstanceName" property="propertyName" />
is using the JSP tag.
But we can also write Java scripplet code
<% beanInstanceName.setPropertyName(); %>

I see two advantages to pure XML JSP code without any scriptlets:

Practical advantage:
A validating XML parser is sufficient to detect all syntax errors in
pure XML/JSP code but can't understand scriptlets. Furthermore an
XML-based tool can extract a symbol table from such XML/JSP code, i.e.
a simple list of all properties that have been setted or getted. If the
manifest for your library's public interface is also written in XML,
then an XML tool can then likewise extract the symbol table of
definitions from your manifest file, and then check the calls against
the definitions to verify that the XML/JSP file isn't trying to set or
get anything that isn't defined in the java library.

Political advantage:
If you work in a highly fragmented company, where one group of
employees knows java but doesn't know any HTML, and another group knows
HTML/XML but doesn't know any java, and neither group is allowed to
tresspass into the other's work by learning any skill belonging to the
other group, then the HTML/XML only group can edit the pure XML/JSP
files without violating company rules.

Now I'm just a beginner in this topic, so somebody more knowledgeable
please fill in anything I've overlooked.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top