Java Mailing List Archive

http://www.junlu.com/

Google
Google
Mailing List
Home
Forum Home
JBoss - Java Application Server
Struts - A MVC web framework
Tomcat - JSP/Servlet container
iText - An open source PDF Java Library
JDOM - JDOM XML Parser
J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition
J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog
Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology
JSP - A mailing list about Java Server Pages specification and reference
Struts & Hibernate
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
JSP 2.x *.tag files problem

JSP 2.x *.tag files problem

2006-04-03       - By Darryl L. Miles

 Back
My question is about the use of *.tag files, to have the container (TC)
automatically build
tag libraries from my test.tag file.  But some aspects don't work as I would
naturally expect and I don't know
if this is my lack of understanding or a genuine bug.

When I use <%@ attribute name="vvAbcDefGhi" required="false" ... %> I have no
problem.

Now when I start to alter the name="" value so that it uses the values:

vvAbcDefGhi (no problem here)
vvabcdefghi (no problem here)
vAbcDefGhi (does not work for me, I would expect this to be ok)
AbcDefGhi (does not work for me, I'm less sure if this is ok but can't see any
reason why it isn't allowed providing the name does not clash with another
defined attribute called abcDefGhi)

When I say it does not work for me I can an error about being unable to find
the setter function of the generated tag library.

There is a function in org/apache/jasper/compiler/Generator Source code of org/apache/jasper/compiler/Generator which seems to
do the business
#generateTagHandlerAttributes(TagInfo tagInfo) converts it into code.  I have
tested the methods #toGetterMethod(String)
and #toSetterMethodName(String) with my tag attribute names above and I get
expected case conversion.



Here is a cut and paste of the parts I think are relevant.


WEB-INF/tags/test.tag:

<%@ tag language="java" pageEncoding="UTF-8 (See http://UTF-8.ora-code.com)" body-content="scriptless" %>
<%@ attribute name="vvAbcDefGhi" required="false" rtexprvalue="true" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
...SNIP...
My HTML is here ${vvAbcDefGhi}
...SNIP...


test.jsp:

<%@ page language="java" contentType="text/html; charset=UTF-8 (See http://UTF-8.ora-code.com)"
pageEncoding="UTF-8 (See http://UTF-8.ora-code.com)" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
...SNIP...
<tags:test vvAbcDefGhi="value1" />
...SNIP...




--
Darryl L. Miles



-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.