answersLogoWhite

0

AllQ&AStudy Guides
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.

This answer is:
Related answers

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.

View page

Yes, you can.

View page

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

View page

"script" is an HTML tag used to include JavaScript on a web page.

Example:

<HTML>

<body>

<script type="text/javascript">

document.write("hi there"); // javascript interpreted by the browser

</script>

</body>

</HTML>

"Scriptlet" is a JSP construct used to include Java in a JSP page.

Example:

<HTML>

<body>

<% // this is a scriptlet

response.getWriter().write("hi there"); // Java executed on the server

%>

</body>

</HTML>

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.

View page

Using either of the two below commands inside a JSP Scriptlet:

application.getRealPath(request.getServletPath()); or

getServletConfig().getServletContext().getRealPath(request.getServletPath());

View page
Featured study guide

Technology

4 cards

Is technology driving business or business is driving technology

The phrase of technology product development cycle that describes key technology that has to be integrated into many products is the what

Is a reason to include the people who will be using the new technology in conversations in about technology upgrades for a business

Why are the social and ethical consequences of emerging technology hard predict

➡️
See all cards
2.44
16 Reviews
More study guides
2.36
22 Reviews

1.45
31 Reviews
Search results