JSF tags within normal HTML tags (jsfc attribute)

Hi all,
I was just browsing some JSF and Acegi information and I found the following tutorial:
http://www.javakaffee.de/blog/2006/07/04/jsfacegi-authentication-with-a-backing-bean/
In it, the author uses regular html tags but with attributes that allow JSF functionality.
<input jsfc="h:inputText" id="inputUsername" value="#{authenticationController.username}" />I have never seen JSF done like this, could anyone inform me as to what is the jsfc property is?
Thanks!
Illu

Ah, I found out my query. It's a feature in Facelets I believe. The link below has the info.
Cheers,
Illu
http://www.jsftoolbox.com/documentation/facelets/06-CodeView/jsfc-feature.jsf

Similar Messages

  • Nesting a BC4J JSP data tag within a Struts tag?

    Has anybody tried nesting a BC4J JSP data tag within a Struts JSP tag? I can't get it to work. For example,
    <logic:equal name="sort" value="<jbo:ShowDefinition datasource='ds' dataitem='CustomerName' definition='ColumnName' />">
    blah blah blah
    </logic:equal>

    Try using single quotes in the value=' ' and double quotes in the jbo tag usage.

  • Use Transformer tag within HTML tag

    Does anyone know how to use the transformer tag within the HTML tag? I couldn't get it to work...
    I.e <input type="hidden" name"id" value="<pt:userInfo name='EmployeeID' xmlns:pt='http://www.plumtree.com/xmlschemas/ptui/'/>">
    The example above didn't give the actual value...the <pt> tag never got parsed...
    I even tried with the <c:set> JSTL tag as well, same result...the <pt> tag never got parsed...
    Please advise!
    Thanks
    BC

    You can work around this with JavaScript:
    <input type=&#034;hidden&#034; id=&#034;myHiddenField&#034; value=&#034;&#034; />
    <script type=&#034;text/javascript&#034;>
    var employeeID = &#034;<pt:userInfo name='EmployeeID' xmlns:pt='http://www.plumtree.com/xmlschemas/ptui/'/>&#034;;
    document.getElementById('myHiddenField').value = employeeID;
    </script>

  • ADF Faces: is mixing JSF RI and ADF Faces tags supported?

    Hi,
    I'm looking at ADF Faces as a future possibility for our application that is currently based on JSF RI.
    When looking at the ADF Faces demo it strikes me that all pages are almost completely built up from ADF Faces tags.
    For instance
    af:form
    af:commandButton
    af:inputText
    are used instead of the equivalent core jsf tags f:form, f:commandButton and f:inputText
    I'm wondering if this is mandatory if we would like to use some ADF Faces components mixed within our existing application.
    In other words: are ADF Faces tags supported in the environment of conventional JSF tags? And mixing ADF Faces JSF components with JSF components by other vendors?
    Another thing that strikes me is that pages are constructed using ADF Faces tags for any and all markup content.
    I guess this is meant to support several different clients (normal browser applications, mobile clients, voice activation over telephone) using different renderers.
    In my experience abstracting markup this way inherently means loss of control over the exact markup that is sent to the client. This is not acceptable for all projects and customers.
    Is embedding ADF Faces tags within template HTML, within f:verbatim tags or not, supported?
    Regards,
    Joost de Vries

    You absolutely can mix JSF RI and ADF Faces tags. This is very much supported! You can swap in <h:form> and <h:commandButton> and <h:inputText>. Our versions support some features that the JSF tags do not, as described in our release notes.
    Your point about using tags to produce all markup is a very cogent one. For some projects, absolute control over HTML will be a necessary requirement, so we do support that style of development. But we believe strongly that the future does not lie in constant handcoding of HTML, but instead in building more powerful, flexible, and reusable components and assembling those into pages. This was one of the themes of a talk I gave with two coworkers at this past JavaOne.
    -- Adam Winer (JSF EG member and ADF Faces lead)

  • How to add events to a ordinary html tag

    How can i add a event to ordinary tag
    Ex:
    public void encodeBegin(FacesContext context) throws IOException {
    ResponseWriter writer = context.getResponseWriter();
    writer.startElement("div", this);
    writer.writeAttribute("id", getClientId(context), null);
    String width = (String)getAttributes().get("width");
    String height = (String)getAttributes().get("height");
    String style = (String)getAttributes().get("style");
    style= (style!=null) ? style + ";" : "";
    if (width != null) style += "width:" + width + ";";
    if (height != null) style += "height:" + height+ ";";
    writer.writeAttribute("style", style, null);
    String styleClass = (String)getAttributes().get("styleClass");
    if (styleClass!=null)
    writer.writeAttribute("class", styleClass, null);
    String title = (String)getAttributes().get("title");
    if (title!=null)
    writer.writeAttribute("title", title, null);
    public void encodeEnd(FacesContext context) throws IOException {
    ResponseWriter writer = context.getResponseWriter();
    writer.write("<input type=\"button\" name=\"but\"/>");
    writer.endElement("div");
    i want to add event and bean for the <<< writer.write("<input type=\"button\" name=\"but\"/>"); >>>line of code, which is nothing but a button. I can added using JSF concept. but the requirement is like this. I have to add normal html tag for which i have to use bean and events as well.
    Can anyone give suggestion for this

    I will give a clear example
    writer.write("<h:outputText id=\"txt\" value=\"Just a Display\" />");
    writer.write("div");
    this 2 lines is in endcodeEnd method. The output text wont display the msg.
    even i am writing before the end tag
    Here is the full code
    ================
    public void encodeBegin(FacesContext context) throws IOException {
    ResponseWriter writer = context.getResponseWriter();
    writer.startElement("div", this);
    writer.writeAttribute("id", getClientId(context), null);
    String width = (String)getAttributes().get("width");
    String height = (String)getAttributes().get("height");
    String style = (String)getAttributes().get("style");
    style= (style!=null) ? style + ";" : "";
    if (width != null) style += "width:" + width + ";";
    if (height != null) style += "height:" + height+ ";";
    writer.writeAttribute("style", style, null);
    String styleClass = (String)getAttributes().get("styleClass");
    if (styleClass!=null)
    writer.writeAttribute("class", styleClass, null);
    String title = (String)getAttributes().get("title");
    if (title!=null)
    writer.writeAttribute("title", title, null);
    public void encodeEnd(FacesContext context) throws IOException {
    ResponseWriter writer = context.getResponseWriter();
    writer.write("<h:outputText id=\"txt\" value=\"Just a message\" />");
    writer.endElement("div");
    writer.write("<h:outputText id=\"txt\" value=\"Just a message\" />");
    This line is not executing
    kindly reply me..
    my mail id is [email protected]

  • How Do I Use the Help Tag/Help Path in LabVIEW to Link to a Specific tag in an HTML File?

    Is there any way to point user to a tag in an HTML file when he click "Click here for more help" ?
    Message Edited by zou on 03-08-2007 02:38 PM
    George Zou
    http://webspace.webring.com/people/og/gtoolbox
    Attachments:
    a.png ‏18 KB

    George,
    I believe you are correct in saying that there is no way to link directly to a specific anchor tag within an html file from the context help.
    I would encourage you to visit our Product Suggestion Center if this is a feature you would like to recommend that our R&D team consider for future versions of LabVIEW.
    Is it possible for you to create a .chm file?  Or perhaps you could have some kind of "table of contents" at the top of your .html help file.  This would require an extra click by the user but may be an option for you.
    Regards,
    Simon H
    Applications Engineer
    National Instruments
    http://www.ni.com/support/

  • Need to copy Data from a specific Html Tag

    Hello,
    I am trying to use CF to access website and capture data from a specific tag to the end of that tag and store same in a csv file or database.
    The tag based search of an open file is where I am not able to get any head way. Any one has done this?

    You'll need to use a regular expression for that. CF supports regular expressions with the REFind, REFindNoCase and REReplace functions. Here's an example of using regular expressions to capture the value within an HTML tag:
    http://www.javamex.com/tutorials/regular_expressions/example_scraping_html.shtml
    It's in Java, but the syntax for regular expressions is the same in CF.
    Dave Watts, CTO, Fig Leaf Software
    http://www.figleaf.com/
    http://training.figleaf.com/
    Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
    GSA Schedule, and provides the highest caliber vendor-authorized
    instruction at our training centers, online, or onsite.
    Read this before you post:
    http://forums.adobe.com/thread/607238

  • EL support in regular HTML tags?

    Is there something that would support EL-type expressions (${expr})within regular HTML tags? I've looked at JSTL, but it only support expressions within its own tags. But if I, for example, want to provide a dynamic value to a form field, I still have to resort to ugly things like <input type="text" value="<c:out var="name">"> while what I'd rather have is something like <input type="text" value="${name}">. Or do I simply misunderstand something?

    Is there something that would support EL-type
    expressions (${expr})within regular HTML tags? I've
    looked at JSTL, but it only support expressions within
    its own tags. But if I, for example, want to provide a
    dynamic value to a form field, I still have to resort
    to ugly things like <input type="text"
    value="<c:out var="name">"> while what I'd
    rather have is something like <input type="text"
    value="${name}">. Or do I simply misunderstand
    something?You need to wait for JSP 2.0 (Tomcat 5) to be able to do that.
    Patrick

  • Define HTML Tag for Parser - Help?

    Hi all,
    I'm trying to write a program which downloads a HTML script, parses it, extracts the links and checks to see which of these links are broken. While the parser is picking up tags that are well-formed, such as:
    Mark Humphrys -
    Research -
    The HTML script has a few malformed HTML tags such as the following:
    <li><b> References </b>
    <li><b> References </b>
    The snippet of code I'm using to try and get these malformed tags is as follows:
         ParserCallback parserCallback = new ParserCallback()
         public void handleText(final char[] data, final int pos) { }
              Tag a = HTML.Tag("a");
              public void handleStartTag(Tag tag, MutableAttributeSet attribute, int pos)
                   if (tag == a)
                   String address = (String) attribute.getAttribute("href");
                        list.add(address);
                   System.out.println(address);
         public void handleEndTag(Tag t, final int pos) {  }
         public void handleSimpleTag(Tag t, MutableAttributeSet a, final int pos) { }
         public void handleComment(final char[] data, final int pos) { }
         public void handleError(final java.lang.String errMsg, final int pos) { }
         };but I keep getting the error that they can't find the Tag() method. At the start of my code I have:
    import javax.swing.text.html.HTML;
    import javax.swing.text.html.HTML.Tag;so I don't understand why the compiler can't find the method. Is there something wrong with the way I'm using it?
    I have very little experience with this area so any help or pointers would be great!

    Sorry, the exact error message is:
    cannot find symbol,
    symbol: constructor Tag(java.lang.String)
    location: class javax.swing.text.html.HTML.Tag
    HTML.Tag a = new HTML.Tag("a");
    ^
    it should of course be a constructor not a method but the compiler still can't seem to find it. The proper code (in as much as I can tell although it still isn't working)
         ParserCallback parserCallback = new ParserCallback()
         public void handleText(final char[] data, final int pos) { }
              HTML.Tag a = new HTML.Tag("a");
              public void handleStartTag(Tag tag, MutableAttributeSet attribute, int pos)
                   if (tag == a)
                   String address = (String) attribute.getAttribute("href");
                        list.add(address);
                   System.out.println(address);
         public void handleEndTag(Tag t, final int pos) {  }
         public void handleSimpleTag(Tag t, MutableAttributeSet a, final int pos) { }
         public void handleComment(final char[] data, final int pos) { }
         public void handleError(final java.lang.String errMsg, final int pos) { }
         };

  • HTML tag HeLp

    Hie ,
    I would like to ask u guys help about a html tag.
    Do HTML tag contains a replacement for the tag "  '" ??????
    as i use this "  "tag for my coding , it brings some error when i re edit the form.
    IF anyone knows plz do let me know here.
    &nbsp is used for space, so i need a different tag that can function same as &nbsp...
    thank you.

    reference this thread with responses
    http://forum.java.sun.com/thread.jspa?messageID=3897479

  • Tiles + JSF error (Illegal to flush within a custom tag)

    Hi,
    When I try to use Tiles + JSF I have this error message :
    javax.servlet.jsp.JspException: Illegal to flush within a custom tag
    I am already using flush="false" on my tiles:insert tag.
    This is my .jsp code :
    <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
    <tiles:insert beanName="cadastro_base" beanScope="request" flush="false">
    <tiles:put name="form_body" type="string">
    <f:view>
    <h:form id="DisciplinaJsfBean" binding="#{DisciplinaJsfBean.form}" >
    <h:inputText id="codigo" binding="#{DisciplinaJsfBean.itCodigo}"/>
    </h:form>
    </f:view>
    </tiles:put>
    </tiles:insert>
    And this is the stack trace message :
    exception
    javax.servlet.ServletException: Illegal to flush within a custom tag
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
         org.apache.jsp.security.disciplina.cadastrarDisciplinas_jsp._jspService(cadastrarDisciplinas_jsp.java:99)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    root cause
    javax.servlet.jsp.JspException: Illegal to flush within a custom tag
         com.sun.faces.taglib.jsf_core.ViewTag.doEndTag(ViewTag.java:223)
         org.apache.jsp.security.disciplina.cadastrarDisciplinas_jsp._jspx_meth_f_view_0(cadastrarDisciplinas_jsp.java:205)
         org.apache.jsp.security.disciplina.cadastrarDisciplinas_jsp._jspx_meth_tiles_put_0(cadastrarDisciplinas_jsp.java:157)
         org.apache.jsp.security.disciplina.cadastrarDisciplinas_jsp._jspx_meth_tiles_insert_0(cadastrarDisciplinas_jsp.java:122)
         org.apache.jsp.security.disciplina.cadastrarDisciplinas_jsp._jspService(cadastrarDisciplinas_jsp.java:92)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:130)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    Danilo.

    What worked for me was to add a flush="false" to each of the <tiles:insert tags in my layout page.
    I'm using this with JSF so it may be different for you:
    ... Layout stuff ...
       <tiles:insert attribute="body" flush="false" />
    ... More layout stuff, including more inserts with the flush="false" ....

  • Insert HTML.Tag attributes?

    Hey,
    How would I insert html attributes? I am making a HTML Editor.
    The following are some valid java html attributes. How would I insert it properly?
    HTML.Tag.P, HTML.Tag.BLOCKQUOTE, HTML.Tag.CENTER,
    HTML.Tag.CITE, HTML.Tag.CODE, HTML.Tag.H1, HTML.Tag.H2,
    HTML.Tag.H3, HTML.Tag.H4, HTML.Tag.H5, HTML.Tag.H6,
    HTML.Tag.PRE
    Like for example, to make text bold, you would do
    MutableAttributeSet attr = new SimpleAttributeSet();
    StyleConstants.setBold(attr, true);
    textpane.setCharacterAttributes(attr,false);
    Is there similar code like the one above to add HTML.Tags like the ones I listed above in my post?
    Thanks in advance

    Hi,
    sorry about the delay, couldn't find this thread last night.
    Useful docs:
    http://java.sun.com/products/jfc/tsc/articles/text/element_interface/index.html
    and
    http://java.sun.com/products/jfc/tsc/articles/text/attributes/
    Those methods are in javax.swing.text.html.HTMLDocument and take the form insertBeforeStart(Element, String). As I said yesterday, as soon as you have text then the caret is in a character Element and a Paragraph element. So for e.g. if you're in a P element and you want to create an H1 element, how do you do it? If the user clicks your H1 button then you create an empty heading, easy enough. But if they have some text selected then you have a choice. You could just create an empty H1 or you could assume that they have typed the H1 content and have highlighted it so that it becomes an H1. You then have to change the existing element so that is no longer has the (now H1) text in it.
    That's where the other two methods (setInnerHTML and setOuterHTML) come into play.
    The other problemette that I'm working on is reseting text back to normal after it has been formatted.
    Suppose you have a P paragraph. The user highlights a single word, clicks Bold. That's easy. Then they decide that they don't want it bold, so they click the Normal button. Taking bold off is easy, but should you. What if the paragraph element was actually an H1 element. If you turn bold off now then that word no longer matches the H1 style.
    You could check at the caret position just before the start of the element that the user has selected and see what the style is there. BUt then waht if the user has the word before perhaps underlined. Again it's unreliable.
    Also I'm finding then when I remove the bold formatting that the element isn't being reabsorbed into it's parent. In a paragraph if I go through and make each word formatted (B, i, u) and then switch the formatting off word at a time I end up with each word as an element.
    Still working on these, so I'll post a solution when I have one.
    regards
    sjl

  • How to set an attribute of a HTML tag with a value in the Servlet

    I have a HTML page and a Servlet.
    The HTML page sends a request to the Servlet.
    The Servlet has to read the contents of the HTML page. When the Servlet encounters the body tag it should set the bgcolor attribute of the body tag with a string(For eg.a string called color with a value blue) in the servlet.
    After doing this the Servlet has to update the original HTML page with the changes (in the body tag).
    I need a help on this.

    Hi sangee,
    you could get what you want to do by using a Java Server Page instead of both a HTML page and a Servlet.
    I should code something like this:
    <%Strung color="yourColor"%>
    <html><head><title></title></head>
    <body bgcolor="<%=color%>
    </body>
    </html>

  • Firefox 4 seems to action on some html tags that are included within a html comment tag which it should not.

    Consider the following html code where I open a textarea and include a comment tag within the textarea. Within the comment tag (which Firefox 4 should ignore) I've included a close textarea tag. Firefox 4 (unlike FF3 and IE) closes the textarea.
    The following code is also available at
    http://www.cems.uwe.ac.uk/caa/ffbug/index.html
    We are about to start a textarea....<p>
    <pre><nowiki><textarea rows='20' cols='40'>
    Here is the textarea.
    Inside these comment blocks I'll put a close textarea tag which Firefox should ignore but does not.
    <p>
    <!--
    We are now inside comment blocks...
    <br>
    This code should be inside the text area.<br>
    </textarea>
    <br>
    and so should this code be <b>inside</b> the text area (but is not in Firefox 4).
    -->
    </textarea>
    <p></nowiki></pre>
    This code should be outside the textbox.

    Try posting at the Web Development / Standards Evangelism forum at MozillaZine. The helpers over there are more knowledgeable about web page development issues with Firefox. <br />
    http://forums.mozillazine.org/viewforum.php?f=25 <br />
    You'll need to register and login to be able to post in that forum.

  • Converter for converting all HTML tags to JSF tags

    hai all,
    i am new to JSF. i need a suggestions to convert all my HTML pages to JSF pages bcoz i was already created more pages in HTML and now i want to convert all the pages to JSF. can u give any suggestion plz post it here or send me a mail to [email protected]
    thanks in advance,
    regards,
    V.Sabarish

    hi roman,
    thanks for ur reply. it converts the file but the links r not converting....so can u suggest me another way for converting a HTML tags to JSF tags.

Maybe you are looking for

  • How to convert class file

    Hi all, I am new in java card development. This is my environment setting: @echo off set JC_HOME=C:\JavaCard\java_card_kit-2_2 set JAVA_HOME=C:\j2sdk14103 set PATH=.;%JC_HOME%\bin;%PATH% I have created the Wallet applet according to 'Zhiqun Chen" tex

  • Set preview as default PDF viewer

    Hello, I downloaded the update for Adobe Reader and during installation, it over-rode my choice to use Preview as my default PDF viewer in Safari.  I've searched high and low and tried to change this from both Safari's preferences and Adobe Reader's

  • Drag'n'Drop working in CS, not in CC

    Hi everybody, I have a Flex panel and a native plugin in InDesign. From the flex panel, I initiate a drag, that I wish to drop in InDesign. In my plugin, I have a CDragDropTargetFlavorHelper that works fine up to CS6 to handle the drop initiated by t

  • I would like to recover a license from an iMac that has died. How do I do it?

    An iMac died and has been replaced. I know my product key but how do I de-register the product from the dead machine and register it to the new machine? Thank you, Rod

  • Resolving Wi-Fi settings grayed out issue O2 UK

    Well I have the infamous grayed out Wi-Fi issue. I'm posting this discussion so those in the UK know what their options are. If you call Apple UK support, they will ask you to try the following: Verify that Airplane Mode is off. Restart your device U