JSF, tiles, xml and xsl

Good days people, I am employed at an app that wants to integrate JSF, tiles, xml and xsl.
Basically the app receives information of the user's interfaz, builds an url with the above mentioned information and invokes to a service web that a xml returns with the information. The idea is to generate the exit in format html or wml with an insole(staff) xsl and to send the result in this format to every jsp that is going to form a part of the page that it will generate tiles. at first I understand that it is feasible, i�d like to know if someone already has done it and since it has done it.
Just now what I have is a managed bean that receives the parameters of the altar frontal and invokes a method of a service, like this:
public String encuentra(){
//deja los atributos privados rellenos.
String mensaje ;
crearYRellenarBusquedaVO();
try {
setResultado(this.getServicio().obtenerResultadosWML(this.getBusquedaVO()));
mensaje="succesNoJS";
}catch(java.lang.IllegalArgumentException e){
mensaje="error";
}catch(es.yell.frontlite.exceptions.SrvBusquedaNoxtrumServiceException e1){
mensaje="error";
}catch(Exception e2){
mensaje="error";
return mensaje;
public String obtenerResultadosWML(es.yell.frontlite.service.impl.BusquedaVO busquedaVO){
if (busquedaVO == null){
throw new IllegalArgumentException(
"obtenerResultadosJSdesactivado(es.yell.frontlite.service.impl.BusquedaVO busquedaVO) - 'busquedaVO' no puede ser nulo.");
try{
return this.manejarObtenerResultadosWML(busquedaVO);
}catch(es.yell.frontlite.exceptions.SrvBusquedaNoxtrumServiceException e1){
throw new es.yell.frontlite.exceptions.SrvBusquedaNoxtrumServiceException(
"Error ejecutando el servicio String obtenerResultadosJSdesactivado(es.yell.frontlite.service.impl.BusquedaVO busquedaVO). " + e1.getCause(),e1);
}catch(Exception e){
throw new es.yell.frontlite.exceptions.SrvBusquedaNoxtrumServiceException(
"Error ejecutando el servicio String obtenerResultadosJSdesactivado(es.yell.frontlite.service.impl.BusquedaVO busquedaVO). " + e.getCause(),e);
//it returns html code!
protected String manejarObtenerResultadosWML(es.yell.frontlite.service.impl.BusquedaVO busquedaVO)
throws java.lang.Exception{
try{
// xmlOrigen has full xml response from server
String xmlOrigen = manejarObtenerResultadosJSActivado(busquedaVO);
Source xmlSource = new StreamSource(new StringBufferInputStream(xmlOrigen));
Source xsltSource = new StreamSource(SrvBusquedaNoxtrumServiceImpl.class.getResourceAsStream(Constantes.XSL_FILE));
StringWriter cadenaSalida = new StringWriter();
Result bufferResultado = new StreamResult(cadenaSalida);
TransformerFactory factoriaTrans = TransformerFactory.newInstance();
Transformer transformador = factoriaTrans.newTransformer(xsltSource);
transformador.transform(xmlSource, bufferResultado);
System.out.println(cadenaSalida.toString());
return cadenaSalida.toString();
}catch(Exception e2){
throw new es.yell.frontlite.exceptions.SrvBusquedaNoxtrumServiceException (e2.getMessage());
With this exit in html, since(as,like) how could i forward it towards a jsp especially?
faces-config.xml
<navigation-rule>
<from-view-id>/index.jsp</from-view-id>
<navigation-case>
<from-outcome>succesNoJS</from-outcome>
<to-view-id>/jsDesactivado.jsp</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>error</from-outcome>
<to-view-id>/error.jsp</to-view-id>
</navigation-case>
</navigation-rule>
index.jsp
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<f:view>
<f:loadBundle basename="MessageResources" var="msg"/>
<head>
<title>
${msg.titulo}
</title>
</head>
<body>
<h:form id="formulario">
Que:
<h:inputText id="campoQue" value="#{yellProxy.campoQue}" />
Donde
<h:inputText id="campoDonde" value="#{ yellProxy.campoDonde}" />
<h:commandButton id="boton" value="Encuentra" action="#{yellProxy.encuentra}"/>
</h:form>
</f:view>
</body>
</html>
jsDesactivado.jsp
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%--
The taglib directive below imports the JSTL library. If you uncomment it,
you must also add the JSTL library to the project. The Add Library... action
on Libraries node in Projects view can be used to add the JSTL 1.1 library.
--%>
<%--
<%@taglib uri=" http://java.sun.com/jsp/jstl/core" prefix="c"%>
--%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
" http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>JSP Page</h1>
jsDesactivado!!
<%--
This example uses JSTL, uncomment the taglib directive above.
To test, display the page like this: index.jsp?sayHello=true&name=Murphy
--%>
<%--
<c:if test="${param.sayHello}">
<!-- Let's welcome the user ${param.name} -->
Hello ${param.name}!
</c:if>
--%>
<jsp:getProperty name="yellProxy" property="resultado"/>
</body>
</html>
If you could pass me a simple example of use of an app that uses JSF, tiles, xml and xsl, i�be grateful
regards a lot!

We too (at Viking Freight) would also be very interested to see if anybody
has produced such a useful series of classes...
Frank Lees, Developer
-----Original Message-----
From: Amin, Kamran [mailto:kamran.aminframeworkinc.com]
Sent: Wednesday, January 19, 2000 12:11 PM
To: 'Forte User'
Subject: (forte-users) XML and XSL in Forte
Has anybody integrated an XSL parser with Forte. I know Forte provides us
with an XML parser but that does not help with parsing XSL. There a lot of
parsers written in JAVA but that will not integrate well with Forte. We
need something that will be easy to integrate with Forte. This parser will
take our XML and XSL to give us a result set. If anybody can comment on the
subject or share some information I would appreciate it.
thanks in advance.
ka
For the archives, go to: http://lists.sageit.com/forte-users and use
the login: forte and the password: archive. To unsubscribe, send in a new
email the word: 'Unsubscribe' to: forte-users-requestlists.sageit.com

Similar Messages

  • Cannot view PDF created by passing xml and XSL-FO using UTL_HTTP

    Hi,
    Using UTL_HTTP Iam trying to contact a servlet which uses the input XML and XSL/FO to produce a PDF.However, when I run the procedure , I get the following error 'File does not begin with -%PDF' ? I checked the output on the console and the blob values does not start with %PDF . Below is the sample from my code , please let me know if Iam commiting a mistake somewhere. I confirmed that the servlet itself is working fine by confirming with test webpage that takes xml and stylesheet input and generates a PDF when 'submitted' to servlet on the click of a button.
    INSERT INTO TESTPDF ( PDF_REPORT ) VALUES ( Empty_Blob() ) RETURNING PDF_REPORT INTO vBlobRef;
    vReportURL :='/rufop/fop?xml='||xmldoc||'&xsltRPath=../../test/PAXSL.xsl';
    req := UTL_HTTP.BEGIN_REQUEST (url=>vReportURL, method=>'POST');
    resp := utl_http.get_response(req);
    loop
    begin
    Utl_Http.read_raw(resp, vData);
    Dbms_Lob.writeAppend ( lob_loc => vBlobRef , amount => Utl_Raw.length(vData) , buffer => vData );
    exception
    when utl_http.end_of_body then
    exit;
    end;
    end loop;
    Utl_Http.end_response(resp);
    owa_util.mime_header('application/pdf',false);
    htp.p('Content-Disposition: inline; filename="test.pdf"');
    htp.p('Content-Length: '|| dbms_lob.getlength(vBlobRef));
    owa_util.http_header_close;
    wpg_docload.download_file(vBlobRef);
    Thanks in advance,
    Jen

    Hello guys! I have been assigned the same task,i.e to generate pdf through xml using xsl stylesheet.
    I have a procedure which is creating the xml and the stylesheet. But I have no idea how to write the procedure which passes this xml to fo engine. I am very new to this. Can anyone please share your thoughts with me so as how to accomplish this? By reading blogs on internet I figured I would have to use UTIL_HTTP but don't know how.
    Sunny
    Edited by: 887252 on May 29, 2012 1:24 AM

  • How to save xml and xsl function to a data grid column

    hi. wondering, i have a xml and a xsl file, and have the transform class, and so need to save the xml and the xsl file, and display the results on a particular data grid column and to loop through the data grid columns. so, how do i use the xml save function
    class, any examples or point me to articles, where i can read how to do this. need to display a file, with a different colour and font. any ideas. thanks. marvin.hi. need to save a xml and xsl file and display the results on data grid. how do i do this. any
    sample code or articles i can read about thanks. marvin.
    http://startrekcafe.stevesdomain.net http://groups.yahoo.com/groups/JawsOz

    
    Hi.
    Okay, well, did ask on the msdn forums, and some one replied, and so, will paste the code he suggested.
    But getting a lot of errors.
    Can you help me out.
    Where am I going wrong.
    So, I can then get this to work, then it shows the colours and the fonts on the specified data grid.
    Can you help.
    Want to get this working and passed today if possible.
    Will pasate the code and the errors below.
    Can you help.
    Where am I going wrong.
    Marvin.
    // Set up the data set.
    DataSet ds =
    new
    DataSet();
    // Set up the data table.
    DataTable dt =
    new
    DataTable();
    // Ad the data table to the data set.
        ds.Tables.Add(dt);
    // Write the xml document to the data grid column.
        ds.WriteXML(@"c:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\CurrentCount.xml");
        ds.WriteXML(@"c:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\OnOrder.xml");
        ds.ReadXML(@"c:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\CurrentCount.xml");
        ds.ReadXML(@"c:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\OnOrder.xml");
    // Set up the data table and the data set and set to 0.
        dgvDisplayData.DataSource = ds.Tables[0];
    Error      1              Invalid token '(' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                215        
    18           WoodStocks
    Error      2              Invalid token ')' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                215        
    21           WoodStocks
    Error      3              Invalid token '(' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                219        
    16           WoodStocks
    Error      4              Invalid token '(' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                221        
    16           WoodStocks
    Error      5              Invalid token '(' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                222        
    15           WoodStocks
    Error      6              Invalid token '(' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                223        
    15           WoodStocks
    Error      7              Invalid token '=' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                227        
    31           WoodStocks
    Error      8              Array size cannot be specified in a variable declaration (try initializing with a 'new' expression)               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                227        
    43           WoodStocks
    Error      9              Invalid token ';' in class, struct, or interface member declaration               
    C:\Docs\Education\CertificateFourProgramming\CoreInfrastructure\DevelopingXMLApplications\Assignments\WoodStocks\WoodStocks\frmData.cs                227        
    45           WoodStocks
    Can you help me out.
    Thanks.
    http://startrekcafe.stevesdomain.net http://groups.yahoo.com/groups/JawsOz

  • RE: (forte-users) XML and XSL in Forte

     

    We too (at Viking Freight) would also be very interested to see if anybody
    has produced such a useful series of classes...
    Frank Lees, Developer
    -----Original Message-----
    From: Amin, Kamran [mailto:kamran.aminframeworkinc.com]
    Sent: Wednesday, January 19, 2000 12:11 PM
    To: 'Forte User'
    Subject: (forte-users) XML and XSL in Forte
    Has anybody integrated an XSL parser with Forte. I know Forte provides us
    with an XML parser but that does not help with parsing XSL. There a lot of
    parsers written in JAVA but that will not integrate well with Forte. We
    need something that will be easy to integrate with Forte. This parser will
    take our XML and XSL to give us a result set. If anybody can comment on the
    subject or share some information I would appreciate it.
    thanks in advance.
    ka
    For the archives, go to: http://lists.sageit.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.sageit.com

  • Converting XML and XSL into HTML

    Hello!
    I'm designing a servlet class that merges an xml file and xsl file into html that will be sent to the client. But I don't understand how the (sparsely documented) javax.xml.transform.dom package works. An exception is generated for a missing "version" tag, when I've included one that has worked on client-side xml/xsl pages before. If it matters, I'm using Apache Tomcat/JDK 1.4.
    Here's the code:package mypackage.servlet.xml;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.parsers.*;
    import org.w3c.dom.*;
    import org.xml.sax.*;
    public class XML2HTMLServlet extends HttpServlet {
         public void doGet(HttpServletRequest request, HttpServletResponse response)
          throws IOException, ServletException {
              response.setContentType("text/html");
              PrintWriter writer = response.getWriter();
              try {
                   openFile("D:/Webdev/xml2html/data.xml", "D:/Webdev/xml2html/style.xsl", writer);
              } catch (Exception e) {
                   e.printStackTrace(writer);
         private void openFile(String xmlPath, String xslPath, PrintWriter writer)
          throws IOException, ParserConfigurationException, SAXException,
          TransformerConfigurationException, TransformerException {
              File xmlFile = new File(xmlPath);
              File xslFile = new File(xslPath);
              TransformerFactory tFact = TransformerFactory.newInstance();
              DocumentBuilderFactory dbFact = DocumentBuilderFactory.newInstance();
              DocumentBuilder builder = dbFact.newDocumentBuilder();
              Document xmlDoc = builder.parse(xmlFile);
              Document xslDoc = builder.parse(xslFile);
              Node xmlDocNode = (Node)xmlDoc;
              Node xslDocNode = (Node)xslDoc;
              DOMSource xmlSrc = new DOMSource(xmlDocNode);
              DOMSource xslSrc = new DOMSource(xslDocNode);
              DOMResult htmlResult = new DOMResult();
              Transformer transformer = tFact.newTransformer(xslSrc);  // the exception occurs here!
    When it runs, it complains:
    javax.xml.transform.TransformerConfigurationException:
    javax.xml.transform.TransformerConfigurationException:
    javax.xml.transform.TransformerException:
    javax.xml.transform.TransformerException: stylesheet requires attribute: version at
    org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:767) at
    mypackage.servlet.xml.XML2HTMLServlet.openFile(XML2HTMLServlet.java:49) at
    ...etc...etc...
    data.xml contains:
    <?xml version="1.0"?>
    <document type="lecture">
         <title>Test Data</title>
         <section>
              <name>A New Section</name>
         </section>
    </document>
    style.xsl contains:
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
         <html>
              <head>
                   <title><xsl:value-of select="document/title"/></title>
              </head>
              <body>
                   <xsl:apply-templates select="document/section"/>
              </body>
         </html>
    </xsl:template>
    <xsl:template match="section">
         <div><i>Section</i><br/><xsl:value-of select="name"/></div>
    </xsl:template>
    </xsl:stylesheet>I'm not sure the method calls above are what I want, so here's the client-side equivalent in Internet Explorer 5.0:
    function createStyledXMLDocument(xmlUrl, xslUrl) {
         var xmlDocument = new ActiveXObject("Microsoft.XMLDOM");
         xmlDocument.load(xmlUrl);
         var xslDocument = new ActiveXObject("Microsoft.XMLDOM");
         xslDocument.load(xslUrl);
         return xmlDocument.transformNode(xslDocument);
    }Any help would be greatly appreciated.

    Hi!
    I found the immediate answer with
    dbFact.setNamespaceAware(true);As for parser, I'm just using the default JDK install. But I'd like to hear more on Xalan. Is it independent open source? How does Xalan compare to whatever is default in JDK?
    Thanks

  • Generating PDF with XML and XSL

    Hi, quick basic question...
    I'm trying to generate pdf doc from xml with xsl.
    I'm using following sample code from xml.apache.org
    response.setContentType("application/pdf");
    Driver driver =new Driver();
    driver.setOutputStream(response.getOutputStream());
    driver.setRenderer(Driver.RENDER_PDF);
    Transformer transformer=TransformerFactory.newInstance()
    .newTransformer(new StreamSource("foo.xsl"));
    transformer.transform(xmlsource, new SAXResult(driver.getContentHandler()));
    xmlSource is my regular xml that wants to be pdf.
    is foo.xsl any regular xsl that I use to coonvert xml into html?
    or is it some special xsl that is tailored for pdf.
    Is this what is called xsl-fo?
    Thanks
    IL

    Hi IL,
    XSLT can translate XML to something else. It is most suited to transforming to another tree-like format (XML, HTML, etc.) but can be 'asked' to produce other kinds of output, flat text for example.
    It is driven by an XSL file which is a series of patterns to match and output to produce.
    This XSL file can be used to generate another XML document in which the nodes come from the Formatting Object namespace. These describe, in generic terms the format of an output document based upon the contents of the original XML.
    The formatting object XML document can then be used as input to a formatting object XML processor which can generate PDF output from it.
    You may want to check out:
    www.w3c.org
    for all the stuff on XML, XSL, XSLT, Formatting Objects, etc., and:
    xml.apache.org
    for imformation on Xalan, which is an XSL processor and FOP, which is a formatting object processor.
    Hope that helps,
    Peter.

  • How to generate HTML from XML and XSL?

    Hi all,
    I am new to XML.
    Can I somehow see the HTML-Output of the XML-File, when I have the XSL-File too, but don't use any XML-Editor (XMLSpy) and FOP? I do not want use any additional tools - only the database tools.
    What I need for this?
    Do I need the XSLT-File too?
    I am waiting for your answers, when possible with examples please.
    Regards
    Leonid Pavlov

    Please post on the General XML forum.

  • How can I use JavaScript extention functions with Xalan for transforming XML with XSL

    While transforming standart XML and XSL files to HTML with this servlet:
    package mypackage1;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    import java.net.URL;
    import javax.xml.transform.*;
    import javax.xml.transform.stream.StreamSource;
    import javax.xml.transform.stream.StreamResult;
    import org.mozilla.javascript;
    public class Servlet2 extends HttpServlet
    private static final String CONTENT_TYPE = "text/html; charset=windows-1252";
    public void init(ServletConfig config) throws ServletException
    super.init(config);
    public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException
    try
    response.setContentType(CONTENT_TYPE);
    PrintWriter out = response.getWriter();
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Source xmlSource = new StreamSource(new FileReader("c:/aaa.xml"));
    Source xslSource = new StreamSource(new FileReader("c:/bbb.xsl"));
    Transformer transformer = tFactory.newTransformer(xslSource);
    transformer.transform (xmlSource, new StreamResult(out));
    catch (Exception e)
    e.printStackTrace();
    everything is going ok,
    but when try to use javascript function in XSL file, for example like in this:
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
    xmlns:lxslt="http://xml.apache.org/xslt" xmlns:my-ext="ext1"
    extension-element-prefixes="my-ext">
    <lxslt:component prefix="my-ext"
    functions="getdate">
    <lxslt:script lang="javascript">
    function getdate() {
    var d = new Date();
    return d.toUTCString();
    </lxslt:script>
    </lxslt:component>
    <xsl:template match="/">
    <p><xsl:copy-of select="my-ext:getdate()"/></p>
    </xsl:template>
    </xsl:stylesheet>
    recieve error-message:
    XSL-1000: (Fatal Error) Error while parsing XSL file (Extension function namespace should start with 'http://www.oracle.com/XSL/Transform/java/'.).
    What kind of namespace I should specify?

    Hello, Paul.
    I'm sure you may not use JavaScript as a language for creating XSLT extention functions with Oracle XDK Parser. This is since parser might have JavaScript interpreter to work with JavaScript, but it has not.
    If you need to build any XSLT extention functions you must build them as Java class' static methods.
    After that, you define the usage of the class by mean of namespace declaration as:
    xmlns:your-ns="http://www.oracle.com/XSL/Transform/java/yourpackage.Yourclass"
    (Prefix "http://www.oracle.com/XSL/Transform/java/" may differs if you use non-Oracle XML parser)
    and use class' static method in XSLT:
    <xsl:value-of select="your-ns.staticMethodName(paramsIfAny)"/>
    In your case you may wish to use standard Date class:
    xmlns:date="http://www.oracle.com/XSL/Transform/java/java.util.Date"
    <xsl:value-of select="date:toString(date:new)"/>

  • Unable to display a variable value in xml through xsl using coldfusion

    Hi ColdFusion Heroes ,
    Is their any one to help me in this issue . I am new to cold
    fusion , XML and XSL .
    Detail Explaination :
    develoment_files.cfm is a .cfm page , which includes an xml
    page .
    development_files_dropdown.xsl is a xsl page .
    develoment_files.cfm : Code is as follows .
    <CFDIRECTORY ACTION="LIST" DIRECTORY="#somepath#"
    NAME="DirContents" FILTER="p*">
    <CFQUERY DBTYPE="query" NAME="Files">
    SELECT *
    FROM DirContents
    WHERE Type = 'File'
    </CFQUERY>
    <CFOUTPUT><?xml version='1.0' encoding='UTF-8'?>
    <?xml-stylesheet type="text/xsl"
    href="../XSL/development_files_dropdown.xsl"?>
    <Test xmlns:xsi='
    http://www.w3.org/2001/XMLSchema-instance'>
    <CFLOOP QUERY="Files">
    <Directory>
    <DisplayName>#Name#</DisplayName>
    <FullPath>#Name#</FullPath>
    </Directory>
    </cfloop>
    </Test></CFOUTPUT>
    This file generates a query resulting files starting with p*
    and then it should be a file and manipulates in xml.
    development_files_dropdown.xsl pages is as follows.
    <?xml version='1.0'?>
    <xsl:stylesheet version="1.0" xmlns:xsl="
    http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html" indent="yes"/>
    <xsl:preserve-space elements="*"/>
    <xsl:template match="/">
    <xsl:apply-templates/>
    </xsl:template>
    <xsl:template match="Test">
    <B>Script Name: </B>
    <select name="T1_Dev_Script" CLASS="DevInput">
    <xsl:for-each select="Directory">
    <option>
    <xsl:attribute name="value">
    <xsl:value-of select="FullPath/text()"/>
    </xsl:attribute>
    <xsl:value-of select="DisplayName/text()"/>
    </option>
    </xsl:for-each>
    </select>
    </xsl:template>
    </xsl:stylesheet>
    This is only for the purpose of display .
    Now i want to get one particular file named "pfile" { Code is
    written in development_files.cfm page and kept it in a variable } I
    want to display it in #Name# filed. how can i do that ? I am
    getting XML Parsing error from javascript .
    Could any one look into this .
    Thanks & Regards,
    Nataraj G

    The first part is right -
    1) drag a text element onto the page, at a location in which you want the variable value to be displayed
    2) On the left hand bottom page - go to the web item properties for the text element
    3) scroll down to the specific properties for the item - in that uncheck the first two check boxes - display general text elements & display static filter values
    4) in the next item in the properties (List of text elements) click once on the box where List is written and then clcik on the small browse button that appears.
    5) in the window that opens, in the element type field, select variable/variable value as key (as per your requirement) and then under the element ID field type in the technical name of your variable that you want to display.
    click ok and save your template and try executing it.
    See if this solves your problem.
    regards,
    Nikhil

  • Java XML and podcasts

    Hi all,,
    Im just looking for some help with a java xml passer program. Im trying to create a program that will read specific tags and the values that are represented by these tags in the xml file..I have found the following code
    import java.io.File;
    import org.w3c.dom.Document;
    import org.w3c.dom.*;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.DocumentBuilder;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    public class ReadAndPrintXMLFile{
    public static void main (String argv []){
    try {
    DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
    Document doc = docBuilder.parse (new File("book.xml"));
    // normalize text representation
    doc.getDocumentElement ().normalize ();
    System.out.println ("Root element of the doc is " + doc.getDocumentElement().getNodeName());
    NodeList listOfPersons = doc.getElementsByTagName("person");
    int totalPersons = listOfPersons.getLength();
    System.out.println("Total no of people : " + totalPersons);
    for(int s=0; s<listOfPersons.getLength() ; s++){
    Node firstPersonNode = listOfPersons.item(s);
    if(firstPersonNode.getNodeType() == Node.ELEMENT_NODE){
    Element firstPersonElement = (Element)firstPersonNode;
    NodeList firstNameList = firstPersonElement.getElementsByTagName("first");
    Element firstNameElement = (Element)firstNameList.item(0);
    NodeList textFNList = firstNameElement.getChildNodes();
    System.out.println("First Name : " + ((Node)textFNList.item(0)).getNodeValue().trim());
    NodeList lastNameList = firstPersonElement.getElementsByTagName("last");
    Element lastNameElement = (Element)lastNameList.item(0);
    NodeList textLNList = lastNameElement.getChildNodes();
    System.out.println("Last Name : " + ((Node)textLNList.item(0)).getNodeValue().trim());
    NodeList ageList = firstPersonElement.getElementsByTagName("age");
    Element ageElement = (Element)ageList.item(0);
    NodeList textAgeList = ageElement.getChildNodes();
    System.out.println("Age : " + ((Node)textAgeList.item(0)).getNodeValue().trim());
    }//end of if clause
    }//end of for loop with s var
    }catch (SAXParseException err) {
    System.out.println ("** Parsing error" + ", line " + err.getLineNumber () + ", uri " + err.getSystemId ());
    System.out.println(" " + err.getMessage ());
    }catch (SAXException e) {
    Exception x = e.getException ();
    ((x == null) ? e : x).printStackTrace ();
    }catch (Throwable t) {
    t.printStackTrace ();
    //System.exit (0);
    }//end of main
    }Im trying to develop this code to work with podcast xml files..Im having a few issuses with this program.. Is there anyone out there that has created a program like this that works with podcast xml files??
    Anyone got any suggestions.Please.

    XML and XSL transformations can be done using most languages and in Java there is strong support for these techniques.
    It worries me a little bit that you ask this question though. XML and XSL are no more than a tool to solve SOME problems, but I get the idea that you want to put them on your resume as if they are your main talent. The tool set of the developer is much broader than just some techniques to format and transform data, you need to be able to solve problems in the most efficient way possible, not limiting yourself to only a handful of techniques that you just happen to know a lot about.
    What I am trying to say is: it is always good to have knowledge of these techniques, but don't go thinking it is going to guarantee you a job.

  • Convert xsl and xsl to pdf

    Hi,
    In our project, we generate reports using xalan parser in PDF and HTML formats. Now, my client wants them to be generated in RTF (Ms Word) format as well. As this is not possible using xalan, I tried to find out other parsers. I found one JFOR which generates RTFdocs from XSLFO. What I have is only XML and XSL documents. How can I get XSLFO document using these two? Is there any parser which generates XSLFO docs using XML and XSL? Or is there any parser which generates RTF docs directly from XML and XSL?
    Thanks
    Jagadeesh

    As this is not possible using xalanWhy is it not possible? RTF is a text format as far as I know, and you can output text from XSLT.

  • Help-XML report which uses XSL-FO and XSL-FO contains OAF VO

    Hello All,
    I want to know functionality of one XML report developed by Oracle.
    From one oracle form after clicking one button, it is populating PDF file output of report to open.
    Here is what Oracle has done to achieve this:
    On the click of button on oracle form, it is calling one OAF form. (fnd_function.execute(function_name=> 'ONT_PRINT').
    This OAF form contains nothing on its layout. One CO (File is attached) and AM is attached to this OAF page.
    In CO, may be it is somehow it is calling RTF file.
    I got the RTF file from XML publisher, RTF imports one XSL-FO (ONTBSAEXSL is a Template of XSL-FO type in Oracle apps in XMP Publisher administrator responsibility) file using <?import:xdo://ONT.ONTBSAEXSL.en.00/?>
    In the XSL file, OAF View Objects has been used like,
    <xsl:variable name="LinesVO" select="/*/HeaderVO/HeaderVORow/LinesVO/LinesVORow"/>
    What is the meaning of " /*/HeaderVO/HeaderVORow/LinesVO "? Does it mean LinesVO is getting called by HeadersVO. But in OAF this never happens.
    I want to add some columns in the RTF from LinesVO. But "Unit price" is not available in LinesVO.
    Do I need to extend this VO in JDeveloper and upload the .JPX and extended VO files?
    I have done extending the VO, but no use..
    So,
    In short my question is,
    If I extend the VO LinesVO by XXLinesVO, then will this <xsl:variable name="LinesVO" select="/*/HeaderVO/HeaderVORow/LinesVO/LinesVORow"/>
    statement in XSL-FO use my XXLinesVO or LinesVO?
    Regards,
    Parag

    I want to customize one RTF template by adding some columns. This RTF imports one XSL-FO stylesheet.
    RTF has tags like <?for-each:/*/HeaderVO/HeaderVORow/LinesVO/LinesVORow?>
    and XSL file has tags like <xsl:variable name="InternalOrgName" select="/*/HeaderVO/HeaderVORow/InternalOrgVO/InternalOrgVORow/Name"/>
    If I want to add one colun in LinesVO, what are all things I need to do?
    I customized it by adding the new columns through JDeveloper and extending the VO's and substituting them, importing JPX and bounced apache.
    But the XSL-FO file is very strange (attached herewith). Those changes are not reflecting in report even after extension.

  • JSF 1.2 and Tiles integration

    I have a web application using JSF 1.1 and Tiles that I am trying to upgrade to run using JSF 1.2.
    It is working as far as working out that it should use the tile, but then it all seems to fall over when trying to render.
    Does anyone know if it is possible to use Tiles with JSF 1.2?
    Steven

    Hi,
    I took the Shales TileViewHandler and replaced the renderView method with the one below. This is a copy of the method from the Sun RI except that it passes the tile (ComponentDefinition) along to the subsequent methods.
    Then when it gets down to executePageToBuildView the requestURI is obtained from the tile (tile.getPath()) rather than from the UIViewRoot (viewToExecute.getViewId()).
       public void renderView(FacesContext facesContext, UIViewRoot viewToRender)
                                            throws IOException, FacesException {
          String viewId = viewToRender.getViewId();
          String tileName = getTileName(viewId);
          ComponentDefinition tile = getTile(tileName);
          if (log.isDebugEnabled()) {
             String message = null;
             try {
                 message = bundle.getString("tiles.renderingView");
             } catch (MissingResourceException e) {
                 message = "Rendering view {0}, looking for tile {1}";
             synchronized(format) {
                format.applyPattern(message);
                message = format.format(new Object[] { viewId, tileName });
             log.debug(message);
          if (tile != null) {
             if (log.isDebugEnabled()) {
                String message = null;
                try {
                    message = bundle.getString("tiles.dispatchingToTile");
                } catch (MissingResourceException e) {
                    message = "Dispatching to tile {0}";
                synchronized(format) {
                   format.applyPattern(message);
                   message = format.format(new Object[] { tileName });
                log.debug(message);
             dispatchToTile(facesContext, viewToRender, tile);
          else {
             if (log.isDebugEnabled()) {
                String message = null;
                try {
                    message = bundle.getString("tiles.dispatchingToViewHandler");
                } catch (MissingResourceException e) {
                    message = "Dispatching {0} to the default view handler";
                synchronized(format) {
                   format.applyPattern(message);
                   message = format.format(new Object[] { viewId });
                log.debug(message);
             defaultViewHandler.renderView(facesContext, viewToRender);
       private void dispatchToTile(FacesContext facesContext, UIViewRoot viewToRender, ComponentDefinition tile) throws java.io.IOException
           ExternalContext externalContext = facesContext.getExternalContext();
           Object request = externalContext.getRequest();
          Object context = externalContext.getContext();
          TilesContext tilesContext = TilesContextFactory.getInstance(context, request);
          ComponentContext tileContext = ComponentContext.getContext(tilesContext);
          if (tileContext == null) {
             tileContext = new ComponentContext(tile.getAttributes());
             ComponentContext.setContext(tileContext, tilesContext);
          else
             tileContext.addMissing(tile.getAttributes());
          renderTile(facesContext, viewToRender, tile);
          // dispatch to the tile's layout
          //externalContext.dispatch(tile.getPath());
       private void renderTile(FacesContext context, UIViewRoot viewToRender, ComponentDefinition tile) throws IOException, FacesException
           // suppress rendering if "rendered" property on the component is
           // false
           if (!viewToRender.isRendered()) {
               return;
           ExternalContext extContext = context.getExternalContext();
           ServletRequest request = (ServletRequest) extContext.getRequest();
           ServletResponse response = (ServletResponse) extContext.getResponse();
           try {
               if (executePageToBuildView(context, viewToRender, tile)) {
                   response.flushBuffer();
                   //ApplicationAssociate.getInstance(extContext).responseRendered();
                   return;
           } catch (IOException e) {
               throw new FacesException(e);
           // set up the ResponseWriter
           RenderKitFactory renderFactory = (RenderKitFactory)
           FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
           RenderKit renderKit =
                   renderFactory.getRenderKit(context, viewToRender.getRenderKitId());       
           ResponseWriter oldWriter = context.getResponseWriter();
           initBuffSize(context);
           WriteBehindStringWriter strWriter =
                 new WriteBehindStringWriter(context, bufSize);
           ResponseWriter newWriter;
           if (null != oldWriter) {
               newWriter = oldWriter.cloneWithWriter(strWriter);
           } else {
               newWriter = renderKit.createResponseWriter(strWriter, null,
                       request.getCharacterEncoding());           
           context.setResponseWriter(newWriter);
           newWriter.startDocument();
           doRenderView(context, viewToRender);
           newWriter.endDocument();
           // replace markers in the body content and write it to response.
           ResponseWriter responseWriter;
           if (null != oldWriter) {
               responseWriter = oldWriter.cloneWithWriter(response.getWriter());
           } else {
               responseWriter = newWriter.cloneWithWriter(response.getWriter());
           context.setResponseWriter(responseWriter);
           strWriter.flushToWriter(responseWriter);
           if (null != oldWriter) {
               context.setResponseWriter(oldWriter);
           // write any AFTER_VIEW_CONTENT to the response
           writeAfterViewContent(extContext, response);
       private boolean executePageToBuildView(FacesContext context, UIViewRoot viewToExecute, ComponentDefinition tile)
       throws IOException {
           if (null == context) {
               String message = MessageUtils.getExceptionMessageString
                       (MessageUtils.NULL_PARAMETERS_ERROR_MESSAGE_ID, "context");
               throw new NullPointerException(message);
           if (null == viewToExecute) {
               String message = MessageUtils.getExceptionMessageString
                       (MessageUtils.NULL_PARAMETERS_ERROR_MESSAGE_ID, "viewToExecute");
               throw new NullPointerException(message);
           String mapping = Util.getFacesMapping(context);
           String requestURI =
                 updateRequestURI(viewToExecute.getViewId(), mapping);
           String requestURI =
               updateRequestURI(tile.getPath(), mapping);
           if (mapping.equals(requestURI)) {
               // The request was to the FacesServlet only - no path info
               // on some containers this causes a recursion in the
               // RequestDispatcher and the request appears to hang.
               // If this is detected, return status 404
               HttpServletResponse response = (HttpServletResponse)
                     context.getExternalContext().getResponse();
               response.sendError(HttpServletResponse.SC_NOT_FOUND);
               return true;
           ExternalContext extContext = context.getExternalContext();
           // update the JSTL locale attribute in request scope so that JSTL
           // picks up the locale from viewRoot. This attribute must be updated
           // before the JSTL setBundle tag is called because that is when the
           // new LocalizationContext object is created based on the locale.
           // PENDING: this only works for servlet based requests
           if (extContext.getRequest()
           instanceof ServletRequest) {
               Config.set((ServletRequest)
               extContext.getRequest(),
                          Config.FMT_LOCALE, context.getViewRoot().getLocale());
           // save the original response
           Object originalResponse = extContext.getResponse();
           // replace the response with our wrapper
           ViewHandlerResponseWrapper wrapped =
                 new ViewHandlerResponseWrapper(
                       (HttpServletResponse)extContext.getResponse());
           extContext.setResponse(wrapped);
           // build the view by executing the page
           extContext.dispatch(requestURI);       
           // replace the original response
           extContext.setResponse(originalResponse);
           // Follow the JSTL 1.2 spec, section 7.4, 
           // on handling status codes on a forward
           if (wrapped.getStatus() < 200 || wrapped.getStatus() > 299) { 
               // flush the contents of the wrapper to the response
               // this is necessary as the user may be using a custom
               // error page - this content should be propagated
               wrapped.flushContentToWrappedResponse();
               return true;           
           // Put the AFTER_VIEW_CONTENT into request scope
           // temporarily
           if (wrapped.isBytes()) {
               extContext.getRequestMap().put(AFTER_VIEW_CONTENT,
                                              wrapped.getBytes());
           } else if (wrapped.isChars()) {
               extContext.getRequestMap().put(AFTER_VIEW_CONTENT,
                                              wrapped.getChars());
           return false;
       }You will also find you need to copy a few other methods from the Sun RI.
    There were a couple of calls to ApplicationAssociate.responseRendered() which I just commented out as well (because they are not visible). They stop people changing the StateManager or ViewHandler after responses have been rendered. Probably not a problem since I will have replaced the ViewHandler anyway.
    Steven

  • JSF 1.2 and Tomcat 6.0.16, error parsing 'jsf-ri-runtime.xml'

    I am working on an application that used jsf 1.1 but would like to move to jsf 1.2. I've added the 1.2 jars (jsf-api.jar and jsf-impl.jar) and jstl-1.2.jar to the app. When I deploy to tomcat 6, i get the following error:
    15-Feb-2008 11:30:36 org.apache.catalina.core.StandardContext listenerStart
    SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
    com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! Unable to parse document 'jar:file:/C:/servers/apache-tomcat-6.0.16/webapps/myWebApp/WEB-INF/lib/jsf-impl-1.2.jar!/com/sun/faces/jsf-ri-runtime.xml': This parser does not support specification "null" version "null"
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:212)
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:174)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:829)
    at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:718)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
    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:597)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
    Caused by: com.sun.faces.config.ConfigurationException: Unable to parse document 'jar:file:/C:/servers/apache-tomcat-6.0.16/webapps/myWebApp/WEB-INF/lib/jsf-impl-1.2.jar!/com/sun/faces/jsf-ri-runtime.xml': This parser does not support specification "null" version "null"
    at com.sun.faces.config.ConfigManager$ParseTask.call(ConfigManager.java:409)
    at com.sun.faces.config.ConfigManager$ParseTask.call(ConfigManager.java:353)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:619)
    I thought this would have something to do with the xml parser so i added jaxb and jaxp to the application but I still get the same error. Can anyone help? Is there a possibility that a library in the app is overriding jaxb/jaxp?

    I had a similar problem on OC4J. For some crazy reason, Oracle still bundles their own XML parser (I say still. It's OC4J 10.1.3 we have in production, so we're just a wee bit behind the curve). At any rate, I had to tell OC4j not to use Oracle's XML parser and just the one bundle with the JRE (1.5). IIRC (and I should know this since I work on Mojarra :), that's caused by an older version of JAXB, so I think you're on the right track. You might check to see if Tomcat 6 bundles JAXB. If it does, you'll need to remove it or update it. If you're on 1.5 or greater, I don't think you need to have that in the app server lib anyway, as the JDK/JRE bundles it.
    Hope that helps. :)

  • Navigation issue using jsf, tiles, tomahawk  :loosing faces context

    Hi all,
    I enhanced my webapp using tomahawks jscookmenu.
    Triggering 1 menuItem the wanted pages displays correctly but the next click anywhere in the application shows this error:
    org.apache.jasper.JasperException: javax.faces.FacesException: Faces context not found. getResponseWriter will fail. Check if the FacesServlet has been initialized at all in your web.xml configuration fileand if you are accessing your jsf-pages through the correct mapping. E.g.: if your FacesServlet is mapped to  *.jsf (with the <servlet-mapping>-element), you need to access your pages as 'sample.jsf'. If you tried to access 'sample.jsp', you'd get this error-message.The web config is like that:
    <?xml version="1.0"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
         version="2.4">
         <context-param>
              <description>Tiles MyFaces Config</description>
              <param-name>tiles-definitions</param-name>
              <param-value>/WEB-INF/tiles.xml</param-value>
         </context-param>
         <context-param> 
              <param-name>javax.faces.DEFAULT_SUFFIX</param-name> 
              <param-value>.jsp</param-value>
         </context-param>
         <context-param>
              <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
              <param-value>server</param-value>
         </context-param>
         <context-param>
              <param-name>javax.faces.PARTIAL_STATE_SAVING_METHOD</param-name>
              <param-value>off</param-value>
         </context-param>
         <!-- context-params mafaces -->
         <context-param>
              <param-name>org.apache.myfaces.READONLY_AS_DISABLED_FOR_SELECTS</param-name>
              <param-value>true</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.RENDER_VIEWSTATE_ID</param-name>
              <param-value>true</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.STRICT_XHTML_LINKS</param-name>
              <param-value>true</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.CONFIG_REFRESH_PERIOD</param-name>
              <param-value>this is a bug in myfaces</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.ADD_RESOURCE_CLASS</param-name>
              <param-value>org.apache.myfaces.renderkit.html.util.DefaultAddResource</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.RESOURCE_VIRTUAL_PATH</param-name>
              <param-value>/faces/myFacesExtensionResource</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.CHECK_EXTENSIONS_FILTER</param-name>
              <param-value>true</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
              <param-value>true</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
              <param-value>true</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.AUTO_SCROLL</param-name>
              <param-value>true</param-value>
         </context-param>
         <context-param>
              <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
              <param-value>false</param-value>
         </context-param>
         <!-- StartupServletContextListener -->
         <listener>
              <listener-class>
                   org.apache.myfaces.webapp.StartupServletContextListener
              </listener-class>
         </listener>
         <!-- Faces MyFacesExtensionsFilter -->
         <filter>
              <filter-name>MyFacesExtensionsFilter</filter-name>
              <filter-class>
                   org.apache.myfaces.webapp.filter.ExtensionsFilter
              </filter-class>
              <init-param>
                   <param-name>uploadMaxFileSize</param-name>
                   <param-value>1m</param-value>
              </init-param>
         </filter>
         <filter-mapping>
              <filter-name>MyFacesExtensionsFilter</filter-name>
              <url-pattern>/faces/*</url-pattern>
         </filter-mapping>
         <filter-mapping>
              <filter-name>MyFacesExtensionsFilter</filter-name>
              <url-pattern>*.jsf</url-pattern>
         </filter-mapping>
         <!-- Faces Servlet -->
         <servlet>
              <servlet-name>Faces Servlet</servlet-name>
              <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
              <load-on-startup>1</load-on-startup>
         </servlet>
         <!-- Faces Servlet Mapping -->
         <servlet-mapping>
              <servlet-name>Faces Servlet</servlet-name>
              <url-pattern>*.jsf</url-pattern>
         </servlet-mapping>
         <welcome-file-list>
              <welcome-file>index.jsp</welcome-file>
         </welcome-file-list>
         <servlet>
              <servlet-name>imageServlet</servlet-name>
              <servlet-class>my.com.xplorer.gui.v.ImageServlet</servlet-class>
         </servlet>
         <servlet-mapping>
              <servlet-name>imageServlet</servlet-name>
              <url-pattern>/image/*</url-pattern>
         </servlet-mapping>
    </web-app>So I lost the faces context using the jscookmenu, I believe.
    My webapp uses tiles, and there is 2 navigation possibilities: tomahawaks jscookmenu and tomahawaks commandNavigation.
    Latter one runs ok, I do use
    <t:panelNavigation id="nav" styleClass="navigation"
         itemClass="navitem" separatorClass="navseparator" 
         activeItemClass="navitem_active" openItemClass="navitem_open">
         <t:commandNavigation action="#{newsHandler.userRequest}" value="#{newsHandler.rss_source_name[0]}">
              <f:param name="navigator"  value="/jsf/news.jsp" />
         </t:commandNavigation>
    </t:panelNavigation>for this kind of navigation I do not use any navigation rules in faces config. To dynamically include the desired faces page I do that:
    <%
         String s = (String)request.getParameter("navigator");
         if (s == null || s.length() == 0 ) {
              s =  "/jsf/explorer.jsp";
    %>
    <jsp:include page="<%=s %>" />That does work.
    Now like I said I did enhance the app by adding tomahawks jscookmenu.
    Therefore I use the following in another tile:
    <t:jscookMenu layout="hbr" theme="ThemeOffice" styleLocation="resources/css">
              <%/* Availaible jscookMenu themes: ThemeIE, ThemeMiniBlack, ThemeOffice, ThemePanel
                 Availaible jscookMenu layout: hbr, hbl, hur, hul, vbr, vbl, vur, vul
                 respect to Heng Yuan http://www.cs.ucla.edu/~heng/JSCookMenu
            */%>
      <t:navigationMenuItem id="nav_0" itemLabel="#{localz.Xplorer}" action="Xplorer" />
    </t:jscookMenu>For this kind of navigation I tried to use navigation rules and the following show the config:
         <navigation-rule>
           <from-view-id>/jsf/*</from-view-id>
            <navigation-case>
                <from-outcome>Xplorer</from-outcome>
                <to-view-id>/jsf/tileMain.jsp?navigator=/jsf/explorer.jsp</to-view-id>
            </navigation-case>
            <navigation-case>
                <from-outcome>Tabs</from-outcome>
                <to-view-id>/jsf/tileMain.jsp?navigator=/jsf/tab.jsp</to-view-id>
            </navigation-case>
         </navigation-rule>That works for the first click. The desired page is shown. The nect click anywhere in the app then show the mentioned error.
    Using tiles I use this view-handler
    <view-handler>org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl</view-handler>One question is: can I use another view-handler on top of the above one? So I could extend com.sun.facelets.FaceletViewHandler and try my luck with this? Or is the solution pointed out just a millisecond from being ok, I just don�t see it?
    Maybe you need to know a bit more on how I use tiles:
    That is the page I start with. It inserts the tile shown underneath.
    <f:view locale="#{userLocale}">
         <f:loadBundle var="localz" basename="my.com.xplorer.gui.v.Lokalization" />
         <f:loadBundle var="bundle" basename="my.com.xplorer.gui.v.messages" />
         <f:subview id="tileMain">
              <h:form id="myJsfForm" styleClass="standard">
                        <tiles:insert definition="template" flush="false" />
              </h:form>
         </f:subview>
         <h:messages />
    </f:view>
    </html>The foolowing is the tile structure.
    The bodi tile is the dynamic part. Above you see that I dynamically load the pages into it.
    <t:htmlTag value="div" styleClass="pageLayout">
         <h:panelGrid columns="2" align="center" styleClass="pageContent">
              <f:facet name="header">
                   <f:subview id="header">
                        <tiles:insert attribute="header" flush="false" />
                   </f:subview>
              </f:facet>
              <t:htmlTag value="div" styleClass="pageMenu">
                   <f:subview id="menu">
                        <tiles:insert attribute="menu" flush="false" />
                   </f:subview>
              </t:htmlTag>
              <t:htmlTag value="div" styleClass="pageContentWoMenu">
                   <f:subview id="bodi">
                        <tiles:insert attribute="bodi" flush="false" />
                   </f:subview>
              </t:htmlTag>
              <f:facet name="footer">
                   <f:subview id="footer">
                        <tiles:insert attribute="footer" flush="false" />
                   </f:subview>
              </f:facet>
         </h:panelGrid>
    </t:htmlTag>Maybe you also need to know the tiles config?
    <tiles-definitions>
       <definition name="template" path="/jsf/tileTemplate.jsp">
              <put name="header"  value="/jsf/header.jsp"/>
          <put name="menu"    value="/jsf/menu.jsp"/>
          <put name="bodi"    value="/jsf/bodi.jsp"/>
          <put name="footer"    value="/jsf/footer.jsp"/>
       </definition>
       <definition name="/jsf/news.tiles" extends="template">
              <put name="bodi"  value="/jsf/news.jsp"/>
       </definition>
       <definition name="/jsf/explorer.tiles" extends="template">
              <put name="bodi"  value="/jsf/explorer.jsp"/>
       </definition>
       <definition name="/jsf/tab.tiles" extends="template">
              <put name="bodi"  value="/jsf/tab.jsp"/>
       </definition>If you have read until here: thanks very much.
    There seems to be a sort of gap regarding jsf navigation documentation.
    I mean the ordinary way is covered everywhere (the book I have covers that too), but jscookmenu seems not to fit in too good. I also tried it with an actionslistener in the jscookmenu but that failed, too. So a link to documents telling the truth on jsf navigation I would appreciate very much.
    Kind regards
    Belle Ile En Mer

    This is the error i am getting into now..
    exception
    org.apache.jasper.JasperException: An exception occurred processing JSP page /welcomeJSF.jsp at line 19
    16: This file is an entry point for JavaServer Faces application.
    17: --%>
    18: <body>
    19: <f:view>
    20: <h3><h:outputText value="CHOULTRY'S IN BANGALORE" /></h3>
    21: <h:form>
    22: <table border="0">
    Stacktrace:
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    root cause
    java.lang.RuntimeException: Cannot find FacesContext
         javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:1811)
         javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:1628)
         org.apache.jsp.welcomeJSF_jsp._jspx_meth_f_005fview_005f0(welcomeJSF_jsp.java:112)
         org.apache.jsp.welcomeJSF_jsp._jspService(welcomeJSF_jsp.java:86)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

Maybe you are looking for

  • Running a java service on linux (Redhat)

    I can create a basic script to run my java service, I can stop, and restart it from the command line when logged in. I have installed the script as a service. However, when I reboot, the service will not start. I have set it to be the very last thing

  • File Name Schema

    Dear All, I am working on Idoc-XI-File scenario. Currently I am getting an output file with the name "xi_timestamp" but now I want to change the timestamp with the "Delivery No" which is there in the flat file. Kindly suggest how this can be done. Wa

  • HT1202 How do I added my music to another computer thats not my home computer???

    How do I added my music to another computer thats not my home computer???

  • Windows 7 freezes on files copy operation on Macbook Pro 15" 2013 Late

    Hi, I use Windows installed via BootCamp on my Macbook Pro 15" 2013 Late with 512GB SSD. I installed all Apple drivers, but my laptop freezes(all windows stop responding) on a copy a lot of small files from one folder to another. After 2-5 min window

  • Flashing file icon -HELP!

    This morning my IMAC 24 Mid 2007 model was having a number of kernel attacks, I tunred it off and now all I get is either a grey screen, blue screen or a flashing file icon against a white background - what should I do to fix this?