> What is use of % symbol in JSP? Please reply
Some people on this thread have provided you good answers.
You may also want to know that the new way of writing JSPs is with JSTL and scriptlets <% anything that goes here is a scriptlet %> are discouraged.
But it's good to get basic foundation in scriptlets too incase there's legacy JSP code.
> > What is use of % symbol in JSP? Please reply
>
> Some people on this thread have provided you good
> answers.
>
> You may also want to know that the new way of writing
> JSPs is with JSTL and scriptlets <% anything that
> goes here is a scriptlet %> are discouraged.
>
> But it's good to get basic foundation in scriptlets
> too incase there's legacy JSP code.
why would you need a foundation in scriptlets, though? if it's legacy code, it's already there, and it's just java. if you can't work out that the stuff that looks like java code in a legacy JSP actually is java code, you're in trouble. and wouldn't part of the maintenance be to refactor the scriptlets out?
Everything in a Java Server Page file (tags, scriplets,) is converted into a Java Servlet by the JSP Engine. After the Java Server Page is transformed into a Java source file, the compiler compiles the Java source file and creates a Java class file. Inside a Java Runtime Environment, a Java Virtual Machine reads the Java class file and executes its program instructions.
> > > What is use of % symbol in JSP? Please reply
> >
> > Some people on this thread have provided you good
> > answers.
> >
> > You may also want to know that the new way of
> writing
> > JSPs is with JSTL and scriptlets <% anything that
> > goes here is a scriptlet %> are discouraged.
> >
> > But it's good to get basic foundation in
> scriptlets
> > too incase there's legacy JSP code.
>
> why would you need a foundation in scriptlets,
> though? if it's legacy code, it's already there, and
> it's just java. if you can't work out that the stuff
> that looks like java code in a legacy JSP actually
> is java code, you're in trouble. and wouldn't
> part of the maintenance be to refactor the scriptlets
> out?
It's not really just Java IMO because JSP has additional concepts like
implicit objects such as page, request, session, out etc - a newbie who knows Java won't have a clue when the come across the implicit objects and can't find where they were declared.
Also the concept of directives is not in Java Classes but on in JSPs.
JSP has some features that would be new or confusing to someone who has only worked with Java, therefore a newbie to JSP would be better off learning JSP concepts.
-regards
appy