H:outputLink tag whitespace

Hello,
I've found that the <h:outputLink> tag, when rendering HTML, follows the closing </a> with lots of whitespace - some line breaks and tabs. I'm not sure if this problem is specific to the particular JSF implementation I'm using (WebSphere Portal v5.1 JSF Portlet).
This is a problem because we need some of our links to be immediately followed by a period. With any whitespace there, the browser renders a single space between the link and the period.
Any ideas on how to fix this?
Thanks

Adding the CSS style of "whitespace: normal;" doesn't really do anything, since it's the normal way the browser interprets whitespace - multiple continguous whitespace in the HTML gets rendered as a single space. What I need is to not have any spaces rendered.
It's too bad there isn't a CSS style that makes whitespace in the HTML completely ignored.
I'm still looking for a solution here. I could probably take out the h:outputLink tag and just use an <a href=" in my JSP, but I would much prefer to use a JSF tag if possible. Especially since this kind of situation appears in many places in our application.

Similar Messages

  • Using h:outputLink  tag

    I want to disable the context menu which comes with the right click when I click on a H:outputlink. I want to use the oncontextmenu option but this tag does not support is
    Is there a way?

    Hi -- I pass details between pages regularly. The following has worked for me:
    ApplicationFactory factory = (ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
    ValueBinding binding = factory.getApplication().createValueBinding("#{beanName}");
    BeanName beanProperty = (BeanName) binding.getValue(FacesContext.getCurrentInstance());
    ... then set the you can set the values. Can't recall if I need to use SaveStates for the items. Probably if you use request scope beans.

  • h:outputLink with context path?

    Hey,
    give it anyway to set an flag in the <h:outputLink> tag to copy the context path automatic on the beginning of the value from outputLink or must I write my own component?

    No flag like that... I'm not actually sure what the problem is here though. It definitely sounds like you don't need a custom component though!
    What's wrong with just binding the value attribute to your backing bean, and let the bean figure out what your context root is?
    CowKing

  • Edit HTML whitespace bug

    I tried searching by a variety of terms (HTML, h2, element, tag, whitespace) to see if this has already been covered, but I did not get any relevant hits. The Wiki server software has been pretty solid once I figured out the internals and got it set up. However, this is a highly annoying bug for our day-to-day usage.
    I encourage our Wiki editors to learn and use straight HTML. That's how I learned and they seem to be capable of understanding it. However, every time we toggle from browser display mode to HTML view while editing a page, several lines of whitespace are added before any close header element tag (e.g. ). It makes the source code nearly unreadable after just a few toggles. It is also manually intensive to erase it every time.
    Anyone have an idea on a fix for this? I have seen it happen on tags of a few other types, such as , although I couldn't list with certainty all tags that exhibit the bug. Should be a simple fix on Apple's part?

    I have found a reasonable explanation for this problem, which is helping me to avoid it for now.
    Formatting with the WYSIWYG buttons, for example changing some paragraph text to a header element (H2), produces the following HTML:
    Header Text
    I am not sure that this is syntactically correct, because a header element is already block level, so you could just style it to increase padding, or place the line break after the closing tag, but I digress.
    This HTML created by the Wiki does not exhibit the bug I described. However, if I remove the
    tag and toggle into HTML mode, the javascript (or whatever) will try to insert a line break.
    It's as if it is trying to clean up the HTML, but it is adding the character in the wrong mode of the editor. I'm getting whitespace in my HTML, instead of in the rendered layout view.
    The solution is to leave the header elements as they were created. I was importing content from old documents, so I had the HTML already written in another editor.

  • Data transfer B/W parent windonw and child window with out java script

    hi ,
    i am using h:outputLink Tag to open child window , i am unable to pass parent window text box value to child window with out java script , Here i am using two different backing beans for parent and child windows . Plz help me .

    Hi -- I pass details between pages regularly. The following has worked for me:
    ApplicationFactory factory = (ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY);
    ValueBinding binding = factory.getApplication().createValueBinding("#{beanName}");
    BeanName beanProperty = (BeanName) binding.getValue(FacesContext.getCurrentInstance());
    ... then set the you can set the values. Can't recall if I need to use SaveStates for the items. Probably if you use request scope beans.

  • How To Preserve Spaces in Oracle Soa

    Good afternoon !
    I have a problem , I'm trying to do an UPDATE on a column in a particular table from my database . However , this column is of type CHAR ( 13 ) , and as I try to perform the UPDATE , it returns me an error stating that the Primary Key is already being used ..
    Well , I think I found the problem .
    The fact of the column is CHAR ( 13 ) , in the database my ID has 5 numbers , eg ( 12345 ) , but to be a char field it gets stored as ( 12345 ) to complete the 13 characters of CHAR , 5 + numbers 8 spaces.
    The solution is to pass , when the UPDATE , the id ( 12345 ) with spaces , but how can I preserve the spaces without the act of UPDATE spaces are automatically removed ?
    I tried using the tag <whiteSpace value="preserve"/> but did not work ..
    Follow my code below .
    <element name="pTipoAgente" minOccurs="0">
         <simpleType>
          base="string"> <restriction
           value="preserve"/> <whiteSpace
           <maxLength value="30"/>
          < / restriction >
         < / simpleType >
        < / element>
    Suggestions welcome , thank you !

    Well, post you question in the right forum (https://forums.oracle.com/places?filterID=all~objecttype~showall&query=soa)
    Timo

  • Not properly executing the dhtml  slideit() method.

    Hi,
    I am trying to execute dhtml animatecollapse methods in jsf tags..it is calling the method but it is not executing properly.. I am posting the code please see this once and tell me where I was wrong...
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <f:view>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <link href="images/ipass_ss.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="animatedcollapse.js">
    * Animated Collapsible DIV- � Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
    </script>
    <meta http-equiv="Content-Type"
    content="text/html; charset=windows-1252"/>
    <title>FirstDemo</title>
    </head>
    <body><h:form>
    <div> </div>
    <h:panelGrid id="intipane" width="%100"
    style="background-color:rgb(134,149,180);" columns="2">
    <h:outputLabel id="HeadLabel" value="CustomerDetails" style="margin:40.0em;"/>
    <h:outputLink onclick="collapse1.slideit()">
    <h:graphicImage url="/images/xp-info-pane-arrow_down_over.gif"/>
    </h:outputLink>
    </h:panelGrid>
    <h:panelGrid id="firstpane" columns="6" width="100%" style="background-color:rgb(214,224,239);">
    <h:outputLabel id="lone" for="tone" value="CustomerId:"/>
    <h:inputText id="tone"/>
    <h:outputLabel id="ltwo" for="ttwo" value="CustomerName:"/>
    <h:inputText id="ttwo"/>
    <h:outputLabel id="lthr" for="tthr" value="Designation:"/>
    <h:inputText id="tthr"/>
    </h:panelGrid>
    <div id="dog">
    <h:panelGrid id="secondpane" columns="6" width="100%" style="background-color:rgb(214,224,239);">
    <h:outputLabel id="lsone" for="tone" value="CustomerIdone:"/>
    <h:inputText id="tsone"/>
    <h:outputLabel id="lstwo" for="ttwo" value="CustomerNameone:"/>
    <h:inputText id="tstwo"/>
    <h:outputLabel id="lsthr" for="tthr" value="Designationone:"/>
    <h:inputText id="tsthr"/>
    </h:panelGrid>
    </div>
    </h:form>
    <script type="text/javascript">
    window.alert("before creating the animated object")
    var collapse1=new animatedcollapse("dog", 100, true)
    </script>
    </body>
    </html>
    </f:view>
    I have copied the animatedcollapse.js file also ....do I need to copy any thing...please tell me its very urgent for me...
    thanks...

    one more thing I observed is if i put
    <img src="images/xp-info-pane-arrow_down_over.gif" border="0">
    in the panelgrid instead of <h:outputLink>it is executing the method correctly but it displaying that link above to the panel grid. how can I put the image inside the panel grid....why that functionality didn't work with <h:outputlink> tag???
    can any one please tell me.....

  • Unterminated String Constant error generated by JSF

    I'm getting the error in javascript and not being able to figure it out. It is caused by <h:outputLink> tag trying to load HTML page in IE6 browser.
    I'm attaching this page and hopefully someone would come up with a solution. Thanks a lot in advance.
    <head>
    <script type="text/javascript">
    function doPopup(value){
    popup = window.open("mqClientSetting.faces?applid="
    + value,"popup","height=605,width=620,toolbar=no,menubar=no,"
    + "scrollbars=yes");
    popup.focus();
    </script>
    <link href="styles.css" rel="stylesheet" type="text/css"/>
    <title>MQ Browser</title>
    </head>
    <table class="mqHeader">
    <tbody>
    <tr>
    <td><img src="/MqBrowser/IBM_logo.gif" /></td>
    <td><img src="/MqBrowser/shakehands.jpg" /></td>
    <td><img src="/MqBrowser/ABN_logo.gif" /></td>
    </tr>
    </tbody>
    </table>
    <hr>
    <body>
    <form id="j_id_id17" name="j_id_id17" method="post" action="/MqBrowser/mqClientApplications.faces" enctype="application/x-www-form-urlencoded">
    <input type="hidden" name="j_id_id17" value="j_id_id17" />
    <input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="j_id35:j_id36" />
    <div style="overflow:auto; width:100%; height:400px;" align="center">
    <table class="borders">
    <caption class="mqchanCaption">ABN AMRO business MQ applications</caption><thead>
    <tr>
    <th class="mqchanHeader" scope="col">Application</th>
    <th class="mqchanHeader" scope="col">Description</th>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td><a href="# onclick="doPopup('
    CRIS');return false;">
    CRIS</a></td>
    <td>cris
    </td>
    </tr>
    <tr>
    <td><a href="#" onclick="doPopup('
    GLOBAL NETTING');return false;">
    GLOBAL NETTING</a></td>
    <td>TF
    </td>
    </tr>
    </tbody>
    </table>
    </div>
    </form>
    </body>

    <a href="#" onclick="doPopup('
    CRIS');return false;">
    <a href="#" onclick="doPopup('
    GLOBAL NETTING');return false;">Remove those linebreaks.
    This is likely just custom code and not generated by JSF (at least, I never heard of a Javascript doPopup() function in JSF). If it is actually generated by JSF, then rise a bugreport at the site of the component manfacturer.

  • JSF 1.0 FCS Class cast exception

    Hello,
    I have just converted 2 of my apps from JSF 1.0 (Beta) to JSF 1.0 (FCS), and the conversion was really smooth and simple (good job JSF Team! ) but after converting to the new final release I noticed that my second application throws warning exceptions on every page display. I have isolated the cause to my use of the <f:verbatim>...</f:verbatim> tag nested within an <h:outputLink>...</outputLink> tag. The problem when looking at the decompiled code appears to have something to do with a cast to UIComponent. Has anyone else had a problem using verbatim with the FCS release? Here is the java trace.
    java.lang.ClassCastException
    at com.sun.faces.taglib.jsf_core.VerbatimTag.doAfterBody(VerbatimTag.java:82)
    at org.apache.jsp.index_jsp._jspx_meth_f_verbatim_23(index_jsp.java:2286)
    at org.apache.jsp.index_jsp._jspx_meth_h_outputLink_23(index_jsp.java:2253)
    at org.apache.jsp.index_jsp._jspService(index_jsp.java:108)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
    at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
    at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:142)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
    at java.lang.Thread.run(Thread.java:534)

    I am getting the same error using Weblogic 8.1.
    What I have is a custom tag which extends TagSupport embedded within the verbatim tag. The jsp looks as follows:
    <f:verbatim escape="false">
    <i:error_message_table id="errorMessageTable"/>
    </f:verbatim>
    Could this be related to the fact that TagSupport does not directly or indirectly extend "UIOutput" and therefore causes VerbatimTag.doAfterBody() to throw the ClassCastException?
    Any thoughts or help would aslo be appreciated.
    Here is the stack trace:
    java.lang.ClassCastException
         at com.sun.faces.taglib.jsf_core.VerbatimTag.doAfterBody(VerbatimTag.java:82)
         at jsp_servlet._jsp._interconnect.__userprofile._jspService(UserProfile.jsp:10)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:607)
         at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:400)
         at weblogic.servlet.jsp.PageContextImpl.include(PageContextImpl.java:154)
         at jsp_servlet._jsp._interconnect.__main._jspService(Main.jsp:25)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:301)
         at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:142)
         at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6350)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

  • Link Value to Bean

    Hi All.
    Im new to Java, so if Im going about this the wrong way, please let me know!
    Ive got a populated datatable and I want to be able to let the user select one of the rows and then underneath I want another datatable to be made showing records from my database with the original selection as the record ID.
    I believed this would be best using h:outputLink tags around my h:outputText component and then assigned the outputText value to a bean (which holds my sql connection info) if the relevant outputLink was clicked. However I cannot seem to find a way todo this. Can any1 help me, or give me help todo it a different way if this is not practical!
    Many Thanks in advance.

    JSF related questions should be posted in the JSF subforum: http://forum.java.sun.com/forum.jspa?forumID=427
    I'll give one hint anyway: HtmlDataTable#getRowData().

  • Parse XML file, read a tag with whitespaces value.

    Hi all,
    I've got a problem with reading a spaced value record from xml file using sys.xmltype.
    My xml file contains the following:
    <?xml version = '1.0'?>;
    <ROWSET>
    <ROW num="1">
    <FIRSTNAME>Nik</FIRSTNAME>
    <LASTNAME> </LASTNAME>
    <AGE>30</AGE>
    </ROW>
    </ROWSET>
    As you see last name contains four spaces!
    Now when I'm trying to read value from LASTNAME record I'm getting a NULL value, but I want it to return me those 4 spaces as they are.
    Here is a short code description of what I'm doing:
    declare
         xml sys.xmltype;
    str1 varchar2(100);
    str2 varchar2(100);
    begin
         xml := sys.xmltype.createxml(fileContentClob); -- I copy the file content into the fileContentClob variable.
         If xml.existsnode('//ROW['1']/LASTNAME') > 0 Then -- This condition evaluates as true
    str1 := xml.extract('//ROW['1']/LASTNAME/text()'); -- str1 gets NULL value :(, I want spaces as they are in the file.
    str2 := xml.extract('//ROW[' || 1 || ']/LASTNAME').getstringval; -- str2 gets <LASTNAME/> null tag :(.
         End If;     
    end;
    Seems like when it createxml from the fileContentClob it ignores the spaces and find LASTNAME as a null field.
    Do you have any suggestions on how can I fix that, so I can read whitespaces as they are in the file?
    I generate the file also using a xml toolpackage from oracle:
    declare
    strSqlStmt Varchar2(300);
    varCtxHdl dbms_xmlquery.ctxhandle;
    varClob Clob;
    begin
    strSqlStmt := 'SELECT FIRSTNAME,LASTNAME,AGE FROM USERS WHERE ROWNUM =1';
    varCtxHdl := dbms_xmlquery.newcontext(strSqlStmt);
    varClob := dbms_xmlquery.getxml(varCtxHdl);
    dbms_xmlquery.closecontext(varCtxHdl);
    End;

    Even if the STORE AS CLOB clause is used to store the data and preserve whitespace for the XML, the actual extraction of data seems to be removing whitespace...
    SQL> ed
    Wrote file afiedt.buf
      1* create table t (xml xmltype) xmltype xml store as clob
    SQL> /
    Table created.
    SQL> ed
    Wrote file afiedt.buf
      1  insert into t (xml)
      2  values (q'[<?xml version = '1.0'?>
      3  <ROWSET>
      4  <ROW num="1">
      5  <FIRSTNAME>Nik</FIRSTNAME>
      6  <LASTNAME>    </LASTNAME>
      7  <AGE>30</AGE>
      8  </ROW>
      9* </ROWSET>]')
    SQL> /
    1 row created.
    SQL> select * from t;
    XML
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <FIRSTNAME>Nik</FIRSTNAME>
    <LASTNAME>    </LASTNAME>
    <AGE>30</AGE>
    </ROW>
    </ROWSET>
    SQL> set null NULL
    SQL> select x.rnum, x.firstname, x.lastname, x.age
      2  from t
      3      ,xmltable('/ROWSET/ROW'
      4                PASSING t.xml
      5                COLUMNS rnum      NUMBER       PATH '/ROW/@num'
      6                       ,firstname VARCHAR2(10) PATH '/ROW/FIRSTNAME'
      7                       ,lastname  VARCHAR2(10) PATH '/ROW/LASTNAME'
      8                       ,age       NUMBER       PATH '/ROW/AGE'
      9               ) x
    10  /
          RNUM FIRSTNAME  LASTNAME          AGE
             1 Nik        NULL               30
    SQL>

  • How to render outputlink as an area tag rather than an a tag

    Hi all,
    As stated in JSF document, both shape and coords are valid properties in outputlink. So, I have tried following
    <map name="monkey">
    <h:outputLink shape="rect" coords="0,0,30,30" value="http://yahoo.com"/>
    </map>
    however. that is rendered as &lt;a href="http://yahoo.com" coords="0,0,30,30" shape="rect">&lt;/a>, what I really want is
    &lt;area href="http://yahoo.com" coords="0,0,30,30" shape="rect">&lt;/area> ...
    I mean if outputlink can only be render an a tag, but not an area tag, I do not see why it will support shape and coords propeties ...
    Any help here ...
    Thanks a million
    Edited by: EJP on 5/09/2011 10:50: fixed your meta-HTML

    886619 wrote:
    I know that coords and shape are defined in w3c standard, my questions are
    1) what jsf component can be rendered as area tag for html frontend?None that I am aware of. You could write your own. Or, if an existing component is appropriate, you could write an alternative renderer for the component.
    2) "The position and shape of the hot spot on the screen (for use in client-side image maps)." That is the sentence for JSF document, what you think about for use in client-side image map mean? I donot see why render as <a> tag for client-side image map will be an acceptable solution ...I don't think this has anything to do with JSF at this point; JSF simply passes these values through to the rendered HTML. You have to understand how to use HTML to make proper use of these attributes.

  • Getting rid of whitespace in a tag body

    I've got a tag that looks something like this:
    <lib:title>
       <logic:present name="x" value="true">
          Hello
       </logic:present>
       <logic:present name="x" value="false">
          Goodbye
       </logic:present>
    </lib:title>
    The TITLE tag does a getBodyContent() to retrieve whatever is inside the TITLE tags.
    The problem is that it has lots of whitespace around it - ie. a couple of carraige returns and some tabs. So the bodyContent ends up being "\n\tHello\n".
    Is there a way I can turn this off, or do I have to trim it out manually after I call getBodyContent()?
    Cheers!

    Good point - this works. The actual example has a couple more conditional tags and is a bit more involved, and just becomes a bit difficult to read.
    I thought I remembered reading something from a book in my early JSP days which mentioned some sort of flag or attribute you could set on a tag or maybe at a page level that ignored whitespace - but of course I can't find it now...

  • Htmleditorkit parser compresses whitespace whithin a PRE tag

    I'm using the parser to read an html document which includes a "PRE" tag and then space/newline formatted text. All the spaces and newlines are compresesed into a single space when the handleText callback is called. Is there any way of stopping this happening? Is it a bug?

    Small example follows - as suggested it was a good exercise as I've been able to determine that the issue is actually pre-formatted text following a table.
    package smalltestcase;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.net.URL;
    import javax.swing.text.html.HTMLEditorKit;
    import javax.swing.text.html.HTMLEditorKit.ParserCallback;
    public class Main {
        public static void main(String[] args) {
            Main m = new Main();
        public Main() {
            try {
                HTMLEditorKit.Parser parser = new ParseHTML().getParser();
                System.out.println("Test 1 - Processes <PRE> tag as expected\n");
                parser.parse(new InputStreamReader(new URL("http://www.screwtape.co.uk/test1.htm").openStream()), new Callback(), true);
                System.out.println("\n\nTest 2 - Whitespace following table is compressed\n");
                parser.parse(new InputStreamReader(new URL("http://www.screwtape.co.uk/test2.htm").openStream()), new Callback(), true);
            } catch (IOException ex) {
                ex.printStackTrace();
        public class ParseHTML extends HTMLEditorKit {
            public HTMLEditorKit.Parser getParser() {
                return super.getParser();
        class Callback extends ParserCallback {
            public Callback() {
                super();
            public void handleText(char[] data, int pos) {
                System.out.println(data);
                for (int i = 0; i < data.length; i++) {
                    System.out.print(data);
    System.out.print("=" + String.valueOf((int) data[i]) + " ");
    System.out.println("END");
    }and the output this gives is:Test 1 - Processes <PRE> tag as expected
    This is a test web page
    T=84 h=104 i=105 s=115 =32 i=105 s=115 =32 a=97 =32 t=116 e=101 s=115 t=116 =32 w=119 e=101 b=98 =32 p=112 a=97 g=103 e=101 END
    This is a test
    with several lines
    and a table made using spaces
    column 1 column 2
    row 1 col 1 row 1 col 2
    row 2 col 1 row 2 col 2
    T=84 h=104 i=105 s=115 =32 i=105 s=115 =32 a=97 =32 t=116 e=101 s=115 t=116
    =10 w=119 i=105 t=116 h=104 =32 s=115 e=101 v=118 e=101 r=114 a=97 l=108 =32 l=108 i=105 n=110 e=101 s=115
    =10 a=97 n=110 d=100 =32 a=97 =32 t=116 a=97 b=98 l=108 e=101 =32 m=109 a=97 d=100 e=101 =32 u=117 s=115 i=105 n=110 g=103 =32 s=115 p=112 a=97 c=99 e=101 s=115
    =10 c=99 o=111 l=108 u=117 m=109 n=110 =32 1=49 =32 =32 =32 =32 =32 =32 =32 =32 =32 c=99 o=111 l=108 u=117 m=109 n=110 =32 2=50
    =10 r=114 o=111 w=119 =32 1=49 =32 c=99 o=111 l=108 =32 1=49 =32 =32 =32 =32 =32 =32 r=114 o=111 w=119 =32 1=49 =32 c=99 o=111 l=108 =32 2=50
    =10 r=114 o=111 w=119 =32 2=50 =32 c=99 o=111 l=108 =32 1=49 =32 =32 =32 =32 =32 =32 r=114 o=111 w=119 =32 2=50 =32 c=99 o=111 l=108 =32 2=50 END
    Test 2 - Whitespace following table is compressed
    This is a test web page
    T=84 h=104 i=105 s=115 =32 i=105 s=115 =32 a=97 =32 t=116 e=101 s=115 t=116 =32 w=119 e=101 b=98 =32 p=112 a=97 g=103 e=101 END
    This is a test before
    the table
    with several lines
    T=84 h=104 i=105 s=115 =32 i=105 s=115 =32 a=97 =32 t=116 e=101 s=115 t=116 =32 b=98 e=101 f=102 o=111 r=114 e=101
    =10 t=116 h=104 e=101 =32 t=116 a=97 b=98 l=108 e=101
    =10 w=119 i=105 t=116 h=104 =32 s=115 e=101 v=118 e=101 r=114 a=97 l=108 =32 l=108 i=105 n=110 e=101 s=115
    =10 END
    This is a test
    T=84 h=104 i=105 s=115 =32 i=105 s=115 =32 a=97 =32 t=116 e=101 s=115 t=116 END
    cell in a table
    c=99 e=101 l=108 l=108 =32 i=105 n=110 =32 a=97 =32 t=116 a=97 b=98 l=108 e=101 END
    Test cell2
    T=84 e=101 s=115 t=116 =32 c=99 e=101 l=108 l=108 2=50 END
    This is a test with several lines and a table made using spaces column 1 column 2 row 1 col 1 row 1 col 2 row 2 col 1 row 2 col 2
    T=84 h=104 i=105 s=115 =32 i=105 s=115 =32 a=97 =32 t=116 e=101 s=115 t=116 =32 w=119 i=105 t=116 h=104 =32 s=115 e=101 v=118 e=101 r=114 a=97 l=108 =32 l=108 i=105 n=110 e=101 s=115 =32 a=97 n=110 d=100 =32 a=97 =32 t=116 a=97 b=98 l=108 e=101 =32 m=109 a=97 d=100 e=101 =32 u=117 s=115 i=105 n=110 g=103 =32 s=115 p=112 a=97 c=99 e=101 s=115 =32 c=99 o=111 l=108 u=117 m=109 n=110 =32 1=49 =32 c=99 o=111 l=108 u=117 m=109 n=110 =32 2=50 =32 r=114 o=111 w=119 =32 1=49 =32 c=99 o=111 l=108 =32 1=49 =32 r=114 o=111 w=119 =32 1=49 =32 c=99 o=111 l=108 =32 2=50 =32 r=114 o=111 w=119 =32 2=50 =32 c=99 o=111 l=108 =32 1=49 =32 r=114 o=111 w=119 =32 2=50 =32 c=99 o=111 l=108 =32 2=50 END
    Any further suggestions? I'm trying to read an external website, and have no control over the content, so unfortunately I can't adjust the source page.
    TIA
    DK.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Parsing CF tags - how to remove whitespace?

    I have an index.cfm in which I include additional CFM pages.
    index.cfm:
    </head>
    <cfinclude template="first.cfm">
    <cfinclude template="second.cfm">
    <cfinclude template="third.cfm">
    <cfinclude template="forth.cfm">
    <body>
    After executing the file:
    </head>
    <body>
    How can I remove these whitespace? For example first.cfm
    contains the following rows:
    <cfif isDefined("cookie.myCookie")>
    <cfif cookie.ZulzBeta neq "1234">
    <cflocation url="
    http://mypage">
    </cfif>
    </cfif>
    <cfif not isDefined("cookie.myCookie")>
    <cflocation url="
    http://mypage">
    </cfif>
    I know that using <cfscript> this problem won't happen
    but there are a lot of things that I'm not able to do with
    <cfscript>. What should I do?

    <cfprocessingdirective suppressWhiteSpace = "Yes">
    <cfinclude template="first.cfm">
    <cfinclude template="second.cfm">
    <cfinclude template="third.cfm">
    <cfinclude template="forth.cfm">
    <cfprocessingdirective suppressWhiteSpace = "No">
    <!--- Code for the rest of the page --->
    </cfprocessingdirective>
    </cfprocessingdirective>

Maybe you are looking for