Found 177 Articles for JSP

Difference between JSP and ASP

Kiran Kumar Panigrahi
Updated on 27-Jul-2022 09:44:13
JSP and ASP are both server-side scripting languages. JSP is Java based and is developed by Sun Microsystems, whereas ASP is developed by Microsoft and is also referred as Classic ASP. Whenever a browser requests a JSP or ASP page, the server engine reads the file, executes the code in file and returns the HTML output to the browser.JSP is compiled, whereas ASP is interpreted. ASP.NET is a .NET based variant of ASP where the codes are compiled to improve the performance.What is ASP?ASP is a server-side scripting engine, which means the code that is written gets sent to the ... Read More

Difference between Servlet and JSP

Nitin Sharma
Updated on 18-Sep-2019 14:23:53
In brief, it can be defined as Servlet are the java programs that run on a Web server and act as a middle layer between a request coming from HTTP client and databases or applications on the HTTP server.While JSP is simply a text document that contains two types of text: static text which is predefined and dynamic text which is rendered after server response is received.The following are the important differences between ArrayList and HashSet.Sr. No.KeyServletJSP1ImplementationServlet is developed on Java language.JSP is primarily written in HTML language although Java code could also be written on it but for it, ... Read More

How to check index within a string of a specified substring in JSP?

Samual Sam
Updated on 30-Jul-2019 22:30:25
The fn:indexOf() function returns the index within a string of a specified substring.SyntaxThe fn:indexOf() function has the following syntax −int indexOf(java.lang.String, java.lang.String)ExampleFollowing is the example to explain the functionality of the fn:indexOf() function − Using JSTL Functions Index (1) : ${fn:indexOf(string1, "first")} Index (2) : ${fn:indexOf(string2, "second")} You will receive the following result −Index (1) : 8 Index (2) : 13

How to escape characters that can be interpreted as XML markup in JSP?

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25
The fn:escapeXml() function escapes characters that can be interpreted as XML markup.SyntaxThe fn:escapeXml() function has the following syntax −java.lang.String escapeXml(java.lang.String)ExampleFollowing is the example to explain the functionality of the fn:escapeXml() function − Using JSTL Functions With escapeXml() Function: string (1) : ${fn:escapeXml(string1)} string (2) : ${fn:escapeXml(string2)} Without escapeXml() Function: string (1) : ${string1} string (2) : ${string2} You will receive the following result −With escapeXml() Function: string (1) : This is first String. string (2) : This is second String. Without escapeXml() Function − string (1) : This is first String. string (2) : This is second String.

How to determine if an input string ends with a specified suffix in JSP?

Samual Sam
Updated on 30-Jul-2019 22:30:25
The fn:endsWith() function determines if an input string ends with a specified suffix.SyntaxThe fn:endsWith() function has the following syntax −boolean endsWith(java.lang.String, java.lang.String)ExampleFollowing example explains the functionality of the fn:substring function −           Using JSTL Functions                              String ends with 123                      String ends with TEST       You will receive the following result −String ends with 123

How to check whether an input string contains a specified substring ignoring the case using JSP?

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25
The fn:containsIgnoreCase() function determines whether an input string contains a specified substring. While doing search it ignores the case.SyntaxThe fn:containsIgnoreCase() function has the following syntax −boolean containsIgnoreCase(java.lang.String, java.lang.String)ExampleFollowing is the example to explain the functionality of the fn:containsIgnoreCase() function −           Using JSTL Functions                              Found test string                      Found TEST string         You will receive the following result −Found test string Found TEST string

How to check if an input string contains a specified substring in JSP?

Samual Sam
Updated on 30-Jul-2019 22:30:25
The fn:contains() function determines whether an input string contains a specified substring.SyntaxThe fn:contains() function has the following syntax −boolean contains(java.lang.String, java.lang.String)ExampleFollowing example explains the functionality of fn:contains() function −           Using JSTL Functions     Found test string Found TEST string You will receive the following result −Found test string

How to apply XSL transformation on an XML document?

Samual Sam
Updated on 30-Jul-2019 22:30:25
The tag applies an XSL transformation on an XML document.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultdocSource XML document for the XSLT transformationNoBodydocSystemIdURI of the original XML documentNoNonexsltXSLT stylesheet providing transformation instructionsYesNonexsltSystemIdURI of the original XSLT documentNoNoneresultResult object to accept the transformation's resultNoPrint to pagevarVariable that is set to the transformed XML documentNoPrint to pagescopeScope of the variable to expose the transformation's resultNoNoneExampleConsider the following XSLT stylesheet style.xsl −                                                                                                                                                                                                                                                                     Now consider the following JSP file −           JSTL x:transform Tags               Books Info:                                                 Padam History                 ZARA                 100                                             Great Mistry                 NUHA                 2000                                 You will receive the following result −Books InfoPadam HistoryZARA100Great MistryNUHA2000

Can we have a switch statement in JSP for XPath expression?

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25
The tag works like a Java switch statement. With this, you can choose between a number of alternatives. Where the switch statement has the case statements, the tag has the tags. In a similar way, a switch statement has the default clause to specify a default action and the tag has the tag as the default clause.AttributeThe tag does not have any attribute.The tag has one attributes which is listed below.The tag does not have any attribute.The tag has the following attributes −AttributeDescriptionRequiredDefaultselectCondition to evaluateYesNoneExample         ... Read More

How to iterate over nodes of XML in JSP?

Samual Sam
Updated on 30-Jul-2019 22:30:25
The tag is used to loop over nodes in an XML document.AttributeThe tag has the following attributes −AttributeDescriptionRequiredDefaultselectThe XPath expression to be evaluatedYesNonevarName of the variable to store the current item for each loopNoNonebeginThe start index for the iterationNoNoneendThe end index for the iterationNoNonestepThe size of the index increment while iterating over the collectionNoNonevarStatusThe name of the variable in which the status of the iteration is storedNoNoneExampleThe following example shows the use of the tag −           JSTL x:if Tags               Books Info:     ... Read More
1 2 3 4 5 ... 18 Next
Advertisements