Tomcat 6.0.9 and jsf 1.2 and jstl 1.2 using *.tag file error

I using :tomcat 6.0.9 and jsf 1.2 and jstl 1.2
My web.xml is at version 2.5 and I am using a custom tag (with the .tag extension). I am trying to use the http://java.sun.com/jsf/html library and values from my attribute. I'm new to this so I figure I must just me missing something.
I am run http://192.168.1.1/test.jsf laster,view:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
Stacktrace:
     org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)
     org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
     org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:415)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:308)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
     org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
     org.apache.jasper.servlet.JspServletWrapper.loadTagFile(JspServletWrapper.java:212)
     org.apache.jasper.compiler.TagFileProcessor.loadTagFile(TagFileProcessor.java:576)
     org.apache.jasper.compiler.TagFileProcessor.access$000(TagFileProcessor.java:50)
     org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(TagFileProcessor.java:627)
     org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1507)
     org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
     org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
     org.apache.jasper.compiler.TagFileProcessor$TagFileLoaderVisitor.visit(TagFileProcessor.java:631)
     org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1507)
     org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
     org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
     org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2392)
     org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
     org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
     org.apache.jasper.compiler.TagFileProcessor.loadTagFiles(TagFileProcessor.java:645)
     org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:190)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
     org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
     org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:308)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
     com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:414)
     com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImpl.java:455)
     com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:139)
     com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:108)
     com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:266)
     com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:159)
     javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.9 logs.
if go to /WEB-INF/tags/test.tag ,delete line: <h:outputText id="test" value="hello!" />
run http://192.168.1.1/test.jsf is OK!(no error),So I guess error for "<h:outputText id="test" value="hello!" />" line ,why in test.tag file do can't use the "http://java.sun.com/jsf/html " library,please help me.......
Here is file WEB-INF/web.xml content:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<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_5.xsd"
version="2.5">
<display-name>Welcome to Tomcat</display-name>
<description>
Welcome to Tomcat
</description>
<!-- 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>
</web-app>
Here is file /test.jsp code:
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<f:view>
<html>
<head>
<title>test</title>
</head>
<body>
<!-- body start -->
<h:outputText id="myinfo" value="test success" />
<tags:test/>
<!-- body end -->
</body>
</html>
</f:view>
Here is file /WEB-INF/tags/test.tag code:
<%@tag pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<h:outputText id="test" value="hello!" />
Thanks for any help.

Don't know if it's important, but there is no schema avaiable at: http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd
I found the right one at: http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd
/perty
Message was edited by:
perajonsson

Similar Messages

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

  • Valuelist and jsf

    I trying to display large volume of search results (1000-3000 rows) on my JSF page. And here are my options:-
    1.DisplayTag and JSF
    http://displaytag.sourceforge.net/11/DisplayTag is a popular candidate. Matt Raible has posted an example http://demo.appfuse.org/appfuse-jsf/users.html example of JSF-DisplayTag integration. But I read somewhere that the performance degrades and the page takes more than 40 seconds to load when there are more than 5000 search results. It makes sense, as the search results are stored in the session in this approach.
    2.ValueListHandlerTag and JSF
    This http://valuelist.sourceforge.net/tutorial.htm tag uses the ValueListHandler J2EE pattern. But I could not find any examples of how to integrete this with JSF. Has any one tried this before?
    3.Custom JSF Compoenent
    Similar to the option above. Except that it would involve me writing a custom jsf component that uses the ValueListHandler pattern (call a stateful session bean to fetch the rows for the current page).
    4.MyFaces DataTable
    http://www.irian.at/cagatay-validation-sandbox/selectOneRow.jsf
    Havn't used this before. Is it any good?
    So, these are the options I have. Any suggestions..
    Message was edited by:
    Mike.Corleone

    Who on earth would read the 3000 rows at once? Google doesn't show billions webbpages at once in the same page, do they?
    Implement filtering (searching) and/or paging techniques. Showing 100 rows at once is far more than enough. You may get useful ideas out of this: [http://balusc.blogspot.com/2008/10/effective-datatable-paging-and-sorting.html].
    That said, in the future please do not resurrect old topics. Start your own topic for each independent problem. If you feel the need, you may always link to any old topic you found in your query.

  • Tag files for rendering JSF components

    Hi people!
         It is possible to render component JSF using Tag-Files? (WEB-INF/tags).
    I am having problems with context, seems that the JSF does not recognize pageContext.
    Ex:
    My Tag-File
    <%@ attribute name="nameproperty" required="true" rtexprvalue="true" %>
    <%@ attribute name="size"           required="true" rtexprvalue="true" %>
    <h:inputText id="${nameproperty}"      size="#{size}" />
    My JSP
    <%@ taglib tagdir="/WEB-INF/tags" prefix="mayTags"%>
    <f:subview id="id001" >
         <myTags:myText propriedade="name_test" size="30" />
    </f:subview>
    In this in case that the size always is empty, because it does not recognize the target pageContext, but if I to place the size in the target of request already recognizes.
    EX:
    <%@ attribute name="nameproperty"      required="true" rtexprvalue="true" %>
    <%@ attribute name="size"           required="true" rtexprvalue="true" %>
    <c:set var"size" value="${size}" scope="request" >
    <h:inputText id="${nameproperty}"      size="#{size}" />
    In part it decides my problem, but it causes another error, is that if in my JSP it will have two fields (this is more than common) calling tag-file, there the size placed in request is always of it I finish field.
    Ex:
    <%@ taglib tagdir="/WEB-INF/tags" prefix="mayTags"%>
    <f:subview id="paisMan" >
         <myTags:myText propriedade="name_test" size="30" />
         <myTags:myText propriedade="name_test_2" size="70" />
    </f:subview>
    In this case all the two inputText would have size 70.
    It has some thing that I can make to solve this problem?
    Thanks for any help.
    Pedro Neves - Brazil

    You are right in saying that decoding has nothing to
    do with rendering per se.I will go even further than Erik did, and dispute this statement.
    Consider that you are generating an <input> tag for a text field. Among other things, you have to generate a "name" attribute. Who decides what to put there? The renderer that actually created the markup.
    The "renderer" really does
    two completely different things. But both should
    nevertheless be separate from the component
    implementation itself. You could still have the
    renderer doing the decoding part, which arguably would
    rarely change, and somehow delegate the actual
    rendering to an implementation in a tag file.Whether you implement decoding in a separate class or inside the component, what request parameter name do you look for? It is not reasonable to assume that ALL possible renderers will choose the same parameter name ... hence, decoding and encoding are inextricably linked (the code doing the decoding has to know what kind of markup the code doing the encoding actually created). In JavaServer Faces, the current APIs create that linkage by requiring that the decode and encode be done by the same class (either the component, if you are not delegating, or the renderer if you are).
    Craig

  • I do not have Microsoft office and to know if I can still open docx files - error message reads corrupt files.  Is there a reliable converter out there?

    I do not have Microsoft office and want to know if I can still open docx files - error message reads corrupt files.  Is there a reliable converter out there?  I am a new mac user.

    Install the free LibreOffice and save a bundle not having to pay MS. http://www.libreoffice.org/

  • Facelets and jsf-extensions problem.

    I'm fairly certain I've run into a problem between facelets and jsf-extensions. I'm working with JSF 1.2 RI, Woodstock, Facelets 1.1.13, on Tomcat 6.
    When trying to get Woodstock autoValidation to work I get a javascript error the "I has no properties". The error occurs in the com_sun_faces_ajax.js file in the jsf-extensions-dynamic-faces-0.1.jar (I've used both the RC4 and a build today ,10/18/07 from source with the same results). Here is the code snippet where it happens (with my comment).
    var I = G.getElementsByTagName("components")[0];
    var C = I.getElementsByTagName("render");
    for(var F = 0; F < C.length; F++) {
    In the second line there it looks like the variable I is null, but based on the post response below I don't know why.
    The response from the post looks like this:
    <partial-response><components><render id="PayableForm:vendorGci"><markup><![CDATA[{"valid":true,"id":"PayableForm:vendorGci"}]]></markup></render></components>
    However the server side code (validation method) never gets executed. I'm willing to do some digging and debug work, but I'd need to be pointed in the right direction.
    The following is more potentially useful code snippets.
    Here is the textField code:
    <w:form id="PayableForm">
    <w:textField style="display:none;" />
    <w:message for="vendorGci" />
    <w:label id="vendorGciLabel" for="vendorGci" text="Vendor: " />
    <w:textField id="vendorGci" autoValidate="true"
    text="${vendorBean.searchGci}" maxlength="8" required="true"
    validatorExpression="#{ vendorBean.validateVendor}" />
    Here is the javascript in the page (the init function is called from the body: onLoad="setTimeout('init();', 0);" , this does happen):
    <w:script type="text/javascript">
    function VendorListener(){
    function VendorNotify(props){
    alert("VendorNotify called!"); <--------------- I never see this alert message
    if ( props.id != "PayableForm:vendorGci") { return; }
    var field = document.getElementById("PayableForm:vendorGciLabel");
    field.setProps({
    valid: props.valid
    VendorListener.prototype.notify = VendorNotify;
    function initAccountRows(){
    var table = document.getElementById("PayableForm:vendorAccountTable");
    table.initAllRows();
    function init(){
    initAccountRows();
    var listener = new VendorListener();
    dojo.subscribe(
    webui.suntheme.widget.textField.event.validation.endTopic ,
    listener, listener.notify);
    Here is the validator method. It currently doesn't do anything, just trying to get something to work. I never see the output, and I never hit the breakpoint in the method.
    public void validateVendor(FacesContext context, UIComponent comp, Object value){
    System.out.println("**********************************");
    System.out.println("validateVendor called");
    System.out.println(value);
    System.out.println("**********************************");
    }

    Actually I don't need a global variable. I need to refer in my included template the actual backing bean used in the current page. As all my backing bean extends a abstract class I could bind my component to a property of the current backing bean, no matters which one. Just like a polymorphic call but without the parameter. Let's imagine I could get this object of the facesContext object I would be able to do:
    <rich:datascroller renderIfSinglePage="false" align="right" for="listagem" maxPages="12" fastStep="10"
    pageIndexVar="pageIndex" pagesVar="pages" stepControls="show" fastControls="hide" boundaryControls="show"
    inactiveStyleClass="paginacaoInativa" selectedStyleClass="paginacaoSelecionada"
    styleClass="paginacao" tableStyleClass="paginacaoTabela"
    binding="#{facesContext.currentBackingbean.formDataScroller}" id="paginacao">
    Instead of pass the backing bean to the ui:param of this template... Dou you get the point?

  • Jsf newbie :: converter and navigation issues

    Hi,
    Iam facing a problem in my first jsf application.
    Iam using jsf 1.1 and tomcat 5.5.7
    I have a UserBean with a single attribute userName (which has public getter and setter methods).
    * I have an index.jsp that redirects to login.faces.
    * I have the appropriate servlet url-mapping in my web.xml that maps *.faces to the FacesServlet
    Here's the code for login.jsp
    <f:view>
       <h:form>
             <h3>Please enter your name </h3>
         <table>
          <tr>
              <td>Name:</td>
            <td><h:inputText id = "name" value="#{user.userName}"/></td>
         </tr>               
         </table>
         <p><h:commandButton value="Login" action="welcome"/>
         </p>
         </h:form>
       </body>
    </f:view>Next I have a welcome.jsp which simply outputs Hello <userName>
    <f:view>
      <h:form>
         <h:outputText value="#{user.userName}"></h:outputText>
      </h:form>
    </f:view>And this is my faces-config.xml
    <?xml version="1.0"?>
    <!DOCTYPE faces-config PUBLIC
      "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
      "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config>
         <managed-bean>
              <managed-bean-name>user</managed-bean-name>
              <managed-bean-class>com.myjsf.UserBean</managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
         </managed-bean>
         <navigation-rule>
              <from-view-id>/index.jsp</from-view-id>
              <navigation-case>
                   <from-outcome>welcome</from-outcome>
                   <to-view-id>/welcome.jsp</to-view-id>
              </navigation-case>
         </navigation-rule>
    </faces-config>Now when I start my application , the index page redirects me to login.faces. I believe the FacesServlet intercepts this call, strips of .faces and forwards to login.jsp. Login.jsp is displayed correctly, so far so good. However from here on, I have all kinds of problems
    1. Should the <from-view-id> be /index.jsp (my actual url) or /login.jsp (the url to which index.jsp forwards me to). Actually both seem to work (or not work depending on how you look at it :( )
    2. Anyways whatever I set it to, the login.jsp is displayed correctly. The action attribute of the commandButton tag is set to 'welcome' which matches with the <from-outcome> value in navigation rule in faces-config.xml and I would have expected the welcome.jsp to load on form submit.
    But the form just reloads itself on clicking submit.
    I googled around and discovered that this may be due to validation errors or conversion errors and adding <h:messages/> would indicate the error source. AQccordingly I added it and got this o/p
    " "name": " Conversion Error setting value 'Duke' for 'null Converter'. To cut a long agony story short, I found that I have to define a converter for some data types for validation and/or display. But all I have is a String property. Doesnt jsf provide a default Converter ?
    3. I couldnt get my app to work when I put my jsps in a folder and access them as /<foldername>/jsp in my faces-config.xml. Isnt this possible ? Should all jsps be under the root folder ?
    Will be thankful for any help.
    cheers,
    ram.
    2. Whenever I click on

    Thanks for the reference , I shall definitely go through it.
    My immediate concern is to get the first program working.
    Here is my source code for the bean.
    package com.myjsf;
    import java.io.Serializable;
    public class UserBean implements Serializable {
        private String userName;  
        public String getUserName() {
            return userName;
        public void setName(String userName) {
            this.userName = userName;
    }Here's my login.jsp which comes up fine
    <f:view>
       <h:form>
         <h:messages/>
             <h3>Please enter your name.</h3>               
                 Name: <h:inputText id = "userName" value="#{user.userName}"/><br>
                  <h:commandButton value="Login" action="welcome"/>
         </h:form>
      </f:view>Here's my faces-config.xml
    <faces-config>
         <managed-bean>
              <managed-bean-name>user</managed-bean-name>
              <managed-bean-class>com.myjsf.UserBean</managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
         </managed-bean>
         <navigation-rule>
              <from-view-id>/login.jsp</from-view-id>
              <navigation-case>
                   <from-outcome>welcome</from-outcome>
                   <to-view-id>/welcome.jsp</to-view-id>
              </navigation-case>
         </navigation-rule>
    </faces-config>     And this is the error that I get
    "userName": Conversion error occurred. The page gets displayed again. One thing I noticed was that in the html - view source the action attribute of the form tag is set to /myjsf/faces/login.jsp. Shouldnt it be welcome.jsp rather ?
    Iam at my wits end. I have decided to write a Converter which may solve my problem, but is it required ?
    Please help.
    Thanks,
    Ram.

  • Oc4j 9.0.4/10g R1 and JSF

    Hi,
    I'm having serious problems with the OC4J container 9.0.4 and JSF. I have tried several sample applications in addition to the one that I have created myself, but none of them will work in the 9.0.4 release of OC4J, even though they all work in R3 EA release, as well as in tomcat 4.x.
    In order for oc4j to compile jsp, I have added the following to server.xml:
    <java-compiler name="javac" in-process="false" encoding="ISO8859_1" bindir="c:\APPS\Java\j2sdk1.4.2_09\bin" extdirs="c:\APPS\Java\j2sdk1.4.2_09\lib\ext" />
    After doing this the example jsp files that comes with oc4j works.
    However, when trying to access my own application I get the following errors in global-application.log:
    05/10/04 10:22:03 web-0.1: jsp: init
    05/10/04 10:22:03 web-0.1: SpringContextServlet: init
    05/10/04 10:22:03 web-0.1: Loading Spring root WebApplicationContext
    05/10/04 10:22:03 web-0.1: Error initializing servlet
    java.lang.IllegalStateException: No Factories configured for this Application - typically this is because a context listener is not setup in your web.xml.
    A typical config looks like this;
    <listener>
    <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
    </listener>
         at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:84)
         at javax.faces.webapp.FacesServlet.init(FacesServlet.java:73)
         at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2094)
         at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4523)
         at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4617)
         at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:765)
         at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:497)
         at com.evermind.server.Application.getHttpApplication(Application.java:886)
         at com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:688)
         at com.evermind.server.http.HttpSite.getApplication(HttpSite.java:420)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:422)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Unknown Source)
    05/10/04 10:22:03 web-0.1: Error preloading servlet
    javax.servlet.ServletException: Error initializing servlet
         at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4574)
         at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4617)
         at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:765)
         at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:497)
         at com.evermind.server.Application.getHttpApplication(Application.java:886)
         at com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:688)
         at com.evermind.server.http.HttpSite.getApplication(HttpSite.java:420)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:422)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Unknown Source)
    I found an advice to not load the servlets on startup, but this does not help.
    Does anyone know what might be wrong here? Is there a bug in 9.0.4 since everything works fine in the latest release?

    This should not really work -- there is NO JMX support in 9.0.3.
    In addition to providing the JMX MBeanServer runtime and JSR77 objects, we needed to also instrument a bunch of our runtime classes so they can work with JMX. Copying over the JMX libs and the console libs won't really get you what you need.
    The earliest you may see some form of JMX is 9.0.4 -- and this is a completely unsupported (and incomplete and in fact hidden .... ) feature in that release.
    Our first official release which will provide visible JMX support is 10.0.3.
    Copying over JAR files like this from different versions is not a supported operation. Interesting from a learning perspective for sure ;-) -- but certainly something that support will baulk at if you ever call them about it.
    cheers
    -steve-

  • SJSAS 9 and JSF - session expiration

    Hi
    I'm developing JSF (1.2) application. I'm using SJSAS 9, EJB 3.0 and toplink. My problem is session expiration. When user session expires and then user click for example on Save button on JSF form, application goes to login page, but after login user receive Internal server Error screen. As I see, session expires but after login, POST request is resend but all related objects don't exist any more (NullPointerException occurs in prerender method). Currently I'm redirecting to main page using following code:
    public static ExternalContext getExternalContext() {
            return FacesContext.getCurrentInstance().getExternalContext();
    getExternalContext().redirect(MAINPAGESTR);
    ...in try catch block ,in prerender method (JSF). Does anybody knows what should I do?

    Have you tried to set a servlet filter to catch the error and build a nicer page?
    If you can tell me how to set up a short session expiration time on Tomcat,
    I can do the tests.
    I am interrested in this issue as I will have to solve it for a project in the
    next 2 weeks.

  • Log4j and jsf

    I added log4j in my application. It is working and I can see my log.debug statements in the console. The problem is that I can see more than I want. My application uses jsf and Tomcat and I see many jsf debugs and I do not know what to change in my log4j.properties so as not to view them. My log4j.properties is the following:
    log4j.rootLogger=debugLog, stdout
    # CONSOLE appender
    log4j.appender.stdout=org.apache.log4j.ConsoleAppender
    log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
    log4j.appender.stdout.layout.ConversionPattern=%d{HH:mm:ss} %-5p %m%n
    log4j.appender.debugLog=org.apache.log4j.DailyRollingFileAppender
    log4j.appender.debugLog.Threshold=debug
    log4j.appender.debugLog.layout=org.apache.log4j.PatternLayout
    log4j.category.com.corejsf = debugLog
    I tried to add something like the following
    log4j.category.com.sun.faces = WARN
    log4j.additivity.com.sun.faces=falsebut nothing changed.Any suggestions??

    This is a log4j properties file problem. I'm not used to using the .properties file notation. I'm used to the XML notation for log4j.
    Here's how I'd do it in XML:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
    <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>
            <!--
                    Set up the appender
            -->
            <appender name="Appender" class="org.apache.log4j.ConsoleAppender">
                    <param name="Append" value="true"/>
                    <layout class="org.apache.log4j.PatternLayout">
                            <param name="ConversionPattern" value="%d{HH:mm:ss} %-5p %m%n"/>
                    </layout>
            </appender>
            <logger name="my.java.package" additivity="false">
                    <level value="debug" />
                    <appender-ref ref="Appender" />
            </logger>
            <logger name="another.package.for.debug.level" additivity="false">
                    <level value="debug" />
                    <appender-ref ref="Appender" />
            </logger>
            <!--
                    Omitting the JSF package altogether should remove the undesired
                    DEBUG messages from it. However, if not, uncomment the following
                    lines.
            -->
            <!-- <logger name="javax.faces" additivity="false">
                    <level value="INFO" />
                    <appender-ref ref="Appender" />
            </logger> -->
            <root>
               <priority value ="debug" />
               <appender-ref ref="Appender" />
            </root>
    </log4j:configuration>This example will print to console only. If you want to print to a file instead, use the following lines (replaces the appender tags from the above example).
            <appender name="Appender" class="org.apache.log4j.DailyRollingFileAppender">
                    <param name="File" value="filePath/FileName.log"/>
                    <param name="DatePattern" value="'.'yyy-MM-dd"/>
                    <param name="Append" value="true"/>
                    <layout class="org.apache.log4j.PatternLayout">
                            <param name="ConversionPattern" value="%d{HH:mm:ss} %-5p %m%n"/>
                    </layout>
            </appender>I don't know how you'd get both the console and the file appender working at the same time.
    If you want further advice, or If you want advice on the .properties method of doing things, I suggest finding a log4j forum. The people there will undoubtedly have more experience and knowledge than us JSF nerds. =)
    I assure you though, JSF is compatible with log4j. The log4j properties file just needs to be set up properly (more challenging than it should be, if you ask me).
    CowKing

  • 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*
    :(

  • How to integrate Single Sign-On and JSF?

    Hi all,
    We are going to develop a web application using Oracle technologies, including ADF and JSF.
    But we´ll need to secure our website using Oracle Identity Manager (Single Sign-On). I am having difficulties to find any resource explaining how to do that.
    Also, the IM (SSO) will run on a Oracle AS instance and our web app (ADF+JSF) will run on a separete OC4J instance, due to ADF version. Is this a problem?
    Thanks

    We too are in the process of implementing iStore with SSO features.
    And if you believe me it seems to me as nightmare.
    In our scenerio we are intgrating this SSO with Third party access control too (AD and Siteminder). I would request you to please respond me on the following mail id , so we can share our experince which will help us in our implementation
    [email protected]
    regards and thanks in advance
    Vikas Deep

  • What's the difference between jsp and jsf?

    who can tell me what's the difference between jsp and jsf?
    I'm puzzled when I found some of the technology in jsp is so similar to the ones in jsp( javaserver page)

    Hi,
    Find the difference between JSP and JSF
    1. A developer has more control with JSP, but (should) get easier development with JSF
    2. Event handling is done differently in JSP (HTTP) and JSF (Java)
    3. The UI is designed differently (or should be at least) with JSP (markup) and JSF (components).
    4. The end product should also be defined differently - JSP page versus a JSF application.
    Is this the only thing that is need to make a decision for either or? Probably not. There are other pieces that need to be taken in account when deciding which technology to use - tools support, enough components, type of application etc.... At this point there are not enough JSF components (although there are some interesting projects underway - Ajaxfaces, Myfaces, ADF Faces, and WebChart 3d) and enterprise tools support is still limited to a few tools vendor. Looking at our ADF Faces components they are currently available as early access (not production) and demands for these components are stacking up, literally, outside my office doorstep. Although I would love to make them production - now! - it is not a viable solution since we are still checking features and fixing critical bugs.
    All this combined - not enough enterprise level components in production, lacking tools support etc... - leave customers in a vacuum where the decision is either to continue with JSP, since it is mature and has a wide developer base, or move forward with JSF not sure if the support, or the developers will be there. This is particularly sensitive to customers that need to get started now and be production by summer.
    If you are in this vacuum here are some key points promoting JSF:
    1. Fundamental unit is the Component
    2. Built in event and state management
    3. Component sets can be provided by any vendor
    4. Closer to ASP.Net or Swing development
    5. Choice of UI technology
    6. Scale up (rich clients)
    7. Scale down (mobile devices)
    8. Built into J2EE containers in J2EE 5.0 (tentative)

  • 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, 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

Maybe you are looking for

  • Grid cell displaying 1 when value is 0

    Why is it that grid column cells sometimes display 1 when the value in the cell is actually 0? Here is the scenario - I have a column in my grid with the following definition: AttributeInfo SalesDollarsMasterCol = new AttributeInfo(java.sql.Types.NUM

  • Importing Entire Colour Palettes into Swatch Library?

    Hello there folks, Nice to meet you all, my first post here. I'm a very basic user of InDesign 5 and know enough to enable me to achieve the very rudimentary goals that I need InDesign for.  Could someone please tell me how to import/load an entire s

  • Enhancement for FPP3  tcode

    Hi , I need to add a field in the tcode FPP3 (business partner dispaly) , in the second screen , can any one tell me the Screen exit name .. which is used for this? Thanks in advance, Swetha.

  • Flash CS6 How to set up pages for an animated app/book for children

    Hi there, I'm quite experienced with flash/ middle ground in AS3 for flash player, but would like now to make apps using AIR. I have two questions: 1 - Could anyone tell me how to create pages for an animated book (such as Alice on the ipad, etc)?  •

  • Getting  "unknown source" when creating new applicatoin

    Hi, Any idea why am I getting an error message "unknown source" everytime I create a new application? The past two days I reran "Configure Database " , "Deploy to App Server" , "Product Instance Registration", "Data Source Configure" , create new app