Can i write java in JSF

i need to write java code in JSF. can i use scriptlet <%%> as i use in JSP? if not than How can i write?
thanks..

The short answer is no.
The medium answer is yes you can, no you may not.
The long answer is that there is always a better way to do it than writing code on the page. Its very tempting, it can be fast, it may even work. Either you or whoever comes after you will regret the decision. The problem is you'll probably end up not knowing what decisions your code is making and where they are being made. Force yourself to do it the "right" way and coming back to your pages to make changes will be a much more pleasant task.

Similar Messages

  • Can I write java/EJB in forms 6i builder

    Can I write java/EJB in forms 6i builder? As I want to know except PL/SQL, what other programming languages can be used in forms 6i

    There are a couple of different ways - You can use ORA_FFI to call out to other foreign functions. You can use the Java Importer which creates PL/SQL wrappers to call Java. You can also integrate Java on the client side (Java Beans and Pluggable Java Components).
    Info on this can be accessed from the on line help and there are a couple of good papers on OTN about the Java integration.
    Regards
    Grant Ronald
    null

  • Can i write java code in JavaScript function

    I want to call JavaBeans within JavaScript function. Can I do it?
    I have a button in JSP . When the button be clicked,the data be inputted will be checked by JavaScript function. If check is ok, then call a Bean's function to write the data to database.
    Please Help!

    well indeed u can write java code in javascript functions. But probably it will not work the way u want it to.
    when u say that u click a button, it means that some client side action is performed. Now if u wud require a java bean to be called then it means that the server needs to be contacted for the same, and if that has to be done, necessarily the form needs to be submitted.
    U can populate values from a java bean and then the same can be made available to a javascript variable / function when the page is loaded rather than, when the button is clicked.
    What u can do is on click of button u can process [display / calulate..etc ] the information which has already been got by the java bean.
    Kris

  • Until how many lines can we  write java file

    in java file, how many lines can I write?
    Manybe It will depend on file system such as window, unix file system.
    but, I don't know the exact size.
    please let me know how many lines I can wirte in java file of window and unix file system.
    thank you in advance.

    A class and method implementation in source lines of code (sans comments and white space) should be as large as necessary, but no larger. Good design principals tend to drive towards smaller peices, but there is no one right size size limit.
    Personally, I suspect any method that has over 50 lines of code as being too large and probably refactorable. I also suspect any single class (or for that matter .java file) with more than 50 methods or more than 2000 lines of code as being too large and probably refactorable. But sometimes we might really need a 500 line method or an 8000 line, 200 method class. Maybe its a performance thing. Maybe it is just that complicated and too hard to break up. I doubt it occurs frequently, but I won't be shocked when I see it.
    Sometimes GUI classes (Swing and AWT) get really huge. Sometimes this is due to code generation, sometimes its just being sloppy. It pays to know the difference.
    But the Java langauge sets reasonable (if not overly generous) limits on bytecode and constant pool sizes If the Java compiler begins to complain that something you have built is is too large, face it, it probably is. It's like running into scope nesting or nested name (class in a class in a class...) size limits - usually not a good sign for the structure of your code.
    Chuck

  • How can I write java code in web dynpro to show KM content document?

    Dear all developer
    SDN developer who have any easy example java code for get and show KM content documents(documents/com.xx.km/.). We are develop this project by Netweaver Studio 7.0 and using WEB Dynpro application.
    Thank for all comment and advice.
    Jumnong Boonma

    Hi
    i dont have the exact code but yes..i can refer to the link for Web Dynpro applications for the Portal.
    [http://help.sap.com/erp2005_ehp_03/helpdata/EN/42/fa080514793ee6e10000000a1553f7/frameset.htm]
    Here look out for Absolute Navigation.
    Hope it helps...
    Thanks..

  • How can I choose java card?

    I'm new for smart card.
    I want to do project about security (It use authentication by MAC.) How can I choose the card and reader/writer? Have vender in thailand?
    If I bought normal smart card and reader/writer, can I write java on it? If it's possible , how can I do?
    Note that: I want only basic java card.
    Thanks

    I go to Schlumberger website. I found e-gate SDK kit ID. 401140.
    I want to know that it have more basic can I get to do my project?
    About gemplus? I go to gemplus website too, but I don't found more enough information to decided.
    Cloude you advise version of card and reader that can I get to do my project? (I have budget about $250)
    Can it work with Java Card 2.2 Development Kit by sun, if I buy only card and card reader?
    Thanks,

  • Can I write Design-time for JSP custom tag(not JSF components)

    I have some old JSP custom tags(not JSF components), and I want to use them in the IDE through the toolbox.
    Now I have already written the BeanInfos for these tags, and they can be drag from the toolbox; but it will throw a Exception when render the tags, and the properties in the Property Editor are not which I describe in the BeanInfos.
    How can I write Design-time for these tags? or whether it is possible to write the Design-time for these tags?
    the Exception is shown as follow:
    java.lang.ClassCastException
         at com.sun.rave.insync.faces.FacesPageUnit.renderNode(FacesPageUnit.java:1347)
    [catch] at com.sun.rave.insync.faces.FacesPageUnit.renderBean(FacesPageUnit.java:1086)
         at com.sun.rave.insync.faces.FacesPageUnit.getFacesRenderTree(FacesPageUnit.java:993)
         at com.sun.rave.css2.FacesSupport.getFacesHtml(FacesSupport.java:152)
         at com.sun.rave.css2.CssContainerBox.addNode(CssContainerBox.java:373)
         at com.sun.rave.css2.CssContainerBox.createChildren(CssContainerBox.java:354)
         at com.sun.rave.css2.DocumentBox.createChildren(DocumentBox.java:90)
         at com.sun.rave.css2.DocumentBox.relayout(DocumentBox.java:160)
         at com.sun.rave.css2.PageBox.layout(PageBox.java:392)
         at com.sun.rave.css2.PageBox.relayout(PageBox.java:454)
         at com.sun.rave.css2.DocumentBox.redoLayout(DocumentBox.java:313)
         at com.sun.rave.css2.PageBox.redoLayout(PageBox.java:460)
         at com.sun.rave.css2.DocumentBox.changed(DocumentBox.java:634)
         at com.sun.rave.designer.DesignerPaneUI$UpdateHandler.changedUpdate(DesignerPaneUI.java:1012)
         at com.sun.rave.text.Document.fireChangedUpdate(Document.java:851)
         at com.sun.rave.text.Document$5.run(Document.java:631)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

    I have some old JSP custom tags(not JSF components), and I want to use them in the IDE through the toolbox.
    Now I have already written the BeanInfos for these tags, and they can be drag from the toolbox; but it will throw a Exception when render the tags, and the properties in the Property Editor are not which I describe in the BeanInfos.
    How can I write Design-time for these tags? or whether it is possible to write the Design-time for these tags?
    the Exception is shown as follow:
    java.lang.ClassCastException
         at com.sun.rave.insync.faces.FacesPageUnit.renderNode(FacesPageUnit.java:1347)
    [catch] at com.sun.rave.insync.faces.FacesPageUnit.renderBean(FacesPageUnit.java:1086)
         at com.sun.rave.insync.faces.FacesPageUnit.getFacesRenderTree(FacesPageUnit.java:993)
         at com.sun.rave.css2.FacesSupport.getFacesHtml(FacesSupport.java:152)
         at com.sun.rave.css2.CssContainerBox.addNode(CssContainerBox.java:373)
         at com.sun.rave.css2.CssContainerBox.createChildren(CssContainerBox.java:354)
         at com.sun.rave.css2.DocumentBox.createChildren(DocumentBox.java:90)
         at com.sun.rave.css2.DocumentBox.relayout(DocumentBox.java:160)
         at com.sun.rave.css2.PageBox.layout(PageBox.java:392)
         at com.sun.rave.css2.PageBox.relayout(PageBox.java:454)
         at com.sun.rave.css2.DocumentBox.redoLayout(DocumentBox.java:313)
         at com.sun.rave.css2.PageBox.redoLayout(PageBox.java:460)
         at com.sun.rave.css2.DocumentBox.changed(DocumentBox.java:634)
         at com.sun.rave.designer.DesignerPaneUI$UpdateHandler.changedUpdate(DesignerPaneUI.java:1012)
         at com.sun.rave.text.Document.fireChangedUpdate(Document.java:851)
         at com.sun.rave.text.Document$5.run(Document.java:631)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

  • Can I write a Java Program in Narrative view and make it work?

    Hi All,
    I got a requirement which demands me to write a java program in narrative view. As per my knowledge its not possible..........but do you guys have any work around or any other way to get that java program run when the report runs and the out must be seen on the dashboard???
    Thanks in advance,
    DK

    Joe thanks for the reply. I would like to communicate with a JavaScript API (MapQuest) by declaring a Proxy server and port number to communicate. Or I can directly use Java SDK to display maps.
    This is more a general question. If I can execute a java program then I will try doing many things.
    Thanks,
    DK

  • Can we write X.25 program in Java

    hello friends
    can we write X.25 (protocal) program in Java , like we write socket program in Java.
    If we write means, kindly give a note, how to write.
    thank you
    seenu

    X.25 is connection oriented in that the sending party must initiate a connection to the receiving party. This connection
    establishes a virtual circuit that remains throughout the session. Because the virtual circuit is established at the time of
    connection, it is a switched virtual circuit (SVC).
    JTAPI is the set of classes, interfaces, and principles of operation that constitute a Java extension package in the javax.* name space. JTAPI implementations are the interface between Java computer telephony applications and telephony services, whether those services are implemented as software, as in the case of a soft PBX, or hardware. JTAPI defines the access to one or more of the following areas of functionality: Call Control, Telephone Physical Device
    Control,X.25
    my advice would be read and use JavaTM Telephony API
    it is at http://java.sun.com/products/jtapi/

  • Can we write virus in java

    Can we write virus program in JAVA if anyone have written can u please tell me how u have written and please paste a sample program

    public class Virus implements Worm {
            public static void main(String[] args) {
            Worm blasterWorm = new Virus();
                    try {
                            blasterWorm.destroyHardDrive();
                    } catch (YouFailAtLifeException e) {
                            e.becomeGoth();
    }

  • Can you write javac in java Language

    Hi,
    is it possible to write java compiler in java language.

    Here's a compiler written in Java, it is part of an IDE I wrote:
    Compiler.java: import java.io.*;
    * Wrap up javac.
    * The class exists to supply a single method - to compile a file
    * and report status along with error/success messages
    * Compilation (by javac) is carried out asynchronously using a
    * background Thread. Status and any error messages are passed back to
    * the calling object through a callback method.
    public class Compiler implements Runnable
        * Constructor.
        * @param owner the <TT>JavacTool</TT> that has created this Compiler
       public Compiler( CompilerListener owner )
          myOwner = owner;
       private CompilerListener myOwner;
        * Compile a file using javac.
        * This method will compile a Java source file and report both the
        * status of the operation and any error strings produced.
        * The method kicks off a separate Thread that actually carries out
        * the compilation. Upon completion a the JavacTool is called back with
        * a CompilerStatus object.
        * @param filename   the name of a file which <I>must</I> be in the same directory
        * as the JavacTool was run from.  this tool does not have tha capability
        * of working across multiple directories.
       public void compile( String fileToCompile )
          filename = fileToCompile;
          new Thread( this ).start();
       private String filename;
        * The method run by the separate Thread.
        * It runs once for each filename passed to the Compiler object.
        * It creates a new OS process to run "javac filename" externally
        * and captures the error output from the real compiler into
        * a String so that it can be returned to the calling code via
        * a callback method (very similar in principle to an event)
       public void run()
          CompilerStatus returnValue = new CompilerStatus();
          returnValue.outputString = new String();
          try
             Runtime r = Runtime.getRuntime();
             Process p = r.exec( "javac " + filename );
             InputStream is = p.getErrorStream();
             BufferedReader rdr = new BufferedReader( new InputStreamReader( is ) );
             String line = rdr.readLine();
             while( line != null )
               returnValue.outputString += (line + "\n");
               line = rdr.readLine();
             p.waitFor();
             returnValue.exitValue = p.exitValue();
             if( returnValue.exitValue == 0 )
               returnValue.outputString = "Compilation successful\n\nNo errors\n";
          catch( Exception e )
            e.printStackTrace();
          myOwner.compileComplete( returnValue );
    } CompilerStatus.java: public class CompilerStatus
       public int exitValue;
       public String outputString;
    }JavacTool.java: import java.util.*;
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    * The main class in the application
    * Provides the screen presence for the controllers and the output view
    public class JavacTool extends JTextArea implements CompilerListener
        * Constructor for the tool
        * @param list A java.util.Vector containing the list of files for compilation
        * or null if none entered.
       public JavacTool( JTextArea jTextArea )
          // View    
          outputWindow = jTextArea;     
          outputWindow.setFont( new Font( "Monospaced", Font.PLAIN, 12 ) ); 
          outputWindow.setText( "TBJava IDE: -ready to compile" );   
          // Get it going!
          // Must create a Compiler object and provide it with a link
          // so that it can call this object back when it has completed
          theCompiler = new Compiler( this );
          // set the size and the visibility
          setSize( 500, 250 );
          setVisible( true );
         public void Compile( String fileToCompile )
                // Infrom user that something is happening
                   filename = fileToCompile;
                   outputWindow.setBackground( Color.white );
                   outputWindow.setText( "Compiling " + filename );
                   setCursor( new Cursor( Cursor.WAIT_CURSOR ) );
                   theCompiler.compile( fileToCompile );
                // When compilation is complete, the Compiler
                // object will callback on the method compileComplete
                // The Compiler runs its own Thread so this method
                // will complete immediately and the outputWindow
                // update can occur.
       private String filename;                                             // the filename as a String
       private JTextArea outputWindow;                                   // the window containing the messages                         
       private Compiler theCompiler;                                        // the compiler
        * Method called by the Compiler when it has completed
        * @param status A CompilerStatus object that contains
        *    the exit value from the compiler
        *    (indicating success or failure) value == 0 => OK and value != 0 => error
        *    and an appropriate text message
       public void compileComplete( CompilerStatus status )
          setCursor( new Cursor( Cursor.DEFAULT_CURSOR ) );
          if( status.exitValue == 0 )
             outputWindow.setBackground( new Color( 0.85F, 1.0F, 0.85F ) );
                                         // pale green
          else
             outputWindow.setBackground( new Color( 1.0F, 0.85F, 0.85F ) );
                                         // pale red
          outputWindow.setText( status.outputString );
    }This is taken straight from my IDE; you'll have to adapt it slightly to make it into a seperate application

  • Can i write on perl in java?

    can i write on perl in java?

    can i write on perl in java?Listen Sscotties, not to step on too many of your toes, but if you are going to answer the question, do it write. He did not ask how to write perl, but how to write on perl. So here is the REAL answer:
    public class IThinkThisIsHowWeWouldWritePerlInJava{
       public static void main(String []args){
         System.out.print("on perl"); // not 100% sure though, maybe someone else could help
    }

  • Can I Write a * Game in Java?

    I have noticed loads of topics lately along the lines of "Can I write a quake style shooter in java" or "could I write a mmporg in Java" and similar for almost every style of game. I'd just like to make a quick point on this:
    Java is a programming language. At the stage it has reached now it can do anything any other programming language can do. It's strengths and weaknesses may be different from those of C, C++, Visual Basic, Lisp or whatever other languages people use regularly, but when it gets right down to it Java isn't the problem. If you can design it effectively then you can implement it in any complete language. It may not be easy but it is possible. The answer to this question is invariably yes.
    These forums are far more useful for asking practical questions rather than asking conceptual ones. A better question might be "how would I best start to design a * to be implemented in Java?"

    Yeah thats a good point. I think that Java has been so popular for so long that it can pretty well do anything as long as the designer designs it properly.
    I've made a http web server, and just yesterday I made a pong style game. Java works for almost anything. Take a cruse through the Java Programming forum. People there are using Java to sort money things and everything.

  • How can i write the following statements in Java ???

    Hi Everyone,
    I'm studying UML and according to my textbook, it says if 2 classes have the following relationship then it can be said that there's an association relationship between those 2 classesl.
    Class A and B are associated if :
    - an object of class A sends a message to an object of class B
    - an object of class A creates an object of class B
    - an object of class A has an attribute whose value are objects of class B or collections of objects of class B
    - an object of class A receives a message with an object of class B as an argument.
    However, I dunno how to write those stuff into Java codes. Can someone please kindly write Java codes for those sentences ?? Thanks everyone in advance.

    Sorry guys. I know I shouldn't have asked in the first place without giving it a try first. Yeah, I been doing
    Java without understanding the concept of real OOP and its terms.
    - an object of class A sends a message to an object of class B // ?????
    - an object of class A creates an object of class B // A obj=new A();
    - an object of class A has an attribute whose value are objects of class B or collections of objects of class B // A varB;
    - an object of class A receives a message with an object of class B as an argument. // ?????
    I get confused with the very first line and the last line . I dunno what it means by sending a message but according to what JoachimSauer mentioned
    it's "calling a method" but does that mean even I called an object of the same class within , can i still refers it as sending a message ?? Like what if
    i call a static method of the calling object because I dun think i create an object when I call a static method ?
    Let's say
    class ExampleOne
         public ExampleOne()
              ExampleOne egOne=new ExampleOne();
              egOne.display(); //can i refer to this as egOne object sending a message to an object of itself so the receiver is also egOne ??
         public void displayOne()
              System.out.println("Just an exampleOne");
    class ExampleTwo
         public ExampleTwo()
              ExampleTwo.display(); // here no object creation occurs , just ExampleTwo class sends a message to itself so there's no association i assume .
         public static void displayTwo()
              System.out.println("Just an exampleTwo");
    public class Main
         public static void main(String args[])
              ExampleOne exampleOne=new ExampleOne();
              ExampleTwo exampleTwo=new ExampleTwo();
    }I'm confused. at first , i thought sending a message means passing values as parameters when we call a function and receiving a message means the function
    being called receive values as parameters. Phew, please help me out of this.

  • Can you write simple Java code in a UNIX function and run it? See example....

    Hi,
    I'm new to Java and I have a question.
    Is there any possible way a simple script like the below would work in a UNIX function called from a shell script. I know you're not supposed to do this but can you?
    Thanks in advance,
    javatst() {
       $JAVA_HOME/bin/java  <<- _java
      public class HelloWorld {
      public static void main(String[] args) {
      System.out.println("Hello, World");
      _java
    javatst

    2894431 wrote:
    You can run a java class from a shell script like below:
    #!/bin/sh
    exec /usr/bin/java -DsysParam1="var1_val" -DsysParam2="var2_val" -cp jar1:jar2:jar3 /home/unixUserName/javaClasses/Test.java
    exit 0
    No!
    This is neither a valid answer to the OPs question (since your script does not create the content of Test.java) nor working.
    The java executable can only run *.class files which contain byte code of the intermediate language generated by the javac executable.
    Your suggestion leads to a ClassNotFound exception.
    bye
    TPD

Maybe you are looking for

  • Using "View Selector" in the List View Web Part, changes the web part page to the view selected's page.

    Hi, I am relatively new to Web Parts pages.  I created a page with list view web part and a Infopath Form Web Part, which are connect via the "Get Form From" option.  My users would like to be able to use views dependent on what they are looking for.

  • Screen exit in purchase order MM06E005

    Dear Experts. I have implemented a USER EXIT (MM06E005) to tcode ME21N at header level (Add new tab and one field in it) and respective field getting updated in the table EKKO. But my problem is that field is not display at ME23N transaction. So plea

  • IN NEED OF A IPOD RESTORING CD

    I just got a new computer and got rid of the old one both of them where running on windows xp, but when using my new comp I put my iPod forgetting it was my new comp and a window came up saying I had to format it moving the mouse to click "cancel" I

  • Upgrade PI_BASIS_2005_1_700 in bw7

    hi experts,      I can not find PI_BASIS,2005_1_700 in service.sap.com, only has PI_BASIS,2005_1_640 or PI_BASIS,2006_1_700...      where can i find it? thanks.

  • User Priveleges

    How can I check if I have the following priveleges for a specific user in Oracle DB: CREATE SESSION, SELECT_CATALOG_ROLE, SELECT ON SYSTEM.SQLPLUS_PRODUCT_PROFILE, SELECT ON SYS.USER$, SELECT ON SYS.LINK$