How are Standard bean action tags useful

Using standard bean action tags helps the web page designer in understanding the things better . And it is easy to maintain for the programmer.
I want to know if there is any improvement in terms of performance... like ... is the page loading time less if we use tags instead of the scriptlets/expressions ?
Or any such advantage of using tags over scriptlets/expressions. ?

SCJP 6
Why to worry about things in which we dont have control, Why to worry about things in which we have control ! !

Chinmaya Chowdary

Ranch Hand

Posts: 434

posted 6 years ago

Hi, James.

I want to know if there is any improvement in terms of performance... like ... is the page loading time less if we use tags instead of the scriptlets/expressions ?

I think(I am guessing), scriptlets/expressions are faster over standard actions. If we compare the benefits of standard actions over scriptlets, this is minor issue.

SCJP 6
Why to worry about things in which we dont have control, Why to worry about things in which we have control ! !

Łukasz Suchecki

Ranch Hand

Posts: 55

posted 6 years ago

Chinmaya Chowdary wrote:Hi, James.

I want to know if there is any improvement in terms of performance... like ... is the page loading time less if we use tags instead of the scriptlets/expressions ?

I think(I am guessing), scriptlets/expressions are faster over standard actions. If we compare the benefits of standard actions over scriptlets, this is minor issue.

Why do you think so ?
The only thing that is quicker is maybe translation phase
Imagine:

it's translated into:

So there is almost no difference with doing it by scriptlet by our own

Chinmaya Chowdary

Ranch Hand

Posts: 434

posted 6 years ago

Hi, Łukasz.

If our jsp contains, jsp standard action
during translation time, jsp engine sees this standard action and verifies the syntax, like wether user has entered mandatory field(id) or not etc.? It does with the help of 'jspxml.xsd' file that is present in 'jsp-api.jar'. The corresponding jsp:useBean has declaration

In the above declaration there is declaration for 'id' attribute
The translator verifies against this syntax and if we don't specify 'scope', by default it is 'page'. All this will be done against this file. If it found correct, then the page will be translated.

All the above procedure takes time. There is no such procedure, if we use scripting. Container will spend minimum effort in this case.
Based on the above, I think scriptlets are faster than standard actions.

Chinmaya Chowdary

Ranch Hand

Posts: 434

posted 6 years ago

James Tharakan wrote:How does it reduces the development time ?

If we say in jsp, the container will translates it into

No need to write the above code by the developer. Thus it reduces the development time.

Łukasz Suchecki

Ranch Hand

Posts: 55

posted 6 years ago

development time - yes
translation time - yes
but improves performance - NO (it's the same)

And yes - I've noticed that I've choosen bad sentence to quote - I was speaking about performance not development time (sorry for mistake)