[weblogic-9.1] JSP 2.0 tag file gets compiled but not reloaded

I am trying to use a JSP 2.0 tag file on weblogic 9.1. Everything works as expected until I reload the page after changing the tag file. Consider the following files, simple.jsp and simple.tag:
h5. /simple.jsp
<%@ page language="java" %>
<%@ taglib prefix="sandbox" tagdir="/WEB-INF/tags" %>
<html>
<body>
This output comes from the jsp.
<sandbox:simple>
</sandbox:simple>
</body>
</html>h5. /WEB-INF/tags/simple.tag
<%@ tag language="java" %>
<div>This output comes from a tag file
</div>The output of a call to simple.jsp is:
<html><head>
</head><body>
This output comes from the JSP.
<div>This output comes from a tag file</div>
</body></html>So far, so good. Now I change the content of simple.tag to
<%@ tag language="java" %>
<div>This output comes from *simple.tag*<div>On a new call to simple.jsp,
1. Weblogic notices that the file has been changed,
2. generates the TagHandler .java file
3. compiles the .java file
But the new class file seems not to be loaded by weblogic; the resulting HTML does not change. It is not a browser cache issue, as I can see Javelin compilation errors. E.g., changing the tag file content to
<%@ tag language="j" %>
<div>This output comes from simple.tag</div>leads to the following (expected) error:
Compilation of JSP File '/sandbox/simple.jsp' failed:
simple.tag:1:18: "j" is not a valid setting for the language attribute.
<%@ tag language="j" %>
^-^
Changes to the .jsp file are reflected in the HTML output.
Am I missing something? Is there any flag I have to set in my weblogic configuration?

You are right in saying that decoding has nothing to
do with rendering per se.I will go even further than Erik did, and dispute this statement.
Consider that you are generating an <input> tag for a text field. Among other things, you have to generate a "name" attribute. Who decides what to put there? The renderer that actually created the markup.
The "renderer" really does
two completely different things. But both should
nevertheless be separate from the component
implementation itself. You could still have the
renderer doing the decoding part, which arguably would
rarely change, and somehow delegate the actual
rendering to an implementation in a tag file.Whether you implement decoding in a separate class or inside the component, what request parameter name do you look for? It is not reasonable to assume that ALL possible renderers will choose the same parameter name ... hence, decoding and encoding are inextricably linked (the code doing the decoding has to know what kind of markup the code doing the encoding actually created). In JavaServer Faces, the current APIs create that linkage by requiring that the decode and encode be done by the same class (either the component, if you are not delegating, or the renderer if you are).
Craig

Similar Messages

  • Prob in  working with jsp 2.0 tags fil

    hi all
    i am facing a prob working with jsp 2.0 tags files and hope to receive a possitive responce from your good self:-
    <p>
    how could i create a instance of a user defined class in a tags files .
    <p>eg.
    <tb:firsttag tableName="customer" className="createtable" packagename="package1">
    <BR>
    </tb:firsttag>
    what code i have to write in tag file to create a object of class createtable </br>
    thanks in advance, waiting for ur cooperation

    I'm not sure I understand your question, but...
    If you want to create a custom tag that will contain a body (data between the start and end tags) you will extend BodyTagSupport.
    HTH.

  • JSP 2.0 tag files in jDeveloper 10g

    Hi, I'd like to create a set of UI components using JSP 2.0 tag files and have them available through the jDeveloper component palette for use in the visual edittor. I'd like jDeveloper to render the tags at design time like it can with regular old tags.
    Can this be done, and if so, how? I poked around in jDeveloper and on the web site without figuring it out... If I missed something obvious or there's docs online please point me in the right direction!
    Thanks,
    L.

    OK, so the integrated run-time supports JSP 2.0 and tag files. But what I'm after is support in the design-time components. Specifically, I want to produce a set of user interface components that I can place in the component palette and have rendered in the JSP visual editor.
    As far as I can tell (see previous post), jDeveloper's editor doesn't understand JSP 2.0 features. Therefore I suspect that the design-time as a whole doesn't and so I'll have to use regular Java tags for anything that needs to be able to be rendered at design time.
    Oh well. Maybe I can write a Java tag implementation that somehow invokes a tag file and just write a simple wrapper taglib specifically for use within jDeveloper at design time.
    L.

  • JSP 2.1 - tag files annotation

    Hi,
    In JSP 2.1 spec is specified that tag handlers that implement javax.servlet.jsp.tagext.SimpleTag could be annotated : JSP.7.1.11 Resource Injection. Tag files when compiled extend javax.servlet.jsp.tagext.SimpleTagSupport which class implements javax.servlet.jsp.tagext.SimpleTag.
    So my question is can my tag file be injected?
    <%@ tag import="javax.annotation.*" extends="javax.servlet.jsp.tagext.SimpleTagSupport" %>
    <%!      
         private String completeInjection = "injectionIsNotComplete!";
         @InjectionComplete
         private void echoInjection(){
              completeInjection = "injection Is Complete!";
    %>
    completeInjection:<%= completeInjection %>Thanks,
    Todor

    OK, so the integrated run-time supports JSP 2.0 and tag files. But what I'm after is support in the design-time components. Specifically, I want to produce a set of user interface components that I can place in the component palette and have rendered in the JSP visual editor.
    As far as I can tell (see previous post), jDeveloper's editor doesn't understand JSP 2.0 features. Therefore I suspect that the design-time as a whole doesn't and so I'll have to use regular Java tags for anything that needs to be able to be rendered at design time.
    Oh well. Maybe I can write a Java tag implementation that somehow invokes a tag file and just write a simple wrapper taglib specifically for use within jDeveloper at design time.
    L.

  • JSP : Tiles Error �tag.getAsString� : component context is not defined

    JSP : Tiles Error �tag.getAsString� : component context is not defined
    I�m working with Struts 1.1 and Tiles, under Tomcat 5.0.16
    My application works fine using Struts 1.1 alone, however, when attempting to run the application in a �Tiles� environment, I get an error:

    javax.servlet.jsp.JspException: Error - tag.getAsString : component context is not defined. Check tag syntax

    I have �defined� this in my �tiles-defs.xml� file, and as far as I can tell, everything else is configured properly (I have looked over the included Struts document examples, and others on the web, and I seem to have everything configured identically).
    What am I missing???
    I have created a series of �mostly� empty JSP files, for simplicity sake.
    JSP FILES:
    -     header.jsp
    -     footer.jsp
    -     menu.jsp
    -     rootLayout.jsp
    -     user.jsp
    -     show_user.jsp
    -     error.jsp
    -     defaultContentPage.jsp
    All JSP files contain:
    <%@ taglib uri="/WEB-INF/lib/struts-tiles.tld" prefix="tiles" %>
    and

    <title>
    <tiles:getAsString name="title"/>
    </title>

    My �tiles-defs.xml�: =================================================
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE tiles-definitions PUBLIC
    "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
    "http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
    <tiles-definitions>
    <!-- ================ RootLayout ======================= -->
    <definition name=".root.layout" path="/jsp/rootLayout.jsp" >
    <put name="title" value="Default title"/>
    <put name="header" value="/jsp/header.jsp"/>
    <put name="menu" value="/jsp/menu.jsp"/>
    <put name="content" value="/jsp/defaultContentPage.jsp"/>
    <put name="footer" value="/jsp/footer.jsp"/>
    </definition>
    <!-- ================ Extentions ======================= -->
    <!-- User -->
    <definition name=".view.user" extends=".root.layout">
    <put name="title" value="Welcome to the User Form."/>
    <put name="content" value="/jsp/user.jsp"/>
    </definition >
    <!-- Save -->
    <definition name=".view.save" extends=".root.layout">
    <put name="title" value="Welcome to the Show User Form."/>
    <put name="content" value="/jsp/show_user.jsp"/>
    </definition >
    <!-- Error -->
    <definition name=".view.error" extends=".root.layout">
    <put name="title" value="Error Message."/>
    <put name="content" value="/jsp/error.jsp"/>
    </definition >
    </tiles-definitions>
    My �struts-config.xml�: ==============================================
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE struts-config PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
    "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
    <struts-config>
    <!-- ========== FormBeans =================================== -->
    <form-beans>
    <form-bean name="userForm" type="biz.seamrog.strutstest.model.state.UserForm"/>
    </form-beans>
    <!-- ========== Action Mapping Definitions=================== -->
    <action-mappings>
    <!-- Action using normal forward syntax...
    <action path="/user"
    forward="/jsp/user.jsp">
    </action>
    -->
    <!-- Action using a "Tiles" forward syntax...
    The "forward" path mappings are defined in a file named
    "../WEB-INF/tiles-defs.xml
    -->
    <action path="/user"
    forward=".view.user">
    </action>
    <!-- Action using normal forward syntax...
    <action path="/save"
    type="biz.seamrog.strutstest.model.logic.SaveAction"
    name="userForm" scope="request"
    input="/jsp/user.jsp">
    <forward name="success" path="/jsp/show_user.jsp"/>
    <forward name="failure" path="/jsp/error.jsp"/>
    </action>
    -->
    <!-- Tiles syntax -->
    <action path="/save"
    type="biz.seamrog.strutstest.model.logic.SaveAction"
    name="userForm" scope="request"
    input="/jsp/user.jsp">
    <forward name="success" path=".view.show_user"/>
    <forward name="failure" path=".view.error"/>
    </action>
    </action-mappings>
    <!-- ============== Global Forwards ======================== -->
    <global-forwards>
    <!-- NOTE: paths with "." syntax are Tiles defined paths,
    all other paths follow conventional "/path/to/file.jsp syntax
    -->
    <forward name="user" path=".view.user"/>
    <forward name="show_user" path=".view.show_user"/>
    <forward name="error" path=".view.error"/>
    <forward name="cssBase" path="/stylesheets/common.css"/>
    </global-forwards>
    <!-- ============= Plug-ins =============== -->
    <!-- Tiles Plug-in -->
    <plug-in className="org.apache.struts.tiles.TilesPlugin" >
    <set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml"/>
    <set-property property="definitions-parser-validate" value="true" />
    <set-property property="moduleAware" value="true" />
    </plug-in>
    </struts-config>
    My �web.xml�: =====================================================
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'>
    <web-app>
    <servlet>
    <!--
    MyController extends org.apache.struts.action.ActionServlet
    NOTE: The servlet could also be specified specifying the
    default Struts ActonServlet...
    <servlet-name>controller</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    ...I have chosen to extend here just for practice sake.
    -->
    <!--
    <servlet-name>MyController</servlet-name>
    <servlet-class>biz.seamrog.strutstest.controller.MyController</servlet-class>
    -->
    <servlet-name>MyController</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <!--
    Point to Struts configuration file(s)
    -->
    <init-param>
    <param-name>config</param-name>
    <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <!-- Tiles config -->
    <init-param>
    <param-name>definitions-config</param-name>
    <param-value>/WEB-INF/tiles-defs.xml</param-value>
    </init-param>
    <!-- This is the added Application parameter: -->
    <init-param>
    <param-name>application</param-name>
    <param-value>ApplicationResource</param-value>
    </init-param>
    <!-- end -->
    <load-on-startup>5</load-on-startup>
    </servlet>
    <!--
    All incoming requests that end in .do, send to MyController.
    -->
    <servlet-mapping>
    <servlet-name>MyController</servlet-name>
    <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    <!--
    Send initial requests to the login page for this application
    -->
    <welcome-file-list>
    <welcome-file>/jsp/user.jsp</welcome-file>
    </welcome-file-list>
    <!--
    Make all of the necessary related Struts JSP custom tag libraries
    available and define where to find them.
    -->
    <taglib>
    <taglib-uri>/WEB-INF/lib/struts-bean.tld</taglib-uri>
    <taglib-location>/WEB-INF/lib/struts-bean.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/WEB-INF/lib/struts-html.tld</taglib-uri>
    <taglib-location>/WEB-INF/lib/struts-html.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/WEB-INF/lib/struts-logic.tld</taglib-uri>
    <taglib-location>/WEB-INF/lib/struts-logic.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/WEB-INF/lib/struts-tiles.tld</taglib-uri>
    <taglib-location>/WEB-INF/lib/struts-tiles.tld</taglib-location>
    </taglib>
    </web-app>
    My �rootLayout.jsp�: ================================================
    <%@page contentType="text/html"%>
    <%@ taglib uri="/WEB-INF/lib/struts-tiles.tld" prefix="tiles" %>
    <html>
    <header>
    <title>
    <tiles:getAsString name="title" />
    </title>
    <body>
    <tiles:get name="header"/>
    <tiles:get name="menu"/> <tiles:get name="content"/>
    <tiles:get name="footer"/>
    </body>
    </html>

    I found an entry in the Mail Archive for Struts. I got it working. My working code is below. You need to in the base JSP import the header and put the 'title' out to it.
    tiles:def file:
    <!DOCTYPE tiles-definitions PUBLIC
    "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
    "http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
    <tiles-definitions>
    <definition name=".petstore.Base" path="/common/petstorecommon.jsp">
    <put name="title" value ="${title}"/>
    <put name="header" value="/common/header.jsp"/>
    <put name="message" value="/common/message.jsp"/>
    <put name="content" value="${content}"/>
    <put name="navbar" value="/common/navbar.jsp"/>
    </definition>
    <definition name="petstore.Login" extends=".petstore.Base" >
    <put name="title" value="Login Page" />
    <put name="content" value="/Logon.jsp"/>
    <put name="test1" value="test1value"/>
    </definition>
    base tile def:
    <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
    <%@ page contentType="text/html;charset=windows-1252"%>
    <html:html>
    <head>
    <html:base/>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>pet store common (jsp)</title>
    </head>
    <body>
    <tiles:insert attribute="header">
    <%-- both of these attributes are accessible from header.jsp It works!!! --%>
    <tiles:put name="title" beanName="title" beanScope="tile" />
    <tiles:put name="test1" beanName="test1" beanScope="tile" />
    </tiles:insert>
    <%-- <tiles:get name="header" /> --%>
    <tiles:get name="message" />
    <tiles:get name="content" />
    <tiles:get name="navbar" />
    </body>
    </html:html>
    Getting access to the title value in the header.jsp file:
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
    <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
    <html>
    <head>
    <tiles:getAsString name="title" />
    <tiles:getAsString name="test1" />
    </head>
    <body>
    </body>
    </html>

  • I have all my music cd's on a hard drive as wav files when I try to add them to I tunes the files get there but no album info I end up with a bunch of track 1's by unknown artists. Is there a way to transfer each album over so it shows up like a normal CD

    I have all my music cd's on a hard drive as wav files when I try to add them to I tunes the files get there but no album info I end up with a bunch of track 1's by unknown artists. Is there a way to transfer each album over so it shows up like a normal CD

    Try posting in a more appropriate forum, as this has noting to do with itunes U - the place where University/college/museums post education material.

  • I want to drag files to mails but not in body of mail , more over the available type of attachments is only photo or video so how I can attach another type

    I want while replying incoming mails to drag files to mails but not in body of mail , more over the available type of attachments is only photo or video so how I can attach another type

    There is no dragging of anything in iOS.
    Attach as many files or emails as you'd like until it reaches the max capacity of attachements for the email provider.

  • ICal failing to run applescripts: The 'Open' button does not change to 'Run', and the script file is opened but not executed on alert.

    iCal failing to run applescripts: The 'Open' button does not change to 'Run', and the script file is opened but not executed.

    Calendar (not called iCal anymore) does not include that capability any longer, apparently.  What you have to do now is go to Automator and create a Calendar Alert action.  You can add a Run AppleScript object to the action and paste in your script there, then when you save it, it will become available as a choice in the alert menu in Calendar.

  • I can open pdf files in emails, but not on websites. I have the new Reader.

    I can open pdf files in emails, but not on websites, as I was able to a couple of weeks ago. On websites I get the message, "Adobe Acrobat has crashed". I downloaded the new Adobe Reader and that didn't help. I don't have Adobe Acrobat, on Adobe Reader.

    Windows 7, Google Chrome and the most recent Adobe Reader (just downloaded the same day). The problem is with Google Chrome, as Fire Fox works fine. I tried enabling and disabling what would read pdf files in Chrome plugins and found that the only thing that worked was to disable adobe reader and enable chrome reader, which is the opposite of what was reccomended in answer to other adobe forum questions that were similar to mine.

  • Took backup of data files and controlfile but not archive file db is 11g xe

    took backup of data files and controlfile but not redo file db is 11g xe r2..was trying complete shut backup,..missed redo..
    anyway to restore the db back..
    I had failed to backup redo log file..
    db was shut...properly
    any info highly appreciated.
    cheers
    Edited by: zycoz100 on Feb 27, 2013 4:42 AM

    A controlfile create is a fairly trivial task, for either a cold backup or hot backup scenario. Well, its an easy task after you've done the process a few times.
    If you have a healthy oracle instance running any place else, preferably at 11gR2, or even a 10g instance can work as an example, get a system connection and do an `alter database backup controlfile to trace;` and the instance will create a new trace file with all SQL commands needed to rebuild the controlfile in the instance trace directory.
    Have a look at the trace file, a `show parameter diag` reveals the diagnostic_dest parameter, look for the "trace" directory under that folder, for the latest *trc file. In 10g its `show parameter dump` and the trace file goes straight to the user_dump_dest directory, no digging required.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • I just bought an iMac now running OSX 10.8.4.  I have a G5 running OXS 10.5.8 - External HD connected to the G5 been using Time Machine to back up. Need to get my files, photos etc. but not applications etc. onto the iMac. How do I do it?

    I just bought an iMac now running OSX 10.8.4.  I have a G5 running OXS 10.5.8 - External HD connected to the G5 been using Time Machine to back up. Need to get my files, photos etc. but not applications etc. onto the iMac. How do I do it?

    David JHS21 wrote:
    Can I just plug the external hard drive into the iMac and copy the "Documents" and "Pictures" from the hard drive to the iMac?
    Not those whole folders, but their contents, maybe.
    If the user account now on the Mac has read rights to the user account(s) on the backups, yes.  If not, you may have to do some finagling. 
    Try the Browse Other Backup Disks option, per Time Machine - Frequently Asked Question #17.  If you find an account that can open those folders, restore what you want to an alternate location (#16 in the FAQ).
    If not try creating one or more accounts temporarily.

  • JSP 2.x - Tag files with body-content="JSP"

    I've been looking at the JSP 2.1 draft and see that, as with the previous JSP release, it is not allowed for tag-files to have body-content="JSP". I've tried to find a good answer for that on the web, but there's no one who can enlighten me. I've tried to tweak the source of Apache Tomcat 6.0.13 (Validator.ValidateVisitor and TagFileProcessor.TagFileDirectiveVisitor, both in org.apache.jasper.compiler) to accept body-content="JSP" in tag files - with great success. It is possible to have scriptlets within tags from tag files and it works as expected.
    My reason for wanting scriptlets in the body-content of tags from tag files is that it would encourage a more contextual, nested (and in my eyes, a more beautiful) structure of JSP-pages, as opposed to the JSTL flat structure, where f.ex. the sql:query tag does not reside within a sql:setDataSource tag, but instead refers to the datasource through an EL-variable. I suppose that it has been constructed in this way only to make it possible for programmers to include scriptlets in-between sql:query tags that use the same datasource.
    Not that it is not possible to nest tag-file tags, but I suspect that many programmers then would like to keep a flat structure so as to maintain the possibility of inserting scriptlets where needed - outside any tag which is based on a tag-file.
    So, why is it not allowed for tag-files to have body-content="JSP"?

    Thanks for the reply, evnafets.
    I'm aware that scriptet-code is generally being discouraged, although I don't understand why. I think that having a standard tag-library is a wonderful idea, but in the case of JSTL, I'm not that pleased. It relies heavily on EL, which I see as an unnecessary abstraction.
    Let me give you an example. The JSTL does database-connections and queries in this way:
    <sql:setDataSource var="datasource" url="jdbc:oracle:thin:@localhost:1521:TEMP" driver="oracle.jdbc.OracleDriver" user="scott" password="tiger" />
    <sql:query sql="SELECT * FROM EMP" dataSource="datasource" var="resultset" />This could also be accomplished without EL in a hierarchical structure:
    <sql:dataSource url="jdbc:oracle:thin:@localhost:1521:TEMP" driver="oracle.jdbc.OracleDriver" user="scott" password="tiger">
      <sql:query sql="SELECT * FROM EMP">
        BodyContent <% perhapsWithScriptlets; %>
      </sql:query>
    </sql:dataSource>...using TagSupport.findAncestorWithClass for the query to reference the datasource which it is enclosed in. (in Tomcat, the class would be called dataSource_tag. BTW, why is this not standardised in JSP?)
    I would then also like to be able to use scriptlet-code inside the tags as I could if the tags were written as tag-classes, extending BodyTagSupport, and being defined in a formal, cumbersome TLD file.
    Why the difference in functionality between SimpleTagSupport and BodyTagSupport - or rather; why is it then not possible to specify that a tag-file should extend BodyTagSupport rather than SimpleTagSupport?

  • JSP 2.0 Tag files outputting elements with conditional attributes

    It appears to be impossible to conditionally output element-attributes in JSP 2.0 XML Tag files. Here's an example:
    Tagfile text.tagx:
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">
      <jsp:directive.attribute name="name" required="true" type="java.lang.String"/>
      <jsp:directive.attribute name="id" required="false" type="java.lang.String"/>
      <jsp:text>
        <input type="text" name="${name}" id="${id}" />
      </jsp:text>
    </jsp:root>Seems simple enough. This tag has a name-attribute and an optional id-attribute. But what if I want the id-attribute of the 'input' element not to be outputted when the id-parameter is empty!
    It appears there's no elegant way to do this but to revert to CDATA blocks and/or output-escaping. Is this an oversight in the API or am I missing something?
    I've also tried the following but it didn't work (in Tomcat anyway):
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2" xmlns:c="http://java.sun.com/jsp/jstl/core">
      <jsp:directive.attribute name="name" required="true" type="java.lang.String"/>
      <jsp:directive.attribute name="id" required="false" type="java.lang.String"/>
      <jsp:text>
        <jsp:element name="input">
          <jsp:attribute name="type" value="text"/>
          <jsp:attribute name="name" value="${name}"/>
          <c:if test="${!empty id}">
            <jsp:body>
              <jsp:attribute name="id" value="${id}"/>
            </jsp:body>
          </c:if>
        </jsp:element>
      </jsp:text>
    </jsp:root>Any ideas on how to do this?

    I wonder why no one has responded to this post!!!! I am trying to do the same thing, to no avial. In XSLT this is how it works, I would have thought JSTL would do the same thing. D'oh!

  • JSP 2.0 tag files for rendering JSF components

    Over the weekend I read up on new JSP 2.0 features (dunno why I waited this long??) ... I really liked the tag file feature ...
    I was wondering if it were a good idea to use these tag files as renderers for JSF components - ok, this ties us to a JSP only solution but how many in here would be using a non-JSP solution anyway?
    I was thinking along the foll. lines:
    <myComponent id="myComponent1" attr1="value1" attr2=value2">
        <myComponentRenderer var="myComponent1" />
    </myComponent>
    myComponentRenderer can be implemented as a tag file in myComponentRenderer.tag ... The myComponent tag delegates the business logic processing to its associated UIComponent and then sets this component as a pageContext attribute with the id "myComponent1" ... myComponentRenderer in turn gets a reference to this UIComponent and renders it ...
    Again, if one wants a different way of rendering, make another tag file myComponentRenderer2.tag or change myComponentRenderer.tag itself ...
    Indeed, this may not work for components with complicated rendering logic but I believe that's only the 20% case ...
    Comments?
    P.S.:
    I've picked this up from http://forums.java.sun.com/thread.jsp?forum=427&thread=381052&tstart=0&trange=15
    This also compliments another topic: http://forums.java.sun.com/thread.jsp?forum=427&thread=413515&tstart=0&trange=15

    You are right in saying that decoding has nothing to
    do with rendering per se.I will go even further than Erik did, and dispute this statement.
    Consider that you are generating an <input> tag for a text field. Among other things, you have to generate a "name" attribute. Who decides what to put there? The renderer that actually created the markup.
    The "renderer" really does
    two completely different things. But both should
    nevertheless be separate from the component
    implementation itself. You could still have the
    renderer doing the decoding part, which arguably would
    rarely change, and somehow delegate the actual
    rendering to an implementation in a tag file.Whether you implement decoding in a separate class or inside the component, what request parameter name do you look for? It is not reasonable to assume that ALL possible renderers will choose the same parameter name ... hence, decoding and encoding are inextricably linked (the code doing the decoding has to know what kind of markup the code doing the encoding actually created). In JavaServer Faces, the current APIs create that linkage by requiring that the decode and encode be done by the same class (either the component, if you are not delegating, or the renderer if you are).
    Craig

  • JSP 2.0 tag file with conditional body?

    Is it possible to write a tag file that conditionally outputs its body?
    For example:
    <my:conditionalTag booleanAttr="false">
    Since booleanAttr is false, you will never see this output.
    </my:conditionalTag>
    Thanks,
    B

    I apologize for the typo..
    You can use the Java Standard Tag Library (JSTL), which has a <c:choose> tag with <c:when> or <c:if>. So as you can see with the example above, you are to use the <c:when> tag inside <c:choose> . Here is an example of using <c:if>(notice that you don't need the <c:choose> tag this time):
    <c:if test="${true}">
         do something
    </c:if>
    [/code                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • Toshiba 8 gb Flash Drive Crashed

    I have a Toshiba 8 gb flash drive that just stopped working. The light no longer comes on, and the comuter can't recognize it in the drive. I need to recover the files on the flash drive (all documents). PLEASE HELP!!

  • Four finger swipe shows screenshot of last session

    A bit confusing to explain so I'll give an example. I'd written out out a note in the Notes app, then deleted the note and closed the app. Then later when I opened up Notes again and did the four-finger swipe to close something, I could see a small s

  • Date coversion

    How can i convert system date  to december 29,2006 format

  • Wordless error message, then failure to open

    Help! iTunes is doing something odd. I try to open the program and what I get is what looks like an error box. However, what is in the box is the following: an exclamation mark inside of a "STOP" sign and the iTunes icon on the left, a blue "OK" butt

  • Redirect - a basic question

    Hello i'm new to podcasting and facing the very usual situation of redirecting a feed URL using <itunes:new-feed-url> my podcast feeds from a wordpress blog placed on my server, and the iTS is set to listen to the atom feed (which i like to change to