answersLogoWhite

0

How do you explain What is a Scriptlet?

Updated: 8/19/2019
User Avatar

Wiki User

11y ago

Best Answer

In JavaServer Pages (JSP) technology, a scriptlet is a piece of Java-code embedded in the HTML-like JSP code.

The scriptlet is everything inside the <% %> tags. Between these the user can add any valid Scriplet i.e. any valid Java Code.

Scriptlets are executed at request time, when the JSP engine processes the client request. If the scriptlet produces output, the output is stored in the out object, from which you can display it.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you explain What is a Scriptlet?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can you write method in JSP scriptlet?

Yes, you can.


Can variable declared in one scriplet access in another scriplet?

No. Variables declared inside a scriptlet are like method local variables which are not accessible outside the scriptlet/method.


What is the difference between script and scriptlet?

"script" is an HTML tag used to include JavaScript on a web page. Example: &lt;HTML&gt; &lt;body&gt; &lt;script type="text/javascript"&gt; document.write("hi there"); // javascript interpreted by the browser &lt;/script&gt; &lt;/body&gt; &lt;/HTML&gt; "Scriptlet" is a JSP construct used to include Java in a JSP page. Example: &lt;HTML&gt; &lt;body&gt; &lt;% // this is a scriptlet response.getWriter().write("hi there"); // Java executed on the server %&gt; &lt;/body&gt; &lt;/HTML&gt; Here the result (an HTML document with the text "hi there") is the same in both cases, but the mechanisms are different - Javascript runs in the browser (any browser), while the JSP scriptlet is executed on the server and needs a server with JSP support. See related links.


How can you get the current JSP Page name?

Using either of the two below commands inside a JSP Scriptlet: application.getRealPath(request.getServletPath()); or getServletConfig().getServletContext().getRealPath(request.getServletPath());


What is the verb of explain?

"Explain this" is actually "You explain this" or some form of that phrase. As such, "You" is the [understood] subject and "explain" is action requested, i.e. the verb. Or another way of saying it is "explain" IS the verb, "explanation" is the noun, as in "You please explain the written explanation to me.' or simply "Explain it to me Lucy".


How do you explain ram and gigs?

Explain RAM? Explain RAM?


What are the adverb of explain?

explain


Is it illegal to explain sex over the internet?

i think it depends on WHERE you explain it and WHO you explain it to.


What tis explain?

What does "explain" mean? To "explain" something is to tell in detail what something means.


What is the present of explain?

Explain is present tense. I/We/You/They explain He/She/It explains The present participle is explaining.


How do you write an accordion paragraph?

Topic Sentence * 1st Supporting detail/reason/fact * Explain * Explain * 2nd Supporting detail/reason/fact * Explain * Explain * 3rd Supporting detail/reason/fact * Explain * Explain Conclusion


Is the word explain present tense?

No, the word &quot;explain&quot; is not present tense. &quot;Explain&quot; is the base form of the verb, and it can be used in various tenses like present (&quot;I explain&quot;), past (&quot;I explained&quot;), or future (&quot;I will explain&quot;).