Converting .xhtml to .JSF

Hi All,
I have an issue in B2C Website when i open website using url  http://<host>:<Port>/zApp/contentmanagement/HomePage.jsf?wec-appid=app&wec-locale=en_US&wd=x     it will open startPage here in the site we have a client logo  when i click on the client logo my url should navigate to same homepage it is navigating, but in the url it is showing as http://<host>:<Port>/zApp/contentmanagement/HomePage.xhtml?wec-appid=app&wec-locale=en_US&wd=x
here it is converting .jsf to .xhtml. Please help me how to convert it from .xhtml to .jsf.
Thanks in Advance
Regards,
Rahul.

Yes, we do have to convert.
We wrote a pilot of project using JSP [with some YUI and JQuery widgets]
and then learned that client wants JSF (have a bunch of other JSF projects),
so now I have a week or so to convert it. [I personally would use Flex for the GUI] ;-)
Is there a way to wrap up JSP into JSF ?
I guess, we also need to move some HTML/JSP widgets into JSF components.
Please advise,
Oleg.

Similar Messages

  • Integration of JSP and xhtml in jsf project

    Can we use both jsp and xhtml in single jsf project. Actually I encountered a problem while configuring jsp and xhtml in web.xml of jsf project. The web.xml configuration file allows to use only one view handler (jsp or xhtml).By default it use jsp view handler. For xhtml view handler, we need to define following context param -:
    <context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>.xhtml</param-value>
    </context-param>
    Please let me know any possibility to configure both jsp and xhtml in jsf project(web.xml).
    My actual requirement is that I need to forward to new page(xhtml) from an xhtml page without using faces-config. I am not able to find any facelets tags which let me forward to new xhtml page. So I am thinking to use jsp to exploit the jsp tag called forward. But the constraint is that we can use only one view handler with jsf project.

    Can we use both jsp and xhtml in single jsf project. Actually I encountered a problem while configuring jsp and xhtml in web.xml of jsf project. The web.xml configuration file allows to use only one view handler (jsp or xhtml).By default it use jsp view handler. For xhtml view handler, we need to define following context param -:
    <context-param>
    <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
    <param-value>.xhtml</param-value>
    </context-param>
    Please let me know any possibility to configure both jsp and xhtml in jsf project(web.xml).
    My actual requirement is that I need to forward to new page(xhtml) from an xhtml page without using faces-config. I am not able to find any facelets tags which let me forward to new xhtml page. So I am thinking to use jsp to exploit the jsp tag called forward. But the constraint is that we can use only one view handler with jsf project.

  • Internet Explorer, xhtml and JSF

    I'm having a problem with an app I'm developing in xhtml using the xml format for my jsp files. I've been using Firefox during development and have had no problems. However, today I loaded the site in IE and got the following error:
    Entity names, PI targets, notation names and attribute values declared to be of
    types ID, IDREF(S), ENTITY(IES) or NOTATION cannot contain any colons.The error refers to the following element:
    <input id="_id4:subcontractorId" type="hidden" name="_id4:subcontractorId" value="2" />From a quick bit of googling, it seems that Microsoft have implemented XML namespaces in the XML parser for IE with no fall-back if the document does not conform to this. The spec for XML namespaces says the following:
    The effect of conformance is that in such a document:
    * All element types and attribute names contain either zero or one colon.
    * No entity names, PI targets, or notation names contain any colons.
    Strictly speaking, attribute values declared to be of types ID, IDREF(S), ENTITY(IES), and NOTATION are also Names, and thus should be colon-free.
    It seems therefore that jsf is producing invalid xml as far as IE is concerned. Is there any way I can work around this without re-writing all my jsps to produce html?
    Example jsp source file:
    <?xml version="1.0" ?>
    <jsp:root version="2.0"
         xmlns:jsp="http://java.sun.com/JSP/Page"
         xmlns:f="http://java.sun.com/jsf/core"
         xmlns:h="http://java.sun.com/jsf/html">
         <f:view>
              <f:verbatim><![CDATA[<!DOCTYPE html
                   PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">]]>
              </f:verbatim>
              <html xmlns="http://www.w3.org/1999/xhtml">
                   <head>
                        <link href="styles/subcontractor.css" rel="stylesheet" type="text/css"/>
                        <f:loadBundle basename="uk.co.motives.subcontractors.messages" var="msgs"/>
                        <title><h:outputText value="#{msgs.startTitle}"/></title>
                   </head>
                   <body>
                        <h2><h:outputText value="#{msgs.startTitle}"/></h2>
                        <h3><h:outputText value="#{msgs.startPrompt}"/></h3>
                        <h:form>
                             <h:commandButton
                                  actionListener="#{subcontractorLoad.load}"
                                  action="#{subcontractorLoad.getLoadOutcome}"
                                  value="#{msgs.startSubcontractorLink}"/>
                             <h:inputHidden id="subcontractorId" value="2" />
                        </h:form>
                        <h:form>
                             <h:commandButton action="admin" value="#{msgs.startAdminLink}"/>
                        </h:form>
                   </body>
              </html>
         </f:view>
    </jsp:root>Example outputted xhtml document (formatted):
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
         <head>
              <link type="text/css" rel="stylesheet" href="styles/subcontractor.css"/>
              <title>Welcome to the Subcontractors Database</title>
         </head>
         <body>
              <h2>Welcome to the Subcontractors Database</h2>
              <h3>Choose a task</h3>
              <form id="_id4" method="post" action="/subcontractors/index.faces"
                   enctype="application/x-www-form-urlencoded">
                   <input type="submit" name="_id4:_id5" value="A subcontractor" />
                   <input id="_id4:subcontractorId" type="hidden" name="_id4:subcontractorId" value="2" />
                   <input type="hidden" name="_id4" value="_id4" />
              </form>
              <form id="_id6" method="post" action="/subcontractors/index.faces"
                   enctype="application/x-www-form-urlencoded">
                   <input type="submit" name="_id6:_id7" value="admin" />
                   <input type="hidden" name="_id6" value="_id6" />
              </form>
         </body>
    </html>

    The JSF team is in the process of making the default HTML renderers generate HTML/XHML compliant markup.
    The current EA4 release does not do that.
    -roger

  • Converting JSP to JSF

    Hi,
    I am new to JSF.
    Could someone suggest how to convert existing JSP project to JSF and Tiles ?
    TIA,
    Oleg.

    Yes, we do have to convert.
    We wrote a pilot of project using JSP [with some YUI and JQuery widgets]
    and then learned that client wants JSF (have a bunch of other JSF projects),
    so now I have a week or so to convert it. [I personally would use Flex for the GUI] ;-)
    Is there a way to wrap up JSP into JSF ?
    I guess, we also need to move some HTML/JSP widgets into JSF components.
    Please advise,
    Oleg.

  • XHTML and JSF

    How do I generate XHTML code using the EA4 implementation?
    I only get, e.g.
    <img id="graphics" src="mylogo.gif">
    <input type="text" name="line" value="" size="10" >
    instead of
    <img id="graphics" src="mylogo.gif"/>
    <input type="text" name="line" value="" size="10"/>
    Any hint is appreciated!

    The JSF team is in the process of making the default HTML renderers generate HTML/XHML compliant markup.
    The current EA4 release does not do that.
    -roger

  • XHTML with JSF?

    I'm trying to build a valid XHTML application with JSF 1.1. The <h:form> tag seems to break XHTML rules. I have JSF code that looks something like:
    I had to change add quote characters to "<"p">" expressions; otherwise, this forum doesn't properly display.
    <body>
         <h:form>
              "<"p">"<!--Some controls-->"<"/p">"
         </h:form>
    </body>That renders the following:
    <body>
         <form id="_id0" method="post" action="/TestJSF/FirstPage.faces" enctype="application/x-www-form-urlencoded">
              "<"p">"<!--Some controls-->"<"/p">"
         <input type="hidden" name="_id0" value="_id0" /></form>
    </body>In XHTML:
         - A <form> element can't be in a "<"p">"/<h3>/<table> type element.
         - All <input> elements (including hidden ones) MUST be in a "<"p">"/<h3>/<table> type element.
    The JSF <h:form> outputs a hidden <input> element right before the </form> close. This violates XHTML rules. What can I do to get my JSF app to render valid XHTML?

    i'm very new to jsf so i apologize if this is way off:
    there are 2 methods of saving view state - session / client saves state
    session uses either an identifer (sid) in cookie or URL
    client uses hidden field (or am i way off)
    therefore try session:
    <context-param>
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
    <param-value>server</param-value>
    </context-param>

  • How to convert div to JSF tag ?

    Hi guys,
    I got a problem on using the following code:
                                       <c:if test="${requestScope.error == 'errLogin'}">
                                  <div class="error">
                                  <h:graphicImage styleClass="imageStyle" value="/images/iconWarning.gif"/>
                             <h:messages styleClass="errorMessage" globalOnly="true"/>
                        </div>
                        </c:if>
    to be display correctly with the whole page. I really don't know how to descripe the weird result. Anyway, anyone know how to put the above <div> into JSF tag type?
    I put the above code within <h:form id="loginForm">.... </h:form> is there a problem?
    Thanks !
    regards,
    kmthien
    regards,
    Mark

    Hi,
    I had a requirement to use the Div in my code and here is the sample of the code and it is working fine.
    and I am using WASD 5.1.2.
    <h:panelGrid columns="1" border="1" styleClass="scrollPane">
                   <h:panelGroup>
                                  <f:verbatim>
                                       <DIV STYLE="overflow: auto; height: 100px; width: 400px">
                                  </f:verbatim>
                                  <h:selectManyCheckbox id="userRoles" layout="pageDirection"
                                       valueChangeListener="#{pc_UserPage.handleUserRolesValueChange}"
                                       value="#{pc_UserPage.searchBean.userRoles}">
                                       <f:selectItems value="#{pc_UserPage.dataTable.userRoles}" />
                                  </h:selectManyCheckbox>
                                  <f:verbatim>
                                       </DIV>
                                  </f:verbatim>
                             </h:panelGroup>
    </h:panelGrid>

  • A perfectly working servlet captcha that I want to convert to Jsf 2.0 Help

    I have a perfectly working captcha that I love to convert in to jsf 2.0. I try for 2 days with no result. I am hoping some one will
    do it and we can post it in a forum since I could not find any captcha for jsf 2.0. if you talk about the google recaptch
    I am not interested the "do not be evil company slowly growing horn and tail :)
    anyway lets go back to my progress. I'll post the full code.
    in here:
    http://pastebin.com/tnx8iJ0R
    thank you for the help..

    Hi
    Jalil Cracker,
    >>when user pres n then it must go to a form but error arises and not working good and threading is not respondin
    Could you post the error information? And which line caused this error?
    If you want to show Form1, you can use form.show() method
    Form1 frm = new Form1();
    frm.Show();
    In addition, Cosmos is an acronym for C# Open Source Managed Operating System. This is not Microsoft product.If the issue is related to Cosmos, it would be out of our support. Thanks for your understanding. And you need raise an issue at Cosmos site.
    Best regards,
    kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How do you make JSF draw frame in browser w/o JSP & HTML ?

    Hi all,
    I already have small web application which uses HTML & JSP and I want to convert it to JSF based application.
    I've read O'Reilly JSF books written by Hans Bergsten and in Chapter 15 he states that you can use pure Java classes only (without JSP & HTML) in your web application.
    My web application contains some frames. Since I only want to use pure Java classes using JSF what component should I use to draw frame ?
    I use MyFaces implementation of JSF.
    Any advice would be greatly appreciated.
    Best Regards,
    Setya

    I don't know anything about myFaces, but as far as I know, there is no component to draw frames. The JSF book you read is correct to a degree... It's possible to write completely with JSF tags, but it can be cumbersome sometimes.
    To output frame tags using a JSF tag, you can use one of two methods.
    First, you can use the outputText tag with escape attribute set to false.
    <h:outputText value="<FRAMESET blah blah blah>" escape="false" />The second way is to just wrap HTML in f:verbatim tags.
    <f:verbatim><FRAMESET blah blah blah></f:verbatim>If using the second method, be careful not to have any other JSF tags inside the f:verbatim tags.
    Hope this helps,
    CowKing

  • JSF tags are not rendered in error page

    I have configured error page for HTTP 404 error in web.xml like this
    <error-page>
    <error-code>404</error-code>
    <location>/Common/error.jspx</location>
    </error-page>
    Faces Servlet is configured as follows
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    My error page (error.jspx) looks like this
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1" xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html" xmlns:trh="http://myfaces.apache.org/trinidad/html"
    xmlns:tr="http://myfaces.apache.org/trinidad" xmlns:c="http://java.sun.com/jsp/jstl/core">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <html>
    <head>
    <title>Error Page</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    </head>
    <body id="b1">
    <h4 style="color:red">An Error Occured. Please click Back button or Signout.</h4>
    <input type="button" value="Back" onclick="history.back()"/>
    <tr:commandButton id="cb1" text="SIGN OUT" action="exit" actionListener="#{Login.LogOut}"/>
    </body>
    </html>
    </jsp:root>
    When I deploy application and run into 404 error, page displays error message with only Back button. I don't see SingOut button. I have checked url and it follows /faces/* pattern. Still to double check, I made a change and configured servlet mapping in web.xml as
    <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    <url-pattern>*.jspx</url-pattern>
    </servlet-mapping>
    Still commandButton is not rendered. I understand that my error page don't have access to FacesContext or not going through Faces Servlet. I know this is a small issue, but couldn't figure out what can be done. I have also tried using .xhtml and .jsf as per googled suggestion. But no luck
    I have tried different solutions to my problem and googled for solutions. But I couldn't get it resolved.
    So can you please provide any suggestions...
    Edited by: user1818355 on May 22, 2013 2:29 PM

    I think my faces servlet is configured to handle URLs having /faces/* pattern. I don't have any folder named with faces but I can access all my web pages which have /faces/ in their url. All jspx pages in application are configured in task flows. So I think they have access in FacesContext. But error page is configured in only web.xml and some how it is missing access to FacesContext and not rendering JSF tags. Any help?

  • JSF versus Struts

    Hi, I'm researching JSF and Struts and they look identical. Seems like the developers of JSF just took Struts and changed the wording. What I mean is:
    struts-config.xml became faces-config.xml
    ActionMappings and Actions became NavigationCases and NavigationRules
    FormBeans became ManagedBeans
    MessageResources became MessageBundle
    ActionServlet became FacesServlet (in web.xml)
    Both have validators and converters.
    So am i missing something?
    Also, are there any performance benchmarks that JSF/Struts add to response times?
    Thanks,
    Mike

    I tried out JSF on some small projects and it worked out OK. However, when I tried using JSF on a major project, I got burned. I ended up converting all my JSF work to Struts.
    Before I say what I didn't like about JSF, let me say what I do like. I like how easy it was to associate a button or a link with a method. I like how easy it is to validate input. I liked how easy it is to show or hide components based on boolean expressions. When it comes to these things, I was able to develop code a bit faster with JSF than with Struts.
    However, the negatives were so great that I eventually abandon JSF...
    (1) If you have a graphic artist that creates prototypes using static HTML, converting those prototypes to actual working pages is MUCH easier with Struts tags than with JSF tags. The problem with JSF tags is that you cannot always mix JSF with standard HTML. This is especially true if you are using Tiles. You may end up having to completely rewrite the static HTML tags to their JSF equivalent. This is simply more trouble than it is worth. (There are JSF tag libraries available that act like standard HTML tags, but I found the tags to be buggy and the code simply very cluttered.)
    (2) Creating tables much more complicated that a textbook example can end up being more trouble than it's worth. For example, if you want to create a table where some rows are sub-headers (rows that span all columns and contain a sub-title), then you will end up having to create a custom renderer and a custom tag library. There is a learning curve involved with this. (Even if you are an expert in writing these, you still have extra code that needs to be written.) With Struts, the same thing can be accomplished with some simple logic tags.
    (3) Sometimes, all I really wanted was to iterate through a list of values. JSF does not come with a simple iterate tag. You can loop through your data with a JSTL tag or you can use a datatable or you can create your own tags, but that is extra work. Even if you choose to do any of these, you still cannot reliably mix standard HTML tags with JSF tags.
    (4) Everything in JSF is submitted as a POST. Sometimes, I really needed to use a GET. You can use GETs in JSF, but I found using them to be less than straightforward.
    My advise: If you are building a web app, use a framework that plays well with HTML. (Ultimately, your web app is generating HTML anyway.) If you are building a stand-alone app, use Swing or some language other than Java. If you need your code to run as both, then JSF might be a solution.
    I really wanted JSF to work for me, but I ended up being disappointed.

  • Jsf: paletteTransparencyType bug?

    i have a jsf problem ive been trying to solve for hours
    now.....i need to export images as 8 bit png's with alpha
    transparency.
    <code>
    var ex = new ExportOptions();
    ex.exportFormat = "PNG";
    ex.colorMode = "indexed";
    ex.paletteTransparencyType = "rgba";
    fw.getDocumentDOM().setExportOptions(ex);
    fw.exportDocumentAs(d, savePath, null);
    </code>
    when i run this script, my images get saved, but not with
    transparency. the optimize palette says "No Transparency" no matter
    what i set paletteTransparencyType to.
    is this a bug, or am i doing something wrong.

    yes, the canvas is tranparent.
    i actually solved this, and found an error in the extending
    fireworks documentation. after changing a few options in the
    optimize palette, i took the history steps and converted them to
    jsf to see what it was doing.
    the documentation states that paletteTransparencyType is a
    property of the ExportOptions object, when in fact it is not. the
    correct property is paletteTransparency. wow....that had me
    scratching my head for hours.
    so the correct jsf would be:
    <code>
    var ex = new ExportOptions();
    ex.exportFormat = "PNG";
    ex.colorMode = "indexed";
    ex.paletteTransparency = "rgba";
    fw.getDocumentDOM().setExportOptions(ex);
    fw.exportDocumentAs(d, savePath, null);
    </code>
    i submitted this to adobe last night.

  • Generate PDF report with HTML data

    Hi All,
    I am using BI Publisher to generate my reports but I stumbled on a big problem...
    I have a table with a column TASK_DESCRIPTION. This column is a CLOB containing a simple HTML coded page. When a user works with the application he sees a nicely formatted page but when I generate a report I get all the html tags in it (< html > < h4 > ...etc...)
    Is it possible to somehow convert the source data from the table (which is html code) into readable formatted text when generating the report?
    ANY ideas are very welcome!
    Regards,
    Pawel.

    Yes you can do this with an XSL template converting HTML to Formatting objects.
    There are a few catches however. First, you must be sure your markup-fragment is valid XHTML, that is all tags must be closed. Luckily the builtin standard HTML-editor does this.
    I wasn't able to call BI-publisher from within Apex without the XHTML-fragment being escaped, but i managed to create a query on a table containing the fragment within BI-publisher itself. This leaves the fragment intact, producing a valid XML-document.
    This is very important because the XSL attached to the RTF-template must be able to match and convert the XHTML-tags to FO.
    Basic setup :
    Create a datasource (query) within BIP.
    Create the RTF-template and add an extra field (at the top) containing : <?import:file:///C:\xhtml-to-xslfo.xsl?> or whatever location the XSL-file resides.
    Now, layout your report using the wizard and change the field containing the XHTML-fragment into <xsl:apply-templates select="TASK_DESRIPTION"/>
    There are a few XSL-templates out there converting XHTML to FO. One I found particularly useful : http://www.ibm.com/developerworks/library/x-xslfo2app/xhtml-to-xslfo.xsl
    You might want to change the .xsl so it matches tags case insensitive (eg. <xsl:template match="a|A"> )
    Another caveat is the html-entities for special characters. When the XML from the datasource is parsed by BIP it doesn't recognise entities like &Agrave ; .
    This can be solved by creating a pl/sql function converting these characters to numeric entities like &#192 ;. and use this function in the select statement of your datasource. see http://www.w3schools.com/tags/ref_entities.asp
    Now you can call the report from Apex using an URL to the report definiton (see BIP docs for URL syntax and parameter passing)
    Not a 'really' integrated solution but I had some nice results.
    It would be nice though if we could specify a .dtd containing the references for HTML-entities and a sort of flag wheter the report column should be escaped or not, from within Apex. This would allow us to embed XML-fragments within the XML that Apex produces, resulting in a valid XML doc. Using XSL, you can then match the tags of the XML-fragment and convert it to FO.
    Good luck !
    Maarten

  • HRMS - Payslip / Is it not possible to print the 'Currency' on the payslip

    Hi, using HRMS within eBiz Suite, is it not possible to show/display/print the 'currency' field on the payslip ?
    I am asking because in a particular location, several currencies may be used.
    Thanks in advance.

    Hi,
    Actually the Excel format generated by XML Publisher is XHTML ... so the print process would need to convert XHTML to Postscript (similar to PDF being converted to Postscript by pdf2ps).
    But you question is still valid... unfortunately I haven't tried it ... anyone else?
    Regards,
    Gareth
    Blog: http://garethroberts.blogspot.com/

  • Is it not possible to print the Excel generated reports from EBS!!

    Is is true that the Excel generated by XML Publisher is not printable from Oracle Applications. Does the printers do not have drivers to understand EXCEL format (which from XML Publisher is XHTML not binary .xls.) So for printed output we should only use PDF ??
    Please advice!!
    Thanks.

    Hi,
    Actually the Excel format generated by XML Publisher is XHTML ... so the print process would need to convert XHTML to Postscript (similar to PDF being converted to Postscript by pdf2ps).
    But you question is still valid... unfortunately I haven't tried it ... anyone else?
    Regards,
    Gareth
    Blog: http://garethroberts.blogspot.com/

Maybe you are looking for

  • A Few Suggestions for The i3-wm

    I've been a user of i3 wm some time. Now that am new at using (only) a wm for my everyday work, I can say that am quite satisfied the way it significantly speeds up switching between different windows and workspaces. i3 has been so far quite nice wit

  • Upgrade from 9 to 10g

    Can the directory ( where oracle db 9 is installed ) be deleted after the upgrade to 10g in a separate directory ? The tablespaces/customer data from db9 are also installed in separate directories.

  • Ipod nano in disk mode (yes i already read the other one)

    my ipod is in disk mode just wondering how else to get it out or how many times i should repeat the hold menu then hold the middle button?

  • Where is my Serial No for Photoshop CC subscription?

    Where is the Serial Number for my Photoshop CC subscription to complete registrtration? I downloaded CC. Thanks Andy

  • Spry Tab Panel Question

    I am designing a new site which for the most part will be one page of Spry Tab Panesl. Is it possible to have the contect section grow or shrink vertically according to the amount of content in a slow motion, like the accordian or collapasible panels