Calling a applet in JSF page

Hello Folks
I am having problem accesing the applet from the web application my applet runs fine if i run it in the IDE.
These are my methods in the bean
public String getApplet() {
          applet = "<applet code=\"applet.PrinterApplet.class\" codebase=\".\" archive=\"SSignedPrinterApplet.jar\" width=\"400\" height=\"400\">"+
          "<PARAM NAME=\"fileName\" VALUE=\"TITLE_12732.pdf\">"+
          "<PARAM NAME=\"basePath\" VALUE=\"<%=basePath%>\">"+
          "</applet>";
          return applet;
          //"<applet code=\"PrinterApplet.class\" width=\"300\" height=\"300\"/>";
     public void setApplet(String applet) {
          this.applet = applet;
here is my jsf call
<h:outputText value="#{activitySummaryBean.applet}" styleClass="labelTextBlack"></h:outputText>
it does not invoke the applet it just displays the text.
<applet code="applet.PrinterApplet.class" codebase="." archive="SSignedPrinterApplet.jar" width="400" height="400"><PARAM NAME="fileName" VALUE="TITLE_12732.pdf"><PARAM NAME="basePath" VALUE="<%=basePath%>"></applet>
I was refering to the link below
http://developers.sun.com/prodtech/javatools/jscreator/reference/techart/2/applet.html?feed=DSC
please let me know your thoughts
Thanks,
Surendra

Hi Surendra,
I had same problem today. After a while i've found the solution:
You have to set the escape attribute of your <h:outputText /> tag to false. Because as default it's set to true and the HTML related character are escaped...
Result will be like this:
<h:outputText value="#{SessionBean.appletHTML}" escape="false" />Good luck,
Vaclav

Similar Messages

  • Can i call signed applet from jsf page in sun studio creator

    Hello javites,
    I want to know whether i can call signed applet from jsf page in sun studio creator. If possible, how do i go about it.
    Thanks.

    This tutorial may help:
    http://developers.sun.com/prodtech/javatools/jscreator/reference/techart/2/applet.html?feed=DSC

  • Method call before visual web jsf page loads

    Hi All.....
    I have written a method in a java class that accesses the mysql backend db to check if a process is still running. If the process is still running, a JOptionPane is produced informing the user of this and offers an <ok> option(to check the process status again) and a <cancel> option(to redirect the user to the homepage). If the process is completed, I want the page to just load as normal. I want this method to be called before the visual web jsf page loads. I have the method call in the super_init() method of the page and everything seemed to be working fine, the problem I have run into is that if I set the value in the db to show the process is running, the JOptionPane is produced(like it should be), and then if I set the value to show the process has completed and choose <ok> from the pane, the page loads.....this is what I want. Now, after the page loads, if I set the value in the db to show the process is running again, the JOptionPane is produced again right after I apply the changes to the db edit!!!!. I don't know why this is happening. Should I be calling the method from somewhere other the super_init()????? I have tried the method call in the prerender(), preprocess(), and destroy() methods all with the same results.
    Anyone have any ideas on what the problem could be??
    Thanks in advance.
    Silgd

    The Java part of a JSP/Servlet based webapplication runs physically at the server machine.
    Only the HTML/CSS/JS part which is generated by the webapplication and sent to the client physically runs at the client machine.
    JOptionPane is a Java Swing component which thus runs at the server machine. So you as client would only see it when both the server and the client runs at physically the same machine. Which is often only the case in development environment and doesn´t occur in real life! There is normally means of two physically different machines connected through the network/internet.
    To solve your actual problem, look for Ajax poll techniques. To display an alert or confirm dialogue in the client side, you use Javascript for this.

  • Adf faces table and applet in jsf page navSubmit not working in IE

    Hi
    I have a jsf page with adf faces table and applet , previous / next navigation is not working for my table when i add the applet to the same page , it is working in firefox but not in IE .
    I have no clue what to change , can any one help. below is the sample code for my jsf page
    Best regards
    Srinivas
    Code follows, not sure how to format the code here
    <h:form>
    <af:panelPage title="Test Adf faces table and applet">
    <af:panelHeader text="Orders">
    <af:table value="#{bindings.Orders.collectionModel}" var="row"
    rows="#{bindings.Orders.rangeSize}"
    first="#{bindings.Orders.rangeStart}"
    emptyText="#{bindings.Orders.viewable ? 'No rows yet.' : 'Access Denied.'}"
    id="orders" >
    <af:column sortProperty="order"
    headerText="#{bindings.Orders.labels.order}">
    <af:commandLink text="#{row.order}"
    id="orderNumber"
    onclick="showOrder(#{row.order})"
    disabled="false"/>
    </af:column>
                   </af:table>
    </af:panelHeader>
    <af:objectSpacer width="10" height="10"/>
    <af:panelBox>
    <f:verbatim>
    <div id="appletDiv">
                        <applet here />
                        </div>
    </f:verbatim>
    </af:panelBox>
    </af:panelHorizontal>
    </af:panelPage>
    </h:form>

    Sorry about the format, it looked okay when i previewed it , now it looks like terrible

  • Action method calls when refreshing the JSF page

    I have a test application which contains a JSF page. The page contains a command button. Button's action attribute is mapped with action method in managed bean.Inside action method I am not doing anything and just redirecting to the same page using navigation-rule configured in faces-config.xml. I deployed the application and tested the page.
    This is what I observed.
    scenario 1:
    ===========
    1) Run the page.
    2) Refresh the page.
    Observation:
    Action method not called.
    scenario 2:
    ===========
    1) Run the page.
    2) Click the command button.
    2) Refresh the page any number of times.
    Observation:
    For each and every time the page is refreshed Action method is called.
    Can anybody tell me why it is happening?

    sk_java wrote:
    I have a test application which contains a JSF page. The page contains a command button. Button's action attribute is mapped with action method in managed bean.Inside action method I am not doing anything and just redirecting to the same page using navigation-rule configured in faces-config.xml. I deployed the application and tested the page.
    This is what I observed.
    scenario 1:
    ===========
    1) Run the page.
    2) Refresh the page.
    Observation:
    Action method not called.
    You get the page using a http get so no action is "configured" to fire...
    scenario 2:
    ===========
    1) Run the page.
    2) Click the command button.
    2) Refresh the page any number of times.
    Observation:
    For each and every time the page is refreshed Action method is called.
    Can anybody tell me why it is happening?Using the command button (the first time) you obtain the view as postback so refreshing the page the browser will redo the last POST that fire again the Action...

  • Call an applet in other page html with javascript

    Hi
    I found many exemples with javascript, to call applet method in the same html page, but never cross pages
    There is a way to call with javascript an applet in other window/page?
    Thanks

    By other WORKSPACE do you mean another location (as defined in dads.conf)?<br><br>Either way, you just have to make the url relative or just hard code the entire path. If location 1 is pls/htmldb and location 2 is pls/htmldb_two then all you need to do is:<br><br>
    owa_util.redirect_url( '/pls/htmldb_two/f?p=TLL:3:&SESSION.::::F119_TAB_CONDITION:1');<br>
    that is if I understood your question correctly...<br><br>
    chet<br>

  • Howto call the @Remove method of a stateful session bean after JSF page ...

    I use EJB3, JPA, JSF in my web application. There are 2 database tables: Teacher and Student. A teacher can have many (or none) students and a student can have at most 1 teacher.
    I have a JSF page to print the teacher info and all his students' info. I don't want to load the students' info eagerly because there's another JSF page I need to display the teacher info only. So I have a stateful session bean to retrieve the teacher info and all his students' info. The persistence context in that stateful session bean has the type of PersistenceContextType.EXTENDED. The reason I choose a stateful session bean and an extended persistence context is that I want to write something like this without facing the lazy initialization exception:
    <h:dataTable value="#{backingBean.teacher.students}" var="student">
        <h:outputText value="${student.name}"/>
    </h:dataTable>Because my session bean is stateful, I have a method with the @Remove annotation. This method is empty because I don't want to persist anything to the database.
    Now, my question is: How can I make the @Remove method of my stateful session bean be called automatically when my JSF page finishes being rendered?

    Philip Petersen wrote:
    I have a few questions concerning the EJB remove method.
    1) What is the purpose of calling the remove method on stateless session
    bean?There isn't one.
    >
    2) What action does the container take when this method is called?It checks that you were allowed to call remove (a security check) and then
    just returns.
    >
    3) What happens to the stateless session bean if you do not call the remove
    method?Nothing
    >
    4) Is it a good practice to call the remove method, or should the remove
    method be avoided in the case of stateless session beans?
    Personally, I never do it.
    -- Rob
    >
    >
    Thanks in advance for any insight that you may provide.
    Phil--
    AVAILABLE NOW!: Building J2EE Applications & BEA WebLogic Server
    by Michael Girdley, Rob Woollen, and Sandra Emerson
    http://learnWebLogic.com
    [att1.html]

  • How to call a struts action from a JSF page

    I am working on a small POC that has to do with struts-faces. I need to know how to call a struts ".do" action from a JSF page..
    Sameer Jaffer

    is it not possible to call a action from the faces submit button and/or the navigation?
    This a simple POC using struts-faces exmaples.
    Here is my struts-config and faces-config file.
    <struts-config>
    <data-sources/>
    <form-beans>
      <form-bean name="GetNameForm" type="demo.GetNameForm"/>
    </form-beans>
    <global-exceptions/>
    <global-forwards>
      <forward name="getName" path="/pages/inputname.jsp"/>
    </global-forwards>
    <action-mappings>
      <action name="GetNameForm" path="/greeting" scope="request" type="demo.GreetingAction">
       <forward name="sayhello" path="/pages/greeting.jsp"/>
      </action>
    </action-mappings>
    <controller>
        <set-property property="inputForward" value="true"/>
        <set-property property="processorClass"
                value="org.apache.struts.faces.application.FacesRequestProcessor"/>
    </controller>
    </struts-config>faces-config
    <faces-config>
    <managed-bean>
      <managed-bean-name>calculate</managed-bean-name>
      <managed-bean-class>com.jsftest.Calculate</managed-bean-class>
      <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    <managed-bean>
      <managed-bean-name>GetNameForm</managed-bean-name>
      <managed-bean-class>demo.GetNameForm</managed-bean-class>
      <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    <navigation-rule>
      <from-view-id>/calculate.jsp</from-view-id>
      <navigation-case>
       <from-outcome>success</from-outcome>
       <to-view-id>/success.jsp</to-view-id>
      </navigation-case>
      <navigation-case>
       <from-outcome>failure</from-outcome>
       <to-view-id>/failure.jsp</to-view-id>
      </navigation-case>
    </navigation-rule>
    <navigation-rule>
      <from-view-id>/inputNameJSF.jsp</from-view-id>
      <navigation-case>
       <to-view-id>/pages/greeting.jsp</to-view-id>
      </navigation-case>
    </navigation-rule>
    </faces-config>in my inputNameJSF.jsp (faces page)
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
    <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
    <%@ taglib prefix="s" uri="http://struts.apache.org/tags-faces" %>
    <!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=ISO-8859-1">
    <title>Say Hello!!</title>
    </head>
    <body>
    Input Name
    <f:view>
         <h:form >
              <h:inputText value="#{GetNameForm.name}" id = "name" />
              <br>
              <h:commandButton id="submit"  action="/greeting.do" value="   Say Hello!   " />
         </h:form>
    </f:view>
    </body>
    </html>I want to be able to call the struts action invoking the Action method in the that returns the name
    package demo;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    public class GreetingAction extends org.apache.struts.action.Action {
        // Global Forwards
        public static final String GLOBAL_FORWARD_getName = "getName";
        // Local Forwards
        private static final String FORWARD_sayhello = "sayhello";
        public GreetingAction() {
        public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
            String name = ((demo.GetNameForm)form).getName();
            String greeting = "Hello, "+name+"!";
            request.setAttribute("greeting", greeting);
            return mapping.findForward(FORWARD_sayhello);
    }Edited by: sijaffer on Aug 11, 2009 12:03 PM

  • Calling a method in BPM Object from jsf page

    Hi All,
    How do I call a method in BPM object from JSF page? Is it possible to invoke it in a manner similar to invoking a method from managed bean in JSF application?
    Please help.
    Thanks and Regards,
    Veronica

    You can use f:invoke (or f:invokea to with parameters)
    For ajax calls, you can use f:invokeUrl to get the URL to a particular method within your BPM object, although make sure the Server-Side Method property is set to Yes.
    http://download.oracle.com/docs/cd/E13154_01/bpm/docs65/taglib/index.html

  • Virus scan failed Error on deploying a web application having a jar file for calling the applet on the jsp page

    Hi,
    I have an applet application that i want to deploy on the Oracle cloud.
    So i have created a jar file for the applet application and i am using this jar to call the applet on a jsp page.
    But when i am delpoying my application on the java cloud, its giving me the below error:
    2014-10-28 03:16:41 CDT: Starting action "Virus Scan"
    2014-10-28 03:16:41 CDT: Virus Scan started
    2014-10-28 03:16:49 CDT: ----------------------------------------------------------------------
    2014-10-28 03:16:49 CDT: File Scanned: "Application7.ear".
    2014-10-28 03:16:49 CDT: File Size: "106698122".
    2014-10-28 03:16:49 CDT: File Status: "INFECTED".
    2014-10-28 03:16:49 CDT: ----------------------------------------------------------------------
    2014-10-28 03:16:49 CDT: Virus scan failed.
    2014-10-28 03:16:49 CDT: "Virus Scan" complete: status FAILED
    Can't we deploy any application having applet or swing component's onto the cloud?
    Or do we need to request for any extra permissions for the same?
    Thanks,
    Manoj

    I don't see applets mentioned in the supported features nor in the unsupported features so not sure if they are supported you would likely need to contact the operations team to confirm.
    Jani Rautiainen
    Fusion Applications Developer Relations
    https://blogs.oracle.com/fadevrel/

  • Calling a method in the Custom ADF component from JSF page

    HI.
    I have created some custom compoents by extending the core ADF Components. Like i have a ComboBoxDefault component with it's ComboBoxDefaultTag.java and Controls.tld file.
    Now my requirement is i want to bind my label to this component from the JSF page. like
    <fwcontrols:label binding="#{listComponents.comboBoxDefaultLabel}" id="label1"/>
    <fwcontrols:comboBoxDefault binding="#{listComponents.cmbLocales}"
    value="en_GB" id="comboBoxDefault" autoSubmit="true" label="label1">
    <f:selectItems value="#{listComponents.locales}"/>
    </fwcontrols:comboBoxDefault>
    In my JSF page the label will have an id, and that id will be specified in the label tag of the component.
    In Tag.java file i have overrided the setProperty(FacesBean facesBean). In this method i have bind all my properties. In core JSF the setProperty method is provided with the UIComponent parameter, so i can call my method in component also. Which is not in case of ADF Faces.
    My main point is how i can call my method setLabel() which is in ComboBoxDefault.java so that i can set the label.
    Thanks in Advance.

    Thanks for all your replies. I want this kind of a functionality because Im trying to invove a DC (Child DC) from a Parent DC such that the Child DC's view is displayed onto the view container of the Parent DC. I have embedded using 'interface view of a component instance' in the Parent Window and am able to create the component and set usage though the onPlugDefault of the Child View.
    But I observe that when i make a call from the parent, the flow is like this:
    1. The wdDoInit of the Child Component Controller gets triggered first.
    2. Then the wdDoInit of the Child's <b>VIEW</b> gets triggered
    3. and <b>THEN</b> the onPlugDefault of the Child Component Interface View
    What I had actually wanted was to Fire onPlugDefault where Im calling a method LoadData(), after which the Child DC's view must be triggered so it can display the fetched data.
    What is actually happening is the view gets displayed, but no data is displayed in the view.
    Right now I have just given a work around where Im triggering <b>LoadData()</b> of the <b>COmponent COntroller</b> from the <b>wdDoInit</b> of the <b>VIEW</b>.
    Is there a better way to do this? I find it strange that I have to load the Data from the view.
    Thanks
    Jack

  • Calling applet in jsp page

    i have made a line graph in applet and i want to call that applet in my jsp project's page....
    <jsp:plugin type= "applet" codebase="." code= "ibill.lineGraph.class" width="400" height="400">
    </jsp:plugin>
    but it dosnt show the applet and give error of Loading java applet is failed....
    can anyone help me please
    with regards

    In one of my project i tried to load applet using the <jsp:plugin> tag but failed. Since i had less time so i have not done the R&D instead i called the applet as
    <applet id="MyApplet" code="MyApplet.class\" archive=\"MyApplet.jar\" width=5 height=3/>and it worked fine for me. You can try this method.
    NOTE: My applet jar file was in the same directory of my JSP page
    Message was edited by:
    diptaPB

  • How to call jsf page which is in a seperate project

    hi,
    I am using JDEV 11.1.2.2.0 verrsion.
    how can i call jsf page which is inside the seperate project.

    Hi,
    How is the jsf page deployed? As a separate application or as part of the same application? If it is separate app, you can use the goLink method suggested by Suresh. If it is in the same app, you can create a taskflow and drop the page as view activity. Then, create an ADF Library out of the project and use it in your project where you want to call it.
    -Arun

  • How to place an applet in a jsf page

    Hello all.
    I try to place an applet on a specific place in my jsf page, as example in a table or
    something else. My resulting test-code looks like this:
    <f:view>   
         <h:form id="registrationForm">
         <h:panel_grid headerClass="panel-background" footerClass="panel-background">
                   <h:column>                    
                        <h:output_text value="My Applet:"/>
                   </h:column>     
                   <h:column>
                        <jsp:plugin type="applet" code="smartcard.SmartCardApplet"
                             archive="/sharedlib/SmartCardApplet_signed.jar"
                                  name="SmartCardApplet" width="360" height="120">
                        </jsp:plugin>
                   </h:column>     
         </h:panel_grid>
         <h:command_button styleClass="style-button" id="register" value="Register"
              action="#{MyBean.register}"/>
         </h:form>
    </f:view>
    ...But on the resulting page in my browser the applet has been placed on the top of the
    page instead in the table. What is going wrong? Does anyone have an idea?
    Thanks
    Phil

         <h:form id="registrationForm">
         <h:panel_grid headerClass="panel-background" footerClass="panel-background">
                   <h:column>                    
                        <h:output_text value="My Applet:"/>
                   </h:column>     
                   <h:column>
                        <f:verbatim escape="false">
                        <jsp:plugin type="applet" code="smartcard.SmartCardApplet"
                             archive="/sharedlib/SmartCardApplet_signed.jar"
                                  name="SmartCardApplet" width="360" height="120">
                        </jsp:plugin>
                        </f:verbatim>
                   </h:column>     
         </h:panel_grid>
         <h:command_button styleClass="style-button" id="register" value="Register"
              action="#{MyBean.register}"/>
         </h:form>
    <table>
    <tbody><tr>
    <td>My Applet:</td>
    </tr>
    <tr>
    <td><OBJECT classid=clsid:8AD9C840-044E-11D1-B3E9-00805F499D93 name="SmartCardApplet" width="360" height="120" codebase="http://java.sun.com/products/plugin/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0">
    <PARAM name="java_code" value="smartcard.SmartCardApplet">
    <PARAM name="java_archive" value="/sharedlib/SmartCardApplet_signed.jar">
    <PARAM name="type" value="application/x-java-applet;">
    <COMMENT>
    <EMBED type="application/x-java-applet;" name="SmartCardApplet" width="360" height="120" pluginspage="http://java.sun.com/products/plugin/" java_code="smartcard.SmartCardApplet" java_archive="/sharedlib/SmartCardApplet_signed.jar"/>
    <NOEMBED>
    </NOEMBED>
    </COMMENT>
    </OBJECT></td>
    </tr>
    </tbody></table>

  • PrepareRender() called multiple times if I have HTML/Images on a JSF page

    I have extended ADFPhaseListener and also FacesPageLifecycle. I am overriding the prepareRender() method in the CustomFacesPageLifecycle.
    When I insert an image on to the page in the branding facet or add any html using verbatim tag, the prepareRender() method is called two times. I am not sure why?
    If I remove the images/html, the method is only executed once.
    If I have image/html in the page, another strange thing is that the first time all the custom lines of code gets executed in prepareRender() method. But the second time only first few lines of code in the prepareRender() method. This seems to me a very wierd behaviour.
    Any inputs from ADF product dev team?
    Thanks
    - Amit Kochar

    Hi,
    if you add the following print statement
    System.out.println("rendering "+FacesContext.getCurrentInstance().getViewRoot().getViewId());
    Then the output in my case is
    07/04/24 08:14:04 rendering /BrowsePage.jsp
    07/04/24 08:14:05 rendering /otn_logo_small.gif
    The image comes from the file system, which means it is rendered by the JSF lifecycle. If you reference the image with a URL then the lifecycle doesn't render the image but only refrences it.
    To avoid your prepare render code to be executed multiple times, just check for jsp and jspx file extensions, which will guarantee that your code only executes for JSF pages, not for loaded files.
    The reason why this happens is because the JSF filter is set to /faces , which means all files that are loaded through that path
    Frank

Maybe you are looking for

  • Problem with a trigger

    I have a problem with a very simple trigger: CREATE OR REPLACE TRIGGER contratos_factuali AFTER UPDATE OF descrip,fautori,origpeso,origdls, montopeso,montodls,aant,aact,fifiobserva,pedsap ON ulises.contratos FOR EACH ROW BEGIN UPDATE contratos SET fa

  • Buddy icons in Mac Messages

    Since updating to Yosemite I have not been able to resolve the problem of buddy icons in Mac messages being greyed out, as if my buddies had no profile pictures.  When I delete a conversation and re-add the buddy, his/her profile pic reapperas. Howev

  • News page on iweb..

    Hi, I have just recently started using iweb and i wish to use it to help a friend create a small website where he needs to have some sort of news feed on the front page. I have had a look around but i have yet to find any way or widgets that let you

  • Product categorisation

    Hi, I need a help. My client wants a categorisation of product. e.g. we have 500 nos of materials which we have divided under 10 product categories say A1,A2,A3....A10. Now I want to maintain the material M1 to M50 in A1. P1 to P50 in A2... so on...

  • Slow Streaming - Need Help

    Location: Nigeria, Africa. Problem: When I try to stream movies that I have purchased already from the iTunes store, it takes 2 hours to start playing. Sometimes it starts playing right away in 1 minute, sometimes it takes 3 hours. Trobleshooting : M