JSF vs. XSLT

Hello all,
We want to design a new application. I have been debating whether to use JSF with XSLT or to stick to XSLT alone in the view layer. In this application the front-end makes SOAP calls to the business tier so all the data is already in XML. Why not just do an XSLT transformation over the XML data and serve the client-device specific markup? What would JSF buy me in this case?
I would appreciate your insight.
Thanks,
Mete

Hello Craig and all,
I haven't yet seen the JSF SVG demo app but it sounds
pretty cool :-)
I have some questions to follow up with your
comments.
So what you guys did with the SVG demo was to develop
a RenderKit that emitted generic XML+EcmaScript to the
client. Then on the client-side, SVG was produced. Is
my understanding correct?That is correct.
So in that case I suppose it would be possible to
similarly develop a RenderKit that emitted generic
XML+XSL to the client, for the client to do the XSLT
transformation itself, right?Sure, that's feasible for clients that have XSLT capabilities.
This sounds good, but in
our application we don't want to leave the XSLT
transformation to the client in order to be able to
support handheld devices. I think what we want to do
is more similar to what "keyurva" and them did, that
is to have a RenderKit that internally uses XSLT to
generate client-specific markup.That works. So do lots of other things. Let's try to enumerate some of the options:
* XSLT in the client
* XSLT post-processing in a Filter
* XSLT in the Renderer (RenderKit chooses the right stylesheet)
* Different renderkit for each device type
* Single renderkit that delegates to variant renderers based on device type
What still confuses
me is that I thought that there needs to be one
RenderKit for each different markup language.Not necessarily ... it's totally up to how you want to architect things.
For
instance one RenderKit for HTML, one for WML, one for
VoiceXML and so on. So there would be many RenderKits.
But if we have one RenderKit that internally uses XSLT
to generate client-specific markup, then we only have
one RenderKit for all different markups. This kind of
confuses me, maybe I should go back and read more on
JSF. Craig, Keyurva, can you explain this a little
bit?
All of the choices above are feasible -- it depends on what's the easiest way to meet your particular needs.
One important decision criteria might be how you're creating the output data in the first place. If you are primarily dealing with data already in XML formats, an XSLT-based idea probably make sense. But, if you're synthesizing XML in Java code (using DOM or JDOM or something like that), I'll bet you end up writing less lines of code if you just write device-specifc renderers in the first place.
Another question is when this technique is used within
a standard JSR-168 portlet. The portlet learns what
markup language to emit from the portlet container. So
JSF needs to be able to dynamically get the markup
language preference from the portlet and serve that
markup. How could this be done?Aren't you going to make the output variant choice in a portlet based on the same thing (the user agent header) that you would use in a servlet? If that's what you are up to, then you have access to the request headers via the ExternalContext.getRequestHeaderMap() or ExternalContext.getRequestHeaderValuesMap() methods. It's also accessible via value reference expressions (similar in spirit to the JSTL and JSP ELs) via the "header" and "headerValues" implicit variables at the beginning of an expression.
>
Thanks,
MeteCraig

Similar Messages

  • How can one produce dynamic XSLT (.xsl) file with JSF

    I've googled, I've searched and I've found nata on how to do this. I've tried trial and error but I still cannot get my .xhtml file to include my <xsl:stylesheet ..> declarations and syntax in my final output to the browser. Anybody have any (non-hack) ideas on how to do this? Actually, if hacks is all there is, then I suppose they are welcome too, but a legit way is preferable. Tutorials and documentation fail to tell me how to do this. As illustrated in the following, the xsl specific content removed from the final output to the browser. I don't want it removed. Any ideas?
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE xsl:stylesheet>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:strip-space elements="*"/>
        <xsl:output method="html" indent="no"/>
    <xsl:template match="xxx">
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://java.sun.com/jsf/html"
              xmlns:t="http://myfaces.apache.org/tomahawk">
         <ui:composition template="xxxx">
    </html>
    </xsl:template>
    </xsl:stylesheet>{code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    I realized this after viewing the first several outputs and decided to post this as a problem on this forum right here at this particular location.
    I also discovered that I was able to include outer text by wrapping everything within <ui:decorate template=".."></ui:decorate>{code} tags. I simply wish to know how one manages to include their own namespaced tags in the final output when they are NOT outputing to standard HTML/XHTML, such as XML or XSL.
    Thanks for your input.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • JSF app - open report in new Window - via JSP?

    I have been reading through this forum but no one has done quite what I am trying so I thought I'd post my own version of this problem.
    The web app I'm working on is basically a report generator. Data is formatted via XSLT to .html files - that part works great. The problem is getting the app to open this new HTML file in a new window. I want to get this working with little or no JavaScript.
    startReport.jsp (a JSF file) is the form that validates the user input. The sole h:commandButton (I do NOT want a link) works fine sending the form and JSF returns its errors or mine (if the criteria results in nothing) as it should; the action method returns "failure" so the page stays the same.
    But when the action method returns "success" the JSF navigation-rule is setup to route to showReportFile.jsp (which is NOT a JSF file). This JSP is very simple:
    <%@ page import="java.io.File" %>
    <%@ page import="java.io.PrintWriter" %>
    <%@ page import="java.io.FileReader" %>
    <%@ page import="com.logipath.gict.cts.reporting.client.ReportClient" %>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" %>
    <jsp:useBean id="reportClient" scope="session" class="com.logipath.gict.cts.reporting.client.ReportClient" />
    <%
    String fileName = reportClient.getReportOutputFile();
    PrintWriter writer = response.getWriter();
    char[] buffer = new char[1024];
    FileReader reader = new FileReader(fileName);
    int numRead = reader.read(buffer, 0, buffer.length);
    while ( numRead != -1 ) {
         writer.write(buffer, 0, numRead);
         numRead = reader.read(buffer, 0, buffer.length);
    reader.close();
    writer.close();
    File file = new File(fileName);
    file.delete();
    %>This works believe it or not. If I put the target="_blank" on the form tag in the startReport.jsp it even opens in a new window. Great. But with that attribute on the form element, if the page comes back in error - it shows up in a new window (as it is apt to do given the attiribute).
    Ok, the h:commandButton tag's target attribute is ignored. Fine. There has to be a way to do this but I just cannot figure it out and I'm no JSP expert.
    What I think will work is this. Since my report beans create HTML files, I've created a session bean called "currentReportBean" which holds a single attribute - the name of the HTML file to display. (This is how the JSP above works.)
    What I need to know now *(this is the question part)* is how can I flush the render response of my JSF life cycle, trigger the opening of this JSP in a new window, the restart the JSF life cycle at the begining so the "parent" page repaints normally? The JSP isn't part of the JSF page flow so I there's no "going back" or "refresh" to worry about. I would like to take the showReportFile.jsp file out of the navigation files altogether.
    I know this topic has been worked on at length, but not quite this way. Any help is greatly appreciated.

    arnieAustin wrote:
    No, the JSP resets the bean value after showing the file.My mistake; it wasn't the reload scenario that is an issue. It is when the user goes back and forth in history that this can be a problem.
    >
    But now I'm confused. JS cannot access server-based session values. How is it going to know to open the page? A cookie?Write the value to a JS variable when you render the page.

  • How to render a JSP page dynamically with JSF controls ??

    Hi All,
    I am new to JAVA and JSF. I am recently started doing a web project. First we started using plain JSP and servlets and now we are going to use JSF.
    Now I am facing one problem with JSF. In a JSP page, I am having a combobox and a div and when i am selecting a value from the combo box, the div should be filled with some controls(like text boxes and comboboxes, buttons, etc) according to the selection.
    I have done this in plain JSP with the help of XML/XSLT, AJAX and JavaScript. i.e. XML contains the details of the controls and XSLT transformer will give me controls in a string format in the server, AJAX helps to retrieve it and I have to simply set the div.innerHTML property to that string. It is working fine.
    Now with JSF, I need to add JSF controls into my XML file, and it inturn returns the corresponding string having JSF controls easily, but i could not set it directly to div's innerHTML as the String contains JSF controls (Moreover, these JSF controls are linked with JAVA beans).
    Is there any provision to add JSF controls to a running page dynamically or is there any provision to convert the above mentioned string of JSF controls to normal HTML controls like the JSF taglibraries doing.??
    thanks in advance
    noushad
    Edited by: naash007 on Apr 20, 2009 4:17 AM
    Edited by: naash007 on Apr 20, 2009 5:45 AM

    That's simply asking for trouble. Do not suggest to use JSTL in combination with JSF.
    JSF already provides almost everything which the JSTL flow control tags provides in flavour of the 'rendered' attribute.

  • 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...).

  • JSF or Struts

    Hi,
    We have a web application designed using MVC framework. Besides a web view, we now need to support mobile users using WML.
    We are considering JSF and struts (customising struts to handle WML client).
    I have read that JSF supports disparate clients efficiently using RenderKits.
    Can anyone suggest whether JSF has an easy to use WML RenderKit. How does a renderkit work? Is there any good documentation online?
    Is there a Renderkit for WML readily avaialble or will I have to make one? I know there was a link posted in one of the questions in this forum, but it is a dead link.
    Thanks in advance,
    Harsha

    JSF is better than Sturts. ("Until now there is no sucess story on JSF.")
    Becoz, Struts inventor has been hired by SunMicroSystems to work with JSF. The same guy mentioned in an interview, that struts developement will be stopped in future.
    Also..,
    Until now there is no sucess story on JSF. Only time can decide which is best.
    My suggestion is, better spend your time in learning more jsp and servlets specifications, XML/XSLT, JMS, Webservices rather JSF/Struts.
    All these frameworks like JSF/Sturts will depends on your project requirement. There is a nice book and online document in this website about design patterns. Read those things if you have time. You will get good idea.
    Well.., this is all my personal opinions.

  • How to create JSF application from xsd files?

    Hi,
    We have many xsd files describing xml's which we are supposed to send to web services. Application which we are creating should allow user to fill xml documents with data and then we should send those xml files to some web service. We want to automatize as much as possible the process of application creation to avoid possible errors and to minimize our efforts (there are plenty of quite complex xsd files).
    Our first approach was: we used Oracle JSXB to generate java classes basing on xsd files (using JDeveloper 10.1.3.2.0.4066). Then we tried to generate DataControls, but this action fails with following error:
    Window title: Error in init bean
    Message: Could not complete initbean because it would result in an invalid document
    Details: oracle.bali.xml.model.XmlInvalidOnCommitException: SEVERE: Wartość atrybutu Name nie jest typu ID (Value of Name attribute is not of ID type)
    Wartość musi być następującego typu: (Value must be of following type)
    Nazwa typu: ID (Type name)
    Typ pierwotny: string (Primitive type)
    Z następującymi więzami: (With following constraints)
    zgodne z wzorcem: [\i-[:]][\c-[:]]* (Compliant with template)
    [ node = Name ]
    <JavaBean version="10.1.3.40.66" id="XSLStylesheet" BeanClass="oracle.xml.xslt.XSLStylesheet" Package="oracle.xml.xslt" isJavaBased="true">
    <Attribute Name="classMethodParams" IsUpdateable="0" Type="java.util.Hashtable" />
    We tried Sun implementation fo JAXB - it generated different java classes (with annotation mechanism). Creation of DataControls using those classes was successful. Then we created simple JSF page and tried to put those DataControls on it in order to let the user fill it with data. The thing is that those controls are read only as there is no row created in those DC. We can't create any row in those DC as there are only 'commit' and 'rollback' operations. When we try to call 'CreateInsert' operation on child elements of those DC we get error in JDeveloper log window:
    2007-05-29 10:08:46 oracle.adf.controller.faces.lifecycle.FacesPageLifecycle addMessage
    WARNING: JBO-29000: DataControl:createRowData
    2007-05-29 10:08:46 oracle.adf.controller.faces.lifecycle.FacesPageLifecycle addMessage
    WARNING: DataControl:createRowData
    new row is not created and controls are still read-only.
    The question is:
    1. is there another, more efficient way to create JSF application from xsd files?
    2. if this is the best way to do it, what do we do wrong?
    Leszek

    To anyone who might find it useful: our solution to mentioned problem.
    Few tips how to solve described problem:
    1. Do not use JAXB (we checked Oracle and Sun)
    2. Use castor http://www.castor.org/
    a) for each xsd generate java files in separated package
    b) use java 1.5 to let castor generate lists
    c) use mapping of xml namespaces to java packages to have only 1 implementation of each xsd
    3. Create facades - java files for you root-level java objects
    4. Right click those facades and choose 'Create DataControl' in jdev
    5. Now you may drag and drop you DataControls and use them in your JSF (or UIX) application
    I hope it will help someone :)
    Leszek

  • XLST Transformation in JSF

    Hi
    Would appreciate a point in the right direction with transforming XML/XSLT from a JSF view usinfg TOMCAT and jwsdp-1.6. I can't decipher the stack trace java.lang.Illeg alArgumentException as being a bad invocation or bad file input or both.
    A couple of threads allude to this exception with regard to JavaDoc and resolved with calss path issues don't belive this is the case here
    Thanks in advance
    <f:view>
         <f:verbatim>
              <h:outputText id="output" value="#{BB.output}" />
         </f:verbatim>
    </f:view>java.lang.IllegalArgumentException
    at sun.net.www.ParseUtil.decode(ParseUtil.java:183)
    at sun.net.www.protocol.file.Handler.openConnection(Handler.java:65)
    at sun.net.www.protocol.file.Handler.openConnection(Handler.java:55)
    at java.net.URL.openConnection(URL.java:943)
    at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:969)
    at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:184)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:798)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
    at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:387)
    at com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.getDTM(XSLTCDTMManager.java:228)
    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.getDOM(TransformerImpl.java:472)
    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:640)
    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:279)
    at com.nui.payd.invoice.web.controller.PAYDInvoiceController.viewHTML(PAYDInvoiceController.java:316)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
    at javax.faces.component.UICommand.broadcast(UICommand.java:305)
    at javax.faces.component.UIData.broadcast(UIData.java:657)
    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
    at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:307)
    at com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:79)
    at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:595)
    =================================================================================
    public void viewHTML(ActionEvent event)
              Templates xsltTemplate = this.cacheController.getTemplate();
              Transformer trans = null;
              try {
                   trans = xsltTemplate.newTransformer();
              } catch (TransformerConfigurationException e) {
                   log.info(METHOD_NAME +" TransformerConfigurationException :" + e.getMessage());
                   e.printStackTrace();
              } catch (Exception e){
                   String eMsg = " TRANSFORMER SETUP BLOCK ERROR ";
                   log.error(CLASS_NAME + eMsg + e.getMessage());
                   e.printStackTrace();
              Source xsltSource = new StreamSource(invoiceXMLFile);
              HttpServletResponse response = (HttpServletResponse) faces.getExternalContext().getResponse();
              response.setContentType("text/html");
              response.setContentLength(invoiceXMLFile.length());
              response.setHeader( "Content-disposition", "inline; filename=\"output.htm+\"");
              try { 
                   trans.transform(xsltSource,new StreamResult(new File("output.htm")));
              } catch (TransformerException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
              } catch (Exception e)
                   String eMsg = " TRANSFORMATION BLOCK ERROR : ";
                   log.error(CLASS_NAME+eMsg + e.getMessage());
                   e.printStackTrace();
              faces.responseComplete();
    }

    Hi,
    Just collect the transformation using the transport connection ( if any , select the Formula and routine also) to transport.
    For more information....
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3010ba90-0201-0010-2896-e58547c6757e
    /message/1257362#1257362 [original link is broken]
    Re: How to collect & transport new cube & new update rules
    Re: Transport to BWQ issue?
    Re: Transport a query from BWQ to BWP
    Regards
    CSM Reddy

  • Problem Transforming XML to JSF tags

    I have a fealing there is something I don't know here,
    I am transforming XML into a JSP that include tags from taglib http://java.sun.com/jsf/html (prefix="h")
    This is an section from my stylesheet
    <xsl:template name="forename">
    <h:inputText>
    <xsl:attribute name="value">#{abyss.myCustomer.forename}</xsl:attribute>
    </h:inputText>
    </xsl:template>
    which transforms my XML to exactly what I expect if a was writting it directly as a jsp
    <h:inputText value="#{abyss.myCustomer.forename}"></h:inputText>
    but it still looks like this after it is rendered in the browser, and not like
    <input type="text" name="dataCapture:j_id_id199" value="Customer Name" />
    which is how it looks if I cut and paste the result of the transformation into a jsp, and run that by itself
    Does anyone have any idea was the <h:inputText does not evaluate the tag in the browser after the transformation ?
    Edited by: OB1 on Nov 23, 2007 1:46 PM
    Edited by: OB1 on Nov 23, 2007 2:43 PM

    Unfortunatly I do, my jsp is
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
    <%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml_rt" %>
    <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
    <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
    <html>
    <c:set value="${abyss.myBusinessServicePath}" var="xmldocpath"></c:set>
    <c:import url="${xmldocpath}" var="xmldoc"/>
    <c:import url="/xsl/transform.xsl" var="xslt"/>
    <x:transform xml="${xmldoc}" xslt="${xslt}"/>
    </html>

  • How to run generated JSF tags ?

    I am beginner in JSF. I would like execute JSF tags generated dynamically by XSLT, but in the JSP page,
    these tags are not interpreted. Does anyone has the solution ? Thanks a lot.
    Example below is only a simple test,
    ResearchBean.java :
    public String researchAction() {
        // Actually, htmlResponse is the output string after the XSLT transformation, and it contains JSF tags
        htmlResponse = "<h:outputText value=\"Text\"/>";
        return "response";
    }response.xhtml :
    <f:view xmlns:f="http://java.sun.com/jsf/core
    xmlns:h="http://java.sun.com/jsf/html
    <html>
    #{researchBean.htmlResponse}
    </html>
    </f:view>In the page received by the browser, <h:outputText value="Text"/> isn't replaced by the html code.
    Edited by: wondergarance on Jul 2, 2009 1:24 PM

    The JSF tags are apparently generated after the FacesServlet has done its work. You in fact need to pass the generated output through the FacesServlet again. If you're using a servlet/filter to run XSLT, you need to run it before the FacesServlet kicks in. You can control the servlet/filter invocation order in the web.xml.

  • Is JSF fitted to build a multi-views application?

    Hello,
    I'm looking for technologies to build a new Web application and investigating JSF, but I need experienced advices to make my mind if JSF is fitted with this type of application.
    This application will use a MVC model, but instead of a simple HTML view, it'll have multiple views. The majority of these will be HTML pages, but not only. A view can be selected on a request parameter or client detection, or even on the application setup.
    The multiple views are used mainly for:
    - localization when the languages supported have an impact on the layout of the page.
    - customization of the application by customers, when light solutions based on CSS or parameterization is not enough.
    - support for different clients, probably based on user agent detection.
    At first, I thought going the classical path, with servlets or Struts with a XSLT filter, but this solution suffers of:
    - XSL is not simple, and finding Web designers fluent with this technology is hard.
    - Why reinvent the wheel with servlets when MVC framework have matured (I particularly like JSF actions workflow)?
    With the planned number of different views, frequently changing or adding new onews, what I seems to need is JSF with views defined as templates, something like incorporating Tapestry and Cocoon ideas. But from what I've read on JSF, it seems to me to be too much HTML oriented (just look at the structure of the tags or the use of JSP pages), even if I can develop other RenderKits.
    Do you think JSF could be adapted for this kind of application? Do you have any technologies advices?

    With no response to my question, what should I conclude:
    - No one has developped such multi-views applications...
    - No one has gained enough experience with JSF to answer...
    - This question is already answered in a FAQ somwhere...
    - This is not the correct way to support strong localization of a Web application. You won't dare answer such a basic question...
    - Your management doesn't allow you to share your experience with JSF...
    - {Pick a randow excuse and copy it there}

  • Multipages Form: JSF or Struts?

    Hi! :) I'm italian so sorry in advance for my poor english! :P
    I would like to know, as your experience, if, to create multipage forms, is more simple using Struts or Java Server Faces (jsf)....
    In my opinion jsf is more simple becouse i cuold use one JavaBean only, and the different jsp pages could refer to that bean (scope request or other also?)...while using struts I must create an ActionForm, and so on...making more laborious job.
    I don't have much experience with this 2 frameworks...so in your opinion which is the most simple to this kind of forms?
    Thanks in advance! :)

    JSF is better than Sturts. ("Until now there is no sucess story on JSF.")
    Becoz, Struts inventor has been hired by SunMicroSystems to work with JSF. The same guy mentioned in an interview, that struts developement will be stopped in future.
    Also..,
    Until now there is no sucess story on JSF. Only time can decide which is best.
    My suggestion is, better spend your time in learning more jsp and servlets specifications, XML/XSLT, JMS, Webservices rather JSF/Struts.
    All these frameworks like JSF/Sturts will depends on your project requirement. There is a nice book and online document in this website about design patterns. Read those things if you have time. You will get good idea.
    Well.., this is all my personal opinions.

  • FileName in ABAP XSLT Mapping

    Dear SDN,
    In an integration scenario we are using sender File Adapter and a  ABAP XSLT Mapping.
    Is there any way to get the source FileName from such mapping.  Im trying to use the adapter-specific message attributes, but it doesn't work, and I didn´t find an example, probably I and doing somthing wrong.
    regards,
    GP

    Thank you for your help,
    I just try to access the adapter-specific attibutes using:
    <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:key="java:com.sap.aii.mapping.api.DynamicConfigurationKey">
    <xsl:variable name="filename"  select="key:create('http://sap.com/xi/XI/System/File', 'Directory')" />
    </xsl:stylesheet>
    but the following error raised:
    <SAP:Stack>Error while calling mapping program YXSLT_TEST (type Abap-XSLT, kernel error ID CX_XSLT_RUNTIME_ERROR) Call of unknown function</SAP:Stack>
    have you had this situation?

  • How to get ALL values as default for  a drop down box in JSF

    Hi,
    I have a drop down box in JSF page which retrieves values from LOVCache.java. I have values like Company, Client, User, ALL in the drop down box.
    By default blank value is selected for the drop down box. I want to make ALL(which retrieves data for all the values) as default value for the drop down box.
    Could any body help me? Any help must be appreciated.
    Thanks,
    Aseet

    Thanks Nikhil. But I am fetching the values from the LOVCache.java.
    I am using <af:selectManyChoice>. Is there any way I can use LOVCache.java value for selecting default values instead of hard coding?
    I mean to say can I write
    unselectedLabel="#{LOVCache.entityTypeSelectionList.anyValue}"
    where LOVCache.entityTypeSelectionList is used to populate the drop down box.
    Regards,
    Aseet

  • I am trying to use java  file as Model layer and jsf as presentation layer

    I am trying to use java file as Model layer and jsf as presentation layer and need some help
    I successfully get the value of h:outputText from java file by doing simple binding operation but I am facing problems when I am trying to fill h:dataTable
    I create java file
    package oracle.model;
    import java.sql.;*
    import java.util.;*
    *public class TableBean {*
    Connection con ;
    Statement ps;
    ResultSet rs;
    private List perInfoAll = new ArrayList();
    *public List getperInfoAll() {*
    perInfoAll.add(0,new perInfo("name","username","blablabla"));
    return perInfoAll;
    *public class perInfo {*
    String uname;
    String firstName;
    String lastName;
    *public perInfo(String firstName,String lastName,String uname) {*
    this.uname = uname;
    this.firstName = firstName;
    this.lastName = lastName;
    *public String getUname() {*
    return uname;
    *public String getFirstName() {*
    return firstName;
    *public String getLastName() {*
    return lastName;
    right click on the file and choose 'create data control'
    then i wrote the jsf file:
    *<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>*
    *<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>*
    *<f:view>*
    *<h:dataTable id="dt1" value="#{bindings.perInfoAll}"*
    var="item" bgcolor="#F1F1F1" border="10"
    cellpadding="5" cellspacing="3" rows="4" width="50%"
    dir="LTR" frame="hsides" rules="all"
    *>*
    *<f:facet name="header">*
    *<h:outputText value="This is 'dataTable' demo" id="ot6"/>*
    *</f:facet>*
    *<h:column id="c2">*
    *<f:facet name="header">*
    *<h:outputText value="First Name" id="ot1"/>*
    *</f:facet>*
    *<h:outputText style="" value="#{item.firstName}"*
    id="ot2"/>
    *</h:column>*
    *<h:column id="c4">*
    *<f:facet name="header">*
    *<h:outputText value="Last Name" id="ot9"/>*
    *</f:facet>*
    *<h:outputText value="#{item.lastName}" id="ot8"/>*
    *</h:column>*
    *<h:column id="c3">*
    *<f:facet name="header">*
    *<h:outputText value="Username" id="ot7"/>*
    *</f:facet>*
    *<h:outputText value="#{item.uname}" id="ot4"/>*
    *</h:column>*
    *<f:facet name="footer">*
    *<h:outputText value="The End" id="ot3"/>*
    *</f:facet>*
    *</h:dataTable>*
    *</center>*
    *</af:document>*
    *</f:view>*
    but nothing is appear in my table
    I know that there is something wrong in calling the binding object
    I need help pls and where can i find some help to deal with another tag types
    thanks

    i dragged the "perInfoAll" from my "Data Controls" and choosed adf table (even I know that new table with adf tags well be generated and i want table with jsf tags)
    and this code is generated
    *<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"*
    *"http://www.w3.org/TR/html4/loose.dtd">*
    *<%@ page contentType="text/html;charset=UTF-8"%>*
    *<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>*
    *<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>*
    *<%@ taglib uri="http://xmlns.oracle.com/adf/faces/rich" prefix="af"%>*
    *<f:view>*
    *<af:document id="d1">*
    *<af:messages id="m1"/>*
    *<af:form id="f1">*
    *<af:table value="#{bindings.perInfoAll1.collectionModel}" var="row"*
    *rows="#{bindings.perInfoAll1.rangeSize}"*
    *emptyText="#{bindings.perInfoAll1.viewable ? 'No data to display.' : 'Access Denied.'}"*
    *fetchSize="#{bindings.perInfoAll1.rangeSize}"*
    *rowBandingInterval="0"*
    *selectionListener="#{bindings.perInfoAll1.collectionModel.makeCurrent}"*
    *rowSelection="multiple" id="t1">*
    *<af:column sortProperty="uname" sortable="false"*
    *headerText="#{bindings.perInfoAll1.hints.uname.label}"*
    *id="c1">*
    *<af:inputText value="#{row.bindings.uname.inputValue}"*
    *label="#{bindings.perInfoAll1.hints.uname.label}"*
    *required="#{bindings.perInfoAll1.hints.uname.mandatory}"*
    *columns="#{bindings.perInfoAll1.hints.uname.displayWidth}"*
    *maximumLength="#{bindings.perInfoAll1.hints.uname.precision}"*
    *shortDesc="#{bindings.perInfoAll1.hints.uname.tooltip}"*
    *id="it3">*
    *<f:validator binding="#{row.bindings.uname.validator}"/>*
    *</af:inputText>*
    *</af:column>*
    *<af:column sortProperty="firstName" sortable="false"*
    *headerText="#{bindings.perInfoAll1.hints.firstName.label}"*
    *id="c2">*
    *<af:inputText value="#{row.bindings.firstName.inputValue}"*
    *label="#{bindings.perInfoAll1.hints.firstName.label}"*
    *required="#{bindings.perInfoAll1.hints.firstName.mandatory}"*
    *columns="#{bindings.perInfoAll1.hints.firstName.displayWidth}"*
    *maximumLength="#{bindings.perInfoAll1.hints.firstName.precision}"*
    *shortDesc="#{bindings.perInfoAll1.hints.firstName.tooltip}"*
    *id="it2">*
    *<f:validator binding="#{row.bindings.firstName.validator}"/>*
    *</af:inputText>*
    *</af:column>*
    *<af:column sortProperty="lastName" sortable="false"*
    *headerText="#{bindings.perInfoAll1.hints.lastName.label}"*
    *id="c3">*
    *<af:inputText value="#{row.bindings.lastName.inputValue}"*
    *label="#{bindings.perInfoAll1.hints.lastName.label}"*
    *required="#{bindings.perInfoAll1.hints.lastName.mandatory}"*
    *columns="#{bindings.perInfoAll1.hints.lastName.displayWidth}"*
    *maximumLength="#{bindings.perInfoAll1.hints.lastName.precision}"*
    *shortDesc="#{bindings.perInfoAll1.hints.lastName.tooltip}"*
    *id="it1">*
    *<f:validator binding="#{row.bindings.lastName.validator}"/>*
    *</af:inputText>*
    *</af:column>*
    *</af:table>*
    *</af:form>*
    *</af:document>*
    *</f:view>*
    but when run it i see the following errors
    *Class oracle.adf.model.adapter.bean.BeanDataControl can not access a member of class nl.amis.hrm.EmpManager with modifiers "private"*
    *Object EmpManager of type DataControl is not found.*
    *java.lang.NullPointerException*
    *Class oracle.adf.model.adapter.bean.BeanDataControl can not access a member of class nl.amis.hrm.EmpManager with modifiers "private"*
    *Object EmpManager of type DataControl is not found.*
    *java.lang.NullPointerException*
    :(

Maybe you are looking for