Skip to main content

Posts

Showing posts with the label JSTL

JSTL Tutorials Using NetBeans : Part-6

Right Click on WEB-INF folder, New and choose File/Folder…     Another dialog box will appear, choose Other on the left pane and choose Folder on the right pane.

JSTL Tutorials Using NetBeans : Part-5

Let’s see how it works. Create 2 new JSP called JstL_Core_Tags_Redirect.jsp and Jstl_Core_Tags_Import.jsp. Add this to Jstl_Core_Tags_Redirect.jsp It is going to redirect the page back to index.jsp Add this to Jstl_Core_Tags_Import.jsp It will import or include index.jsp after Jstl_Core_Tags_Import.jsp loads. This is what we get when we run Jstl_Core_Tags_Redirect.jsp. Just type the address as shown in circled area and the page will redirect us back to index.jsp.     Interesting right? Well, do same thing for Jstl_Core_Tags_Import.jsp. Open browser then type the full address manually and we will get index.jsp is loaded after Jstl_Core_Tags_Import.jsp loads.

JSTL Tutorials Using NetBeans : Part-4

Create a new JSP file. Follow exactly the same way as we created the Jstl_Hello_World.jsp but name it Jstl_Core_Tags.jsp. Then we need to modify our index.jsp to contain the link to our newly created JSP. So please add below codes to our index.jsp just right after our first link to open the Hello World JSTL tags.   JSTL Core Tags JSTL if tag and EL operators   What we do here is basically to send some parameters so that they are accessible from the target page.   On the target page, we can retrieve these parameters via ${param.parameter_name} and we are going to use the logical JSTL tags to compare some values. Add below codes to Jstl_Core_Tags.jsp

JSTL Tutorials Using NetBeans : Part-3

3. Implementation of JSTL Core Tags First, let’s make a new JSP page. Right click on Web Pages folder, New and JSP…       Then a new dialog will show up as displayed above. Let’s call it Jstl_Hello_World.jsp. Then click Finish to create the jsp. Now we have 2 JSPs – index.jsp and Jstl_Hello_World.jsp.

JSTL Tutorials Using NetBeans : Part-2

2. Why use JSTL? Advantage of JSTL Scriptlets ( Java codes within JSP ) are complex and are extremely hard to be maintained. Unlike scriptlets, JSTL makes our JSP readable and maintainable. HTML programmer may find it hard to modify the JSP with the scriptlets as he or she may not have the Java programming knowledge. However, if we are using JSTL to replace our scriptlets, HTML programmer can easily understand on what’s going on in the JSP as JSTL is in the form of XML tags similar to the normal HTML tags. JSTL has been standardized and is reusable tags. The name of each tag in JSTL is self-explanatory and is easy to understand. JSTL requires less code compared to scriptlets. Shortcomings of JSTL Scriptlets provide you with greater flexibility. As scriptlets is simply a Java codes, you can do anything that you want as you normally do with a Java programming. On the other hand, JSTL is a very specific and each tag has its own purposes.

JSTL Tutorials Using NetBeans : Part-1

Introduction The latest version of JSTL is JSTL 1.1. Without any hesitation, JSTL is now extremely important in ensuring the success of the J2EE web application projects. JSTL is basically part of  JSP 2.0 specification and requires Java Servlet 2.4 and higher to support its tags.   After completing this tutorial, you are expected to be able to apply JSTL technology to your JSP, know what are JSTL tags, know how and when to use certain tags under certain circumstances according to your needs. Specifics Information on JSTL and Netbeans This tutorial has been compiled, tested and run under: Netbeans 5.5 JSTL 1.1 library package Tomcat 5.5.7 as server If you have installed NetBeans successfully, JSTL library (.jar) can be found on your local hard disk. It is bundled together with Netbeans. For your information, it can be found in: netbeans_installation_folder\enterprise1\config\TagLibraries\JSTL11