Question on JSF/JSP mixing issue

Hello all.
We have an JSP application which we are trying to move to JSP. After some thought we decided that these will need to coexist in some parts of the code. Now I have run into an issue as result of these and I am wondering if anyone can help. In the below example, we are tyrig to gather some table entries from a legacy object and trying to populate another JSF type bean with the same entry. Can this be accomplished using some kind of code like this with a commandLink and a param. The problem is the param is not working for me, it is showing up as null object in backendbean2. Any ideas?
My code is structured like this :
<h:form>
// JSP code here
<%
sname = Backend1.getSname();
%>
// Some entries from a table are output here. Each entry is a link and
// clicking on each entry should open up a screen corresponding to sname
// Note that our backend bean is legacy stuff and cannot be changed to
// return a datatype compatible with Datatable. hence we are using html table
<table>
<tr> Name </tr>
<td>
<h:commandLink action="#{backendbean2.processClick}" >
<f:verbatim> <% out.println(sName); %>
<f:param name="name" value="#{backendbean2.sName}>
</h:commandLink>
</h:form>

Please read the following article.
http://www.onjava.com/pub/a/onjava/2004/06/09/jsf.html
Best practice will be to avoid mixing JSP and JSF

Similar Messages

  • Session in JSF JSP page

    Hi All,
    I am using JSF JSP pages. One such page is login.jsp I have backing object backing_login
    On successful login, listUser.jsp page is displayed. In this page, I have a HTML --- Commons Hyperlink component as follows.
      <tr>
                  <td height="17">
                    <a href="http://129.212.139.36:8991/GeminiLogin-ViewController-context-root/faces/listUsers.jsp">
                      Manage Users
                    </a>
                    <afh:script binding="#{backing_createModify.script1}"
                                id="script1"/>
                  </td>
                </tr>
    Now the question:---
    I do get to know the UserType in the backing_login object (either 'cma' or 'ea').
    Now, if it is cma I want the above link tobe dispalyed in listUser.jsp else DO NOT display the link.
    How can I do that ? I dont know, how to pass UserType information available in baking_login to the listUser.jsp and
    second, how can conditionally use that info to either hide or display that hyperlink ?
    Your help appreaciated.
    thanks in advance
    pp

    You can use an ADF Faces link component and condition the display attribute for it on the value of your backing bean
    There are some samples of conditional display in the posts from Grant here:
    http://groundside.com/blog/GrantRonald.php?m=200512

  • OLite compile JSF JSP error

    I'm using Olite 10g. I created a JSF JSP in JDeveloper and compiled and tested in. I packaged the web application into a WAR file and expaned it into the OLite webtogo root. When I use the package wizard to publish the web application, the JSF JSP fails to compile with this message:
    oracle.jsp.parse.JspParseException: Line # 4, <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    The JSP lines look like this:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page contentType="text/html;charset=windows-1252"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    Does anyone have any thoughts as to how to resolve this issue?
    Thank-you.

    Here is a bit more with respect to the package wizard output message:
    C:\oacle\Olite10g\Mobile\Sdk\wtgsdk\root\maintab\_pages
    Created Directory _pages : false
    These are the jspc arguments: -appRoot C:\oacle\Olite10g\Mobile\Sdk\wtgsdk\root\maintab\ -d C:\oacle\Olite10g\Mobile\Sdk\wtgsdk\root\maintab\_pages -packageName maintab -srcdir C:\oacle\Olite10g\Mobile\Sdk\wtgsdk\root\maintab\pages -verbose -addclasspath C:\oacle\Olite10g\Mobile\Sdk\wtgsdk\root\maintab\WEB-INF\classes;C:\oacle\Olite10g\Mobile\Sdk\wtgsdk\root\maintab\WEB-INF\lib\commons-beanutils.jar;C:\oacle\Olite10g\Mobile\Sdk\wtgsdk\root\maintab\WEB-INF\lib\commons-collections.jar;C:\oacle\Olite10g\Mobile\Sdk\wtgsdk\root\maintab\WEB-INF\lib\commons-digester.jar;C:\oacle\Olite10g\Mobile\Sdk\wtgsdk\root\maintab\WEB-INF\lib\commons-logging-api.jar;C:\oacle\Olite10g\Mobile\Sdk\wtgsdk\root\maintab\WEB-INF\lib\commons-logging.jar;C:\oacle\Olite10g\Mobile\Sdk\wtgsdk\root\maintab\WEB-INF\lib\jsf-api.jar;C:\oacle\Olite10g\Mobile\Sdk\wtgsdk\root\maintab\WEB-INF\lib\jsf-impl.jar;C:\oacle\Olite10g\Mobile\Sdk\wtgsdk\root\maintab\WEB-INF\lib\jstl.jar C:\oacle\Olite10g\Mobile\Sdk\wtgsdk\root\maintab\login.jsp C:\oacle\Olite10g\Mobile\Sdk\wtgsdk\root\maintab\maintab.jsp C:\oacle\Olite10g\Mobile\Sdk\wtgsdk\root\maintab\index.jsp
    Translating file: C:\oacle\Olite10g\Mobile\Sdk\wtgsdk\root\maintab\login.jsp
    Translating file: C:\oacle\Olite10g\Mobile\Sdk\wtgsdk\root\maintab\login.jsp
    Parse error in login.jsp:
    oracle.jsp.parse.JspParseException: Line # 4, <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    Error: java.io.FileNotFoundException: C:\oacle\Olite10g\Mobile\Sdk\wtgsdk\root\maintab\http:\java.sun.com\jsf\html (The filename, directory name, or volume label syntax is incorrect)
    ...

  • JSF JSP : Graph Component is always rendered.

    On my JSF Jsp page i am displaying the Grpah.Now the issue i am facing is if i have one chart and one table in one form , the form is always displayed first then table even if the table is drawn first in design time. IS there any way to Hide the graph Because this component does not have the rendered property.
    I want to render the graph conditionaly.Also Is it possible to change the graph type dynamically ie on selection of any radio button. I can get the handle of button in my Backing Bean.
    I tried to put the graph in Form PanelBorder as well as in table and set the rendered property to false but still the graph is showing.
    Please help us....Pleas point us to some sample examples where thsi kind of scnario is done.
    Thanks

    Thanks Frank. It worked. Can we change the graph type dynamically....Like if it is Pie chart and we want change it to Line chart Dynamically on click of any button.Because i can see only the VO association in my jsp page.
    This is very critical requirement for us.
    Thanks
    Anshu

  • Oracle portal using JSF, JSP, Struts framework

    Hi ,
    Can anyone tell me how to build an oracle portal using JSF,Jsp and Struts Framework.
    Also please provide any manual or documentation for developing oracle portal.
    Thanks in Advance,
    Raghav

    At present, i think the best thing to do is to look at the example provided with the struts-faces integration taglib. I don't know any documentation about it.
    http://cvs.apache.org/builds/jakarta-struts/nightly/struts-faces/

  • JSF & JSP

    DEAR SIR/MADAM,
    can u tell me what is major difference between jsf & jsp?
    because i need to planning develop web application.
    which is a best for design/deploy/performance.
    i don't know how to choose which one ?
    best regards
    boris

    DEAR SIR/MADAM,
    can u tell me what is major difference between jsf &
    jsp?
    because i need to planning develop web application.
    which is a best for design/deploy/performance.
    i don't know how to choose which one ?JSP is a page description language that enables you to hook up server side java code to the request/response lifecycle of a web page. JSP has an extension facility, called "custom tag libraries", that allows one to write java classes that get exposed to the page author as HTML tags.
    JSF uses the JSP custom tag libraries feature to provide HTML tags that represent UI components which page authors can include in their pages. In addition, JSF many features that go far beyond JSP, such as page navigation and better back end integration.
    Ed

  • Create jsf jsp page / page implementation / third option is not visible

    The third option (check box) for page implementation settings in the create jsf jsp page is not visible. The window is not resizable.

    I see the option radio button and text "Automatically Expose UI Components in an Existing Managed Bean" that is disabled but i see only partially the label what is a disabled input text field i suppose just below the radio button.
    I see also the Directory input field and Browse button a little bit truncated at the bottom (1-2 pixels missing).
    I see also the Render in Mobile Device check box and combo box ... cutted by the half when i expand the page implementation part.
    As said the window is not resizable.
    Let me know a location i can send you a hard copy of the screen.

  • 'session' is undefined - javascript error in my JSF/JSP page

    I have the following JSF/JSP page. In onLoad() I invoke a javascript function func(). In this method, I attempt to lookup an attribute from the Http Session. When I run my application, my page is loaded with but the icon on the lower left corner of the browser indicated that there was an error. When I viewed the error, it read : 'session' is undefined.
    The 'session' variable is available in a JSP page.
    So why does my code not work from within a JSF application.
    <?xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:ui="http://www.sun.com/web/ui">
        <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>   
        <f:view>
            <ui:page binding="#{bean.page1}" id="page1">
                <ui:html binding="#{bean.html1}" id="html1">
                    <ui:head binding="#{bean.head1}" id="head1">
                        </ui:head>
                    <ui:body binding="#{bean.body1}" onLoad="func()" id="body1" style="-rave-layout: grid">
                        <ui:form binding="#{bean.form1}" id="form1">                       
                            <h:inputText binding="#{bean.inputText}" id="inputText"/>
                        </ui:form>
                    </ui:body>
                </ui:html>
            </ui:page>
        </f:view>
        <script type="text/javascript">
            function func(){                  
                    alert("in func()");
                    var y = session.getAttribute("test");
                    alert(y);
        </script>
    </jsp:root>thanks,
    tsc

    Because :
    Session.getAtrribute is java-code that can only run on the server
    and
    var y = session.getAttribute is javascript-code run on the client.

  • Error when compiling JSF JSP

    I'm getting the following error when I try to compile an application containing a JSF JSP in JDeveloper 10.1.3. The error is:
    Error: java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TagAttributeInfo.<init>(Ljava/lang/String;ZLjava/lang/String;ZZ)V
    I've checked the files in the classpath and the TagAttributeInfo class is located in <install>/j2ee/home/lib/servlet.jar. I decompiled the class and it does have a constructor that takes (String, boolean, String, boolean, boolean).
    The only change I made between when things worked and now is that I tried to add a JSF JSP that used the ADF classes. But once I started getting this compilation error, I removed the ADF classes from the project, so they shouldn't be causing any problems anymore.
    Any ideas what's wrong?
    Thanks

    Hello,
    May be that your classpath doesn't include that location ?
    Have you tried to put the TagAttributeInfo.class file into your current folder
    (or may be in ..\<your_project>\Classes\.. path ) ?
    To check if your classpath does actually include your path, you could run:
    <%@ page contentType="text/html;charset=windows-1252"%>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>Dummy JSP-CLASSPATH</title>
    </head>
    <body>
    <%
    out.println("<h1><em>JSP Showing your CLASSPATH</h1></em>");
    out.println("<hr></hr><p>");
    out.println(System.getProperty("java.class.path"));
    %>
    </body>
    </html>
    Hope this will help you.
    Stephan

  • Strategy for integrating JSF/JSP with EJB?

    Both JSF/JSP and EJB seem to be developing independently of each other. What is a good strategy for integrating them? I'm not sure how access my entity/session beans from my web pages.

    Follow the MVC architecture. Don't access EJB's from JSF/JSP pages. Here are some basic rules to follow.
    1) never put java code in JSP's. JSP's are for viewing data only. They should never contain business logic nor be tied to the business tier.
    2) JSP's should always send HTTP requests to servlets. Use the servlets to control the flow of the application and make decisions on which JSP should be returned to the client. Make calls to the EJB's from the servlet to perform business logic.

  • Methodaology to use a commom JSF/JSP page for both PDA and PC Browser

    hello,
    I am planing to write an application that should work on both PDA(Windows CE 4.2 Client) and PC(Desktop).I choosed JSF as it supports Rendering.Is there any methodology so that i can use a common JSF/JSP for both the client.
    As the PDA browser space constrint i can not use the same page for both.
    One way as i know is Conditional Component display whre there are ceparate components for PDA & PC ..But i need a methadology where in i can use same component for both PDA & PC .
    I came to know about the XML rendering capability of JSF can this be used?..
    can anybody please hep me in this regard.
    thanks & regards
    ullas kumar

    Firefox Mobile sends "Android" in its browser identification. If the site is checking for that, then you should get a mobile page. If the site requires more, e.g., Chrome, Webkit, or some other text, then that's a problem because Firefox doesn't use those terms. With server-based redirection, you cannot see what the site is checking for.
    For testing, or to work around sites not knowing about Firefox Mobile, you could try the Phony extension: https://addons.mozilla.org/en-us/mobile/addon/phony/

  • JSF JSP Bug

    The JSF JSP Wizard has a bug.
    1. Select File>New>Web Tier>JSF>JSF JSP.
    2. Click on Next. Specify file anme. Click on Next.
    3. Automatically Expose UI Compoenents in a Existing Managed Bean radio button does not get selected.

    A managed bean is the same as a backing bean except that the managed bean is managed by the JSF framework.
    http://groundside.com/blog/DuncanMills.php?title=so_what_is_a_backing_bean&more=1&c=1&tb=1&pb=1
    If a managed bean with a page binding is defined, the Automatically Expose UI Components in an Existing Managed Bean button does not become selectable.
    The Automatically Expose UI Components in an Existing Managed Bean button should be selectable to check which managed beans have already been created.

  • How to show a PDF with a JSF jsp.

    Hello,
    I want to show a PDF in a JSF jsp.
    I'm a newbie with this, and don't know where to look for information about that.
    Any example on the web ?
    Thanks in advance

    I think you will need to eventually get it to the HTML <object> tag anyway.
    <OBJECT data="yourPDFhere.pdf" type="????""/>
    and to get the byte[] to the client you may need to make a Servlet to respond to *.pdf requests and feed the correct session 'in memory' pdf out the stream.
    Here is an example from some svg 'in memory' per session I was testing:
    * SessionServlet.java
    * Created on June 3, 2004, 12:09 AM
    package com.hypernex.xml.svg;
    import java.io.*;
    import java.net.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    * @author  Roger I Martin, PhD
    * @version
    public class SessionServlet extends HttpServlet
        /** Initializes the servlet.
        public void init(ServletConfig config) throws ServletException
            super.init(config);
        /** Destroys the servlet.
        public void destroy()
        /** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
         * @param request servlet request
         * @param response servlet response
        protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException
            ServletContext context=getServletContext();
            java.util.Enumeration e=context.getServlets();
            while(e.hasMoreElements())
                System.out.println("servlets \t"+e.nextElement());
            /*e=context.getAttributeNames();
            while(e.hasMoreElements())
                System.out.println("AttributeNames \t"+e.nextElement());
            e=request.getParameterNames();
            while(e.hasMoreElements())
                System.out.println("ParameterNames \t"+e.nextElement());
            System.out.println("getContextPath "+request.getContextPath());
            System.out.println("getRequestURI"+request.getRequestURI());
            response.setContentType("text/xml+svg");
            PrintWriter out = response.getWriter();
            HttpSession httpSession=request.getSession();
            System.out.println("getQueryString"+httpSession);
            if(httpSession!=null && request.getRequestURI().endsWith("wafermap.svg"))
                /*e=httpSession.getAttributeNames();
                while(e.hasMoreElements())
                    System.out.println("httpSession AttributeNames \t"+e.nextElement());
                SVGProducer svgProducer=(SVGProducer)httpSession.getAttribute("waferMap");
                out.print(svgProducer.getSVGView());
            else if(httpSession!=null && request.getRequestURI().endsWith("hardware.svg"))
                SVGProducer svgProducer=(SVGProducer)httpSession.getAttribute("hardwareBean");
                out.print(svgProducer.getSVGView());
            else if(httpSession!=null && request.getRequestURI().endsWith("geometry.svg"))
                SVGProducer svgProducer=(SVGProducer)httpSession.getAttribute("geometryBean");
                out.print(svgProducer.getSVGView());
            else
                try
                    java.io.BufferedReader br=new java.io.BufferedReader(new java.io.FileReader("./webapps"+request.getRequestURI()));
                    String line=null;
                    while((line=br.readLine())!=null)
                        out.println(line);
                    br.close();
                catch(java.io.IOException ioe)
                    System.out.println("ioe:"+ioe.getMessage());
            out.close();
        /** Handles the HTTP <code>GET</code> method.
         * @param request servlet request
         * @param response servlet response
        protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException
            processRequest(request, response);
        /** Handles the HTTP <code>POST</code> method.
         * @param request servlet request
         * @param response servlet response
        protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException
            processRequest(request, response);
        /** Returns a short description of the servlet.
        public String getServletInfo()
            return "SVG graphics handler";
    }

  • Beginner question regarding 32-bit mixing and mixdown workflow

    Hello
    I have a beginner question regarding 32-bit mixing and mixdown.
    If I edit some 16Bit, 44.1kHz Stereo WAV Files and put them into multi-track view to do crossfades, how should I do the mixdown?
    Audition shows me in multi-track view, that it is doing 32-Bit mixing.
    Can I just mixdown to 16Bit, 44.1kHz Stereo without any dithering (as the files are 16Bit, 44.1kHz Stereo to begin with), or will I lose quality that way?
    I will be performing a normalization to 96% to the mixdown and then split to tracks in Audition, as in the end I want to to have an audio CD.
    I guess I could mixdown to 32Bit, then normalize and in the end save back to 16Bit, 44.1kHz Stereo WAV (with dithering, I suppose?), but I want to avoid any unnecessary converting steps.
    Greetings

    Any time you do any processing on a 16bit file in 16 bit only it will degrade the audio slightly due to rounding of the calculations. Working in 32 bit floating point (Audition's default) takes account of all bits generated due to processing.
    So it is always best to work in 32 bit, even if your originals were 16, all the way through until the last stage of saving the files for CD burning. Any losses due to conversion will be insignificant against those due to working 16 bit.

  • JSP complilation issue (JAVAC message file is broken)

    i am facing a jsp compilation issue with error message JAVAC message file is broken .
    i have one main jsp in which i have one module of about 4000 line of coding.i splitted this file in 4 segments and included them in main jsp. Each segment is included using
    <jsp:include page="Module_ProductsTab_PAOChangeValid_Apply.jsp" flush="true">
    <jsp:param name="adspot" value="dotcom3" />
    <jsp:param name="page" value="ProdTab" />
                             </jsp:include>
    tag , but now it takes as much long time to load that would result in page timeout.
    can anyone give me input how i handle this issue?

    This sounds like a corrupt installation.
    Try uninstalling java and re-installing it. (With 1.4.2_04 if you can)

Maybe you are looking for

  • Display Problem in DW

    Hi Can anyone tell me why this page doesn't display correctly in DW (I'm using CS3 on Win XP). The #wrapper div shifts about 850px to the right and loses most of the contents off the r/hand edge of the screen. It displays correctly in every browser I

  • Converted Library to DNG now what about those other files?

    I've just taken the plunge and converted all my CR2 images to DNG, replacing the originals. However, I still have all the JPEG sidecar files left over. Can I safely delete these, or are they required by the DNG? Also, I was previously using the optio

  • Confused with updates which doesnt work

    Hey everyone! im new here, and well is the first time also i use an ipod... all was cool with my lil new toy but then something hapened and im not really sure whats happening. Well i downlaoded the lastest update for ipod and well i have to fight wit

  • Question:  how to read winmail.dat attachments from others

    Based on a recommendation from an AppleCare rep, I downloaded "TNEF's Enough" so I could read winmail.dat attachments from others.  It won't work and when I called again, I was told AppleCare doesn't support third party apps.  How do I activate it? 

  • Can only access one Mac via Back to my Mac

    I have Back to My Mac set up on my home Mac and two Macs at my office. I can successfully connect to one of the Macs at the office from home, but not the other. Both office Macs are running Mountain Lion, have Back to My Mac enabled with the same iCl