Creating a visualization for a custom component tag
In this task, you will first create a JSP file using the run-time workbench. Then, you will add a VCT to the JSP page.
- Now you can run the visualizer in the run-time workbench.
- Select
Run | Run from the menu. The
Create, manage and run configurations wizard page is displayed.
- Select
Eclipse Application, and display the context menu. In the context menu, select
New menu item..
- Click
Run. The run-time workbench is displayed.
- In a Dynamic Web project, use Page Designer to edit a JSP file with the visual custom tag. Make sure you have a taglib directive. (However, the actual TLD file is not required.) For example: <%@taglib uri="/WEB-INF/lib/sample.jar" prefix="vct" %>. See the example that follows for a sample JSP page.
- Add the following VCT tag to your JSP file: <vct:date/>. Place the tag where you want to display the current date and time.
- Select Display >Visually Render JSP Components from the menu. The VCT tag is rendered so that you see the actual date and time in Page Designer.
You have now written a visualizer and successfully used a VCT on your JSP page. You should be able to view an actual date and time in Page Designer.
Here is a sample JSP page with the VCT-related tags in bold:
<HTML> <HEAD> <%@ taglib uri="/WEB-INF/lib/sample.jar" prefix="vct" %> <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %> <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <META name="GENERATOR" content="IBM® WebSphere® Studio"> <META http-equiv="Content-Style-Type" content="text/css"> <LINK href="theme/Master.css" rel="stylesheet" type="text/css"> <TITLE>index.jsp</TITLE> </HEAD> <BODY> The current date and time is: <vct:date/> </BODY> </HTML>
Related concepts
Related tasks
Creating visual custom tags (VCTs)
Updating the plugin.xml file for a VCT