HTML markup for JSF page

I have a JSF page containing both standard JSF components and custom components. In the page am able to trigger AJAX requests,capture the requests in phaselistener. Now what I want is to generate output for a particular div inside the whole page. This div in turn contains a JSF page. The HTML markup corresponding to the page has to be sent to the browser.
(i.e) I need a mechanism wherein I can specify the name of JSF page,get the HTML markup for the same and send it across to the browser as response. Please guide me as how to go about it.

Its been a week since I posted this query.Still no replies. Let me make myself clear.
Suppose am having
<h:panelGroup id="outerDiv">
                 <h:panelGroup id="innerDiv1">
                                <jsp:include > //Includes firstpage-JSF page
                  </h:panelGroup>
                  <h:panelGroup id="innerDiv2">
                                <jsp:include > //Includes second page-JSF page
                   </h:panelGroup>
</h:panelGroup>I want to send an AJAX request,fetch corresponding HTML markup for the JSF page I have included and use it in javascript to write to the <div>. So is there any mechanism wherein I can give the name of the JSF page, get the corresponding HTML markup? If not, is there any workaround? I dont want to use any third-party components.

Similar Messages

  • Capture generated html output from jsf page in bean

    Hi Member,
    I have need to capture the html output coming form jsf page. means aftr rendering what html is displayed before user, we have need to get it in programm.
    like if we use:
    <h:dataTable......>
    <h:colum>heloo</h:column>
    </h:dataTable>
    then their ouput will be:
    <table>
    <tr><td>heloo</td></tr>
    </table>
    and i have need of these complete line with <table> ......</table>
    Please help me...
    Thanks
    Shailendra Kumar

    Thnx for quick reply.
    But i want to capture it in render response phase. May it will be possible??? Is render response phase is responsible for generation of HTML format?? If yes then how can we capture output coming from this phase.
    URLConnection if fine but it still hit server once. I don't want that. I want to store page html format during its view preparation for html.
    Thanks
    Shailendra Kumar

  • Html markup for "NAME" field in APEX 4.02.00.07 tree structure

    Hi,
    I've seen countless examples of modifying the appearance of the NAME field of an APEX 4 tree, but I can't get it to work. If I create the tree as below, all I get is :
    <b>the Name</b> on each node of the tree. I can't seem to make the NAME field bold. Can you tell me what I'm doing wrong?
    Thanks.
    Susan
    Here's the code:
    select case when connect_by_isleaf = 1 then 0
    when level = 1 then 1
    else -1
    end as status,
    level,
    '<b>' || "NAME" || '</b>' as name,
    null as icon,
    "ID" as value,
    null as tooltip,
    null as link
    from "#OWNER#"."TEMP"
    start with "PID" is null
    connect by prior "ID" = "PID"
    Edited by: axiom7 on Aug 2, 2011 10:00 AM
    Just posted, and I see that my attempt to show the html markup, simply marked up the text. What I mean is that the html markup does not embolden the NAME field. I just see the bracketed html markup tags on either side of the NAME field. I hope I am being clear enough.

    Axiom,
    Unfortunately, the version of jsTree currently bundled in APEX does not include support for HTML titles. You can hack it in by using an on page load dynamic action to convert the plain-text titles to HTML (though that can get really ugly very quickly). Or you can use a PL/SQL region to create a tree using the latest jsTree build. (Demo page here.)
    -David

  • How to use HTML tags inside JSF pages

    I am creating a Menu using dataTable and outputLink in a JSF page.
    <div class="bodyarea">
    <div id="location">
    <ol>
    <h:dataTable value="#{menuItem.breadCrumb}" var="bread" >
    <h:column>
    <li>
    <h:outputLink id="crumbID" value="#{bread.menuLink}">
    <h:outputText id="crumpName" value="#{bread.menuLabel}" style="width: 165px;"/>
    </h:outputLink>
    <li>
    </h:column>
    </h:dataTable>
    </ol>
    </div>
    </div>
    I want to use <li> HTML tag as shown in code above before and after every <tr> tag formed, but when i run it and see view source, this is how it shows:
    NOTE: you can see it has thrown out of <table> tag itself.
    <div class="bodyarea">
    <div id="location">
    <ol>
    <li>
    </li>
    <table>
    <tbody>
    <tr>
    <td><a id="_id0:0:crumbID" href="/eApps/admin/loginPage.jsp?MenuItem=-1"><span id="_id0:0:crumpName" style="width: 165px;">Home</span></a></td>
    </tr>
    <tr>
    <td><a id="_id0:1:crumbID" href="/eApps/admin/loginPage.jsp?MenuItem=3~-1"><span id="_id0:1:crumpName" style="width: 165px;">HIM Admin</span></a></td>
    </tr>
    </tbody>
    </table>
    </ol>
    </div>
    </div>
    Can some one help me, how do i use HTML tags inside <h:dataTable>.
    Or is their any other way i should form my Menus, to fully utilize to HTML tags.
    Thanks
    Ravi

    Hello,
    You can embed the verbatim elements in your datatable, ie,
    <h:dataTable value="#{menuItem.breadCrumb}" var="bread" >
      <h:column>
        <f:verbatim><li></f:verbatim>
        <h:outputLink id="crumbID" value="#{bread.menuLink}">
          <h:outputText id="crumpName" value="#{bread.menuLabel}" style="width: 165px;"/>
        </h:outputLink>
        <f:verbatim></li></f:verbatim>
      </h:column>
    </h:dataTable>

  • (Inside) is this the only way of specify html markup for attributes in uiXML?

    Hi, I could not work out a way other than creating a DataObject to specify html markup in certain attributes, for example the tip attribute.
    Is there any other way?
    <provider>
    <data name="capts:formatted_text">
    <method class="oracle.capts.CaptsProvider" method="getDataObject"/>
    </data>
    </provider>
    <inlineMessage prompt="Search" vAlign="middle" data:tip="tip1@capts:formatted_text">
    package oracle.capts;
    import oracle.cabo.ui.data.DataObject;
    import oracle.cabo.ui.RenderingContext;
    import oracle.capts.CookieDataObject;
    import oracle.capts.SessionAttributeDataObject;
    public class CaptsProvider
    private static final String CAPTSNAMESPACE = "http://xmlns.oracle.com/capts";
    private static final String COOKIEDATAOBJECT_NAME = "cookie";
    private static final String SESSIONATTRIBUTEDATAOBJECT_NAME = "session_attribute";
    private static final String FORMATTEDTEXTDATAOBJECT_NAME = "formatted_text";
    public static DataObject getDataObject(RenderingContext context, String namespace, String name)
    * context - the current rendering context
    * namespace - the namespace of the requested DataObject
    * name - the name of the requested DataObject
    if (_CAPTS_NAMESPACE.equals(namespace))
    if (name.equals(_COOKIE_DATAOBJECT_NAME))
    return new CookieDataObject();
    else if (name.equals(_SESSIONATTRIBUTE_DATAOBJECT_NAME))
    return new SessionAttributeDataObject();
    else if (name.equals(_FORMATTEDTEXT_DATAOBJECT_NAME))
    return new FormattedTextDataObject();
    return null;
    package oracle.capts;
    import oracle.cabo.ui.data.DataObject;
    import oracle.cabo.ui.RenderingContext;
    import oracle.cabo.servlet.BajaContext;
    import oracle.cabo.servlet.ui.BajaRenderingContext;
    public class FormattedTextDataObject implements DataObject
    public Object selectValue(RenderingContext context, Object select)
    BajaContext bajaContext = BajaRenderingContext.getBajaContext(context);
    String result = "";
    if ( ((String)select).equals("tip1") )
    result="<html>Use the <tt><b>%</b></tt> operator as a wildcard. e.g. Enter <tt><b>%</b><tt> to return all rows, or <tt><b>%ab%</b><tt> to return rows that for the chosen search attribute contain the string <b>ab</b>.</html>";
    return result;

    I think there's three things going on here. First, you do not need to put these HTML
    strings in DataObjects. You're probably forgetting to escape the strings - uiXML is XML,
    and you've got to follow the rules of XML. For example, the following is illegal XML,
    not because of anything in UIX, but because it's invalid XML:
      <messageTextInput tip="<html><b>foo</b></html>"  ../>... and must be written as:
      <messageTextInput tip="&lt;html>&lt;b>foo&lt;/b>&lt;/html>"  ../>From Java, you only have to follow the Java escaping rules (like \" and \\),
    which is why your code only seems to work when you're grabbing the string from
    a DataObject.
    OK - second thing. There is a new <formattedText> element, and if you want to insert
    HTML markup, you can replace a <styledText> with a <formattedText> and it'll do the job.
    And - third thing. The "tip" and "message" attributes in UIX contain automatic
    support for HTML markup. But you have to let us know when you're using HTML markup,
    and the way you do that is by surrounding the string in <html>...</html> - or,
    once escaped for XML, &lt;html>...&lt;/html>

  • How to get the parsed HTML from a JSF Page

    Hi,
    I have an application that the user must fill in some data. Later on, it's shown a confirmation page with the user's information. I want to email that confirmation page to the company. The question is: How can I get the result html page as a string from that jsf confirmation page within the application.
    Any help is appreciated,
    Tiago Gaspar.

    I need the exat same page the user is viewing i.e. html filed with the information .

  • HTML Source for Web Page Guest Authentication

    Where is the html source located in the WLC for Guest web authentication page.                  

    If you have 5508 WLC you can download it from here:
    http://www.cisco.com/cisco/software/release.html?mdfid=282600534&release=1.0.2&softwareid=282791507
    If other model, go to cisco download and choose the product to download the software for and from softwares to download for that product choose: Wireless Lan Controller Web Authentication Bundle
    (It is same bundle under all WLCs but you may or may not have permission to download the software depending on what WLC model is listed in your contract).
    HTH
    Amjad
    You want to say "Thank you"? Don't. Just rate the useful answers, that is more useful than "Thank you".

  • Can I change the html name for a page without changing the Menu?

    As I have links on resumes, and portfolios throughout the web, I'd like the  "about me page" to be called info.html. But "info" is a really stupid, general name for a Menu item. So, can I change the name of the pages HTML file to "info.html" without changing it on the menu?

    Hello Tony,
    When you right-click on the page you see within a menu the page properties. Click on that and under 'options' you can change the html pagename.
    Tjaard

  • How to add a html region for all pages ?

    Hi,
    How do i put a html text box with submit (Search this site) and a "select list" on all pages in my application.
    Something similar to creating a list in shared components and then put that list on all pages.
    Thanks in advance,
    Girish

    Create a page number 0. Any components you put on Page 0 are rendered on all pages in the application (You can conditionally exclude them from certain pages using the appropriate condition on the component)

  • @Intertseptors does not work for web bean (for JSF page)

    @Named
    @ConversationScoped
    @Interceptors(MyInterceptor.class)
    public class BeanWeb implements Serializable {
        public String methodThrowException throws Exception() {
            throws new Exception();
    public class MyInterceptor {
        @AroundInvoke
        public Object intercept(InvocationContext ic) throws Exception {
            try {
                return ic.proceed();
            } catch (Exception e) {
                return null;
    }For @Stateless beans interceptor works, but for the BeanWeb interceptor does not work. And we have never entered into "intercept" method.
    1. Why is this happening?
    2. How could intercept method calls in BeanWeb?
    P.S.: All this spin under Glassfish 3.x.

    All the links on this page work for me. Did you empty your browser cache before visiting the published site?

  • How to get rendered JSF page (send it as HTML email)

    Hello,
    I would like to send notification email in my application. Could you please help me to find a way how to get HTML result of JSF page as string-file-stream. Simply anything I could handle and use it as email body or attachment.
    My use case: User click to button (raise a action) which change something in DB and confirmation.xhtml(.jsf) is shown to him to confirm that this action was succesful. And I would like to send notification email to all other users with this page (simplified version).
    I need a something like String getJsfPage(String url) but I could not find anything in JSF API.
    Thanks for any clue.

    quote gimbal2: +...now write the code to generate the email body...+
    Thanks for reply...
    Is that mean that I could not use already written code (confirmation.xhtml)? The beuty on JSF is that JSF parser take care about CSS styles, EL, templating (ui: ...), ... When anybody (administrators) wants to change how this email looks - just change this XHTML file.
    How should I write email body? I thought about several way but nothing what looks good:
    - I really dont want to use StringBuilder do build HTML.
    - I dont want to write my own parser of .xhtml template (confirmation.xhtml).
    - Write HTML (xml) template and parse it with XSLT transformation seems to me acceptable but complicated. Needs a special library to perform XSLT, complicated template service (future changes)
    - JSP page, more-or-less the same problems like JSF page
    The sad is that this email (html) body is quite small but highly dynamic (css, language of texts, logos...).

  • PrepareRender() called multiple times if I have HTML/Images on a JSF page

    I have extended ADFPhaseListener and also FacesPageLifecycle. I am overriding the prepareRender() method in the CustomFacesPageLifecycle.
    When I insert an image on to the page in the branding facet or add any html using verbatim tag, the prepareRender() method is called two times. I am not sure why?
    If I remove the images/html, the method is only executed once.
    If I have image/html in the page, another strange thing is that the first time all the custom lines of code gets executed in prepareRender() method. But the second time only first few lines of code in the prepareRender() method. This seems to me a very wierd behaviour.
    Any inputs from ADF product dev team?
    Thanks
    - Amit Kochar

    Hi,
    if you add the following print statement
    System.out.println("rendering "+FacesContext.getCurrentInstance().getViewRoot().getViewId());
    Then the output in my case is
    07/04/24 08:14:04 rendering /BrowsePage.jsp
    07/04/24 08:14:05 rendering /otn_logo_small.gif
    The image comes from the file system, which means it is rendered by the JSF lifecycle. If you reference the image with a URL then the lifecycle doesn't render the image but only refrences it.
    To avoid your prepare render code to be executed multiple times, just check for jsp and jspx file extensions, which will guarantee that your code only executes for JSF pages, not for loaded files.
    The reason why this happens is because the JSF filter is set to /faces , which means all files that are loaded through that path
    Frank

  • "Bad" markup for non-English language in JSF

    Hi,
    the question emerged in "Problem ADF af:document i18n" thread, but, as I saw, it is more common, so I made this new thread. The question seems very simple, but by the moment I can't find an answer and it makes me doubt about the ability to use JSF...
    The sequence of my actions.
    1. My OS locale is russian (ru) (codepage windows-1251).
    2. Create a new application in JDev.
    3. Create an empty project in JDev.
    4. Create a new jsf page. JDev suggests windows-1251 encoding, creates faces-config.xml and so on.
    5. Place outputText JSF HTML component on the page. JDev creates the following markup: <h:outputText value="outputText1"/>.
    6. Change value="outputText1" to "text_in_russian".
    7. Run the page!
    The result looks OK, text is displayed correctly, but, if you look at the source code, though codepage is windows-1251, all russian symbols are encoded like & # 1058;& # 1077;& # 1082;& # 1089;& # 1090; (i put spaces, as otherwise you'd see russian letters: &#1058;&#1077;&#1082;&#1089;&#1090;). As far as I understand, this means overrun of traffic and besides I don't like the idea that my pages are so "untidy" behind.
    I specified default locale in faces-config.xml file, changed encoding and so on, but result was the same: everything looks fine, but entities instead of letters in html code.
    By the way, if I specify russian text, where it is not rendered, it is seen normally. But, if it is a rendered text, no matter, how - by outputText, inputText component or, for example, af:document or af:panelPage - entities instead of letters in the source code.
    Do you have any ideas?
    Thanks in advance, Valeriy

    Hello, <br>
    resulting page is windows-1251 encoded - that's OK.
    If I write page using, say, just HTML (in Notepad) or JSP, every symbol would take exactly 1 byte - in windows-1251 encoding, all Russian letters, are, of course, encoded with 1 byte. I would use entities or escape-sequences only for special characters, like copyright. And this is the behaviour I expect from JSF - since I use windows-1251 encoding for my pages, it must use 1 byte for russian letters. Why use entities or escape-sequences if letters are normally preseted with 1 byte?<br>
    For example, similarly, english letters are too can be written using & # xxxx, but, I think, everybody would be very surprised to look at the source code, resulting from JSF, and see that all english letters are written using & # xxxx. - again, why use entities and escape-sequences, if it is posible to make resulting HTML markup more understandable and consuming less space?<br>
    JSTL tags, for example, c:out, use "right" markup - exactly 1 byte for russian letters. Can I get such behaviour with JSF?<br>
    Imagine situation I described with english letters: you place, say, <h:outputText value="outputText1"/> in your code and expect to receive something like <span>outputText1</span>, but receive <span>& # xxxx; & # xxxx; & # xxxx;1</span>, while it is possible to use 1 byte for letter! Besides a "bad" look, this page will weight, say, 200K instead of 50K!<br>
    And the question is russian language must not be special for windows-1251 encoding!<br>
    I found such question at several forums, no decision found yet... And besides there can be JavaScript problems...<br>
    Waiting for your response
    Valeriy

  • How do I pass input values from a html page to a jsf page

    hi,
    In my project,for front view we have used html pages.how can I get input values from that html page into my jsf page.for back end purpose we have used EJB3.0
    how can I write jsf managed bean for accessing these entities.we have used session facade design pattern and the IDE is netbeans5.5.
    pls,help me,very urgent
    thanx in advance

    Simplest way is to rewrite html page into jsf page.
    You can use session bean in your managed bean like this:
    import javax.naming.Context;
    import javax.naming.InitialContext;
    public class ManagedBean {
    private Context  ctx;
    private Object res;
    // session bean interface
    private Service service;
              public ManagedBean() {
                try{
                     ctx = new InitialContext();
                     res = ctx.lookup("Service");
                     service = (Service) res;
               catch(Exeption e){
    }Message was edited by:
    m00dy

  • How can I put an output stream (HTML) from a remote process on my JSF page

    Hello,
    I've a question if someone could help.
    I have a jsf application that need to execute some remote stuff on a different process (it is a SAS application). This remote process produces in output an html table that I want to display in my jsf page.
    So I use a socket SAS class for setting up a server socket in a separate thread. The primary use of this class is to setup a socket listener, submit a command to a remote process (such as SAS) to generate a data stream (such as HTML or graphics) back to the listening socket, and then write the contents of the stream back to the servlet stream.
    Now the problem is that I loose my jsf page at all. I need a suggestion if some one would help, to understand how can I use this html datastream without writing on my Servlet output stream.
    Thank you in advance
    A.
    Just if you want to look at the details .....
    // Create the remote model
    com.sas.sasserver.submit.SubmitInterface si =
    (com.sas.sasserver.submit.SubmitInterface)
    rocf.newInstance(com.sas.sasserver.submit.SubmitInterface.class, connection);
    // Create a work dataset
    String stmt = "data work.foo;input field1 $ field2 $;cards;\na b\nc d\n;run;";
    si.setProgramText(stmt);
    // Setup our socket listener and get the port that it is bound to
    com.sas.servlet.util.SocketListener socket =
    new com.sas.servlet.util.SocketListener();
    int port = socket.setup();
    socket.start();
    // Get the localhost name
    String localhost = (java.net.InetAddress.getLocalHost()).getHostAddress();
    stmt = "filename sock SOCKET '" + localhost + ":" + port + "';";
    si.setProgramText(stmt);
    // Setup the ods options
    stmt = "ods html body=sock style=brick;";
    si.setProgramText(stmt);
    // Print the dataset
    stmt = "proc print data=work.foo;run;";
    si.setProgramText(stmt);
    // Close
    stmt = "ods html close;run;";
    si.setProgramText(stmt);
    // get my output stream
    context = FacesContext.getCurrentInstance();
    HttpServletResponse response = (HttpServletResponse) context.getExternalContext().getResponse();
    ServletOutputStream out = response.getOutputStream();
    // Write the data from the socket to the response
    socket.write(out);
    // Close the socket listener
    socket.close();

    The system exec function is on the Communication palette. Its for executing system commands. On my Win2K system, the help for FTP is:
    "Ftp
    Transfers files to and from a computer running an FTP server service (sometimes called a daemon). Ftp can be used interactively. Click ftp commands in the Related Topics list for a description of available ftp subcommands. This command is available only if the TCP/IP protocol has been installed. Ftp is a service, that, once started, creates a sub-environment in which you can use ftp commands, and from which you can return to the Windows 2000 command prompt by typing the quit subcommand. When the ftp sub-environment is running, it is indicated by the ftp command prompt.
    ftp [-v] [-n] [-i] [-d] [-g]
    [-s:filename] [-a] [-w:windowsize] [computer]
    Parameters
    -v
    Suppresses display of remote server responses.
    -n
    Suppresses autologin upon initial connection.
    -i
    Turns off interactive prompting during multiple file transfers.
    -d
    Enables debugging, displaying all ftp commands passed between the client and server.
    -g
    Disables file name globbing, which permits the use of wildcard characters (* and ?) in local file and path names. (See the glob command in the online Command Reference.)
    -s:filename
    Specifies a text file containing ftp commands; the commands automatically run after ftp starts. No spaces are allowed in this parameter. Use this switch instead of redirection (>).
    -a
    Use any local interface when binding data connection.
    -w:windowsize
    Overrides the default transfer buffer size of 4096.
    computer
    Specifies the computer name or IP address of the remote computer to connect to. The computer, if specified, must be the last paramete
    r on the line."
    I use tftp all of the time to transfer files in a similar manner. Test the transfer from the Windows command line and copy it into a VI. Pass the command line to system exec and wait until it's done.

Maybe you are looking for

  • Colour profiles and my sanity!

    I hope there's someone here who can help this Photoshop newbie! I am a keen but very amateur photographer, and  I'm experiencing a frustrating problem in Photoshop and though I've read a few articles on Colour Profiles, I must be missing something ob

  • I need help with rollovers

    I'm trying to create rollovers for my header for my web-site.. I want each letter to change to a different color when rolled over..but I don't need it to be linked to any sites I just want it as a graphic element.I'm designing in MUSE I have the text

  • Mail not showing attachments

    This problem seems to be documented here: https://discussions.apple.com/thread/1526523?start=0&tstart=0 but not resolved. In Mail 4.5, I randomly fail to get attachments from senders.  Today I had it happen again multiple times from a sender; no atta

  • How Can I do a System Reset for my Nokia 3120

    Does anyone know how to do a system reset on a regular Nokia 3120? Thanks!

  • Using getContentPane() in JFrame class

    Hello, I'm reading Bruce Eckel's book. In chaapter 14, I read TextArea.java. My question is: What is the purpose of getContentPane() in the constructor TextArea() in the code below ? Isn't JFrame IS a Container ? why bother to get another Container ?