Using Textbox strings in Java code

Hi,
I wonder if anyone can help me with a problem I'm
having with a JSP.
I've got several text boxes on my JSP which are static and would like to access their contents from within some dynamic Java code contained within the same JSP. I.e If I have a text box whose name is my_text I
would like to use my_text as a string within my Java code.
Does anyone know how to do this?
Thanks,
Peter

actually u can user java variable values in a html form/javacript but not vice versa.

Similar Messages

  • Compile source string like java code

    I need to calculate some user defined formulas in my application. I have this formula in string form (e.g. "operand1 * operand2 + operand3" ). I have gained operand values throught the reflection and pars this string throught the StringTokenizer. So I have parsed string with operand values and operators. Is it possible to compile this string like java code ?
    Thanks for all hints

    Compile to what - a class file?
    Yes, it's possible if you don't mind using non-100% pure Java. You can compile them using the sun.tools.javac.Main class found from tools.jar in the lib directory of the jdk.
    But from what you say it would be easier to use an existing expression evaluator. Take a look at JEP (jep.sourceforge.net) and BeanShell (www.google.com) before you make any decision.

  • Search information using a VO by java code..?

    Search information using a VO by java code.
    Hi to all
    Im trying to retrieve specific   information by java  using the VO object that I have attaché to the EO. I need to know if this is possible and how to.
    For example lest say that I have the following information user name and password and I wand the telephone and other information.
    Can some pls help me with a link of an example of how to do this.
    Tanks to all.

    Hi JulianeE
    Yes it is possbile, please generate the VORowImpl file on the corresponding VO object. Even if your query return multple rows, it can . see the sample code below
    OAViewObject vo1 = (OAViewObject)am.findViewObject("EmployeeEOVO1");
    vo1.reset();
    if (vo1 != null)
    do
    if(!vo1.hasNext())
    break;
    vo1.next();
    EmployeeEOVORowImpl lcerl = (EmployeeEOVORowImpl)vo1.getCurrentRow();
    lcerl.getFullName();
    Thanks
    Sandeep

  • How to use Oracle objects in java code

    Hi all!
    I'm reading an xls and i need to fill me oracle objects with java code:
    OBJECT_NAME OBJECT_TYPE
    LETTURA_OBJ TYPE
    LETTURA_OBJ TYPE BODY
    In the past weeks i've been using both java code into oracle and oracle objects, but new i need to write those objects with data i read with java, anybody can help me?
    I know that the easiest work around would be to put the data i read from the excel file into a table and then fill the oracle objects, but now i want to learn how to write directly those objects with a command like the following one:
    a sample of the code i'm tryng to write:
    CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED REPORT."Manage_Excel_ASMBS" AS
    import java.io.*;
    import java.io.IOException;
    import jxl.*;
    public cass ....
    #sql{  variabili_globali.var_ER_F3.Tipo_Lettura := 5}
    thanks,
    Massimo
    Edited by: LinoPisto on 16-mag-2011 16.38

    mmmh i'm not understanding so much....
    well... as i told before i'm working in oracle database environment and i'm developing a java procedure.
    now, i have this object
    CREATE OR REPLACE
    TYPE REPORT.FATTURA_OBJ AS OBJECT (
    POD VARCHAR2(1000),
    ID_FATTURA NUMBER,
    ID_FILE NUMBER,
    COERENZA_EA_F VARCHAR2(1000),
    COERENZA_ER_F VARCHAR2(1000),
    COERENZA_EA_M VARCHAR2(1000),
    COERENZA_EF_M VARCHAR2(1000),
    ANOMALIA VARCHAR2(1000),
    MOTIVO_INVALIDAZIONE VARCHAR2(1000),
    MATRICOLA_CONTATORE VARCHAR2(1000),
    POTENZA_DISPONIBILE VARCHAR2(1000),
    MEMBER PROCEDURE pulisci
    /and i need to work with it inside this procedure:
    CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED REPORT."Manage_Excel_ASMBS" AS
    import java.io.*;
    import java.io.IOException;
    import java.io.StringWriter;
    public class Manage_Excel_ASMBS
    public static void read_Excel(String inputFile,int var_Id_Caricamento, int var_Id_Distributore, String var_Distributore) throws SQLException, IOException
              **here i need to put what i'm reading inside the excel file into oracle objects**
    /can you please give me a sample ?
    thanks

  • Using jsp variable in java code

    Hey guys,
    I need some help hope you guys can help me.
    I've declared a variable "error" in a jsp. how do I access this variable in the java code whice resides in the same jsp page.
    I know I can use java variable in jsp code using
    <%= sVariable %>
    where sVariable was declared in the java code. but how do I access a jsp variable in java code??
    Thanks very much in advance

    Thanks for the reply.
    This is what I want to do.
    I've declared a variable "error" using <c:catch var="error">I want to check the value of this variable and suppose if it contains XYZ (error variable will have a long string so I just want to check if it contains a specific value) I want to do step1 and if the variable of error is not XYZ I want to do step 2
    Problem is I dont know how to check if error contains the XYZ in jsp thats why I thought java code would help here.
    Can you guys suggest a better way to solve my problem.
    Thanks again

  • Converting String into Java code

    Hi everyone,
    I will describe the scenario I have. I have a GUI application. I want the user to write some Java code in a text box and plug that code during runtime. Is there a way in Java so that a string could be used as a Java code?
    You help is really appreciated.
    Thanks
    RG

    catch the string input
    output string (code) to file
    call javac on the file you made
    that's it, you have a class, and you can run it/load it

  • Tools for extracting strings from java code for internationalization

    For legacy code with lots and lots of strings what method is typically used to extract strings for internationalization?
    Am I right in thinking you couldnt simply grep for strings, it could get pretty complitcated, especially with escape characters, escaped quotes etc.,
    -SK

    When dealing with legacy code, it is nice to have an application that queries you as it extracts the strings. You have a choice whether to accept the string as a localizable entity or not.
    There are several tools that do this...including some IDEs like JBuilder. Although it isn't a fully supported or robust tool, Sun has a utility for extracting strings in Java source files:
    http://java.sun.com/products/jilkit/.
    Regards,
    John O'Conner

  • Using getProperty in my Java code.

    I am reading the attached XML file into my Java classes.
    <Config>
    <Properties>
         <entry key="rmi.remotecontrol.port">30</entry>
    </Properties>
    <AListener>
              <Subscriber></Subscriber>
              <Database>
                   <URL>jdbc:oracle:thin:@0.0.0:1521:dev</URL>
              </Database>
    </AListener>
    </Config>
    My Java code displays the correct output when I say:
    System.out.println("The RMI Port name property: " +  prop.getProperty("rmi.remotecontrol.port"));
    Output : 30Now,if I want to get the URL address of the database,and when I use
    System.out.println("The RMI Port name property: " +  prop.getProperty("Database.URL"));
    Output is null.How do I get the value of the URL using getProperty?
    Thanks,

    you're a complete idiot. seriously. three separate threads, days apart, each with the same mistake in, pointed out by me several times each thread, links to exactly the documentation you need, code actually pasted into the thread from the documentation, several patient explainations, and you still haven't bothered actually listening to me
    other posters beware: check this fools posting history for an insight into how they repeatedly ignore advice on this problem before deciding whether it's worth your effort replying - it isn't. this clown simply ignores being told directly what is wrong here, and even ignores being given the exact fix. no point replying
    http://forum.java.sun.com/thread.jspa?threadID=5155898&messageID=9589500#9589500
    http://forum.java.sun.com/thread.jspa?threadID=5153393&messageID=9577681#9577681
    http://forum.java.sun.com/thread.jspa?threadID=5152929&messageID=9575638#9575638
    and still you don't get it. give up programming, you're not cut out for it. it involves an attention span and the ability to listen to advice

  • I want to use £ in euro in java code

    Hi,
    I want to use &pound; as euro symbol in java code please help me as soon as possible.

    It's not 100% clear what you are asking:
    I want to use &pound; as euro symbol in java codeDo you mean you want to display a Euro symbol? If so, you use &euro; (if your font supports it) but I suspect that is too easy you must mean something else. Can you ask the question again but rephrase to make it clearer what you want to do. Do you want to use the symbol in a particular Java component?

  • How to use odi variable in java code.

    Hi,
    I am trying to calculate check sum of a file and need to capture that in a odi variable...
    I wrote code like this(selected technology as java bean shell)
    <@
    import java.io.*;
    import java.util.zip.*;
    public class checksum {
    public static void main(String[] args) throws Exception {
    FileInputStream fis = new FileInputStream(new File("c:/dummy.txt"));
    CheckedInputStream cis = new CheckedInputStream(fis, new CRC32());
    BufferedInputStream in = new BufferedInputStream(cis);
    while (in.read() != -1) {
    #checksum = cis.getChecksum().getValue();
    }@>
    But I am not able to get that value...
    I tried in another way like this
    <@
    import java.io.*;
    import java.util.zip.*;
    public class checksum {
    public static void main(String[] args) throws Exception {
         long result;
    FileInputStream fis = new FileInputStream(new File("c:/dummy.txt"));
    CheckedInputStream cis = new CheckedInputStream(fis, new CRC32());
    BufferedInputStream in = new BufferedInputStream(cis);
    while (in.read() != -1) {
    result= cis.getChecksum().getValue();
    @>
    In odi variable refreshing mode i selected schema as memory_engine and wrote
    select '<@=result@>' from dual;
    even this wont work for me :(
    Anyone pls help me in this...
    Thanks in advance
    Pavan

    Hi Phani,
    Thanks for the reply. I resolved this. The mistake is I wrote java code in a class,in main function. I removed class and main function. Now I am able to capture value into Odi variable...
    I modified code as
    <@
    import java.io.*;
    import java.util.zip.*;
         long result;
    FileInputStream fis = new FileInputStream(new File("C:/dummy.txt"));
    CheckedInputStream cis = new CheckedInputStream(fis, new CRC32());
    BufferedInputStream in = new BufferedInputStream(cis);
    while (in.read() != -1) {
    result=cis.getChecksum().getValue();
    @>
    finally retrieving result value from dual
    select '<@=result@> from dual
    Edited by: 908443 on Jan 16, 2012 10:42 PM

  • How to Use Exec function in Java Code

    How to Use Exec method
    I want to Execute command
    net Start "some service"
    using exec method of runtime class
    or i use some other way if suggest

    Assuming you have read http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html#exec(java.lang.String) already, I can only suggest to be more specific in what your problems are. If you are after just some example code, then download ftp://ftp.ebi.ac.uk/pub/software/textmining/monq/monq.tar.gz and have a look at the source code of monq.stuff.Exec. It does all those things which are necessary to keep track of a Process after it was created with exec.
    Harald.
    BioMed Information Extraction: http://www.ebi.ac.uk/Rebholz-srv/whatizit

  • Using ftp in core java code to transferring a file to other sys

    My mail id:[email protected]
    hi to all
    I am actually using this code for transforing a file from my system to side system of mine.but the code is compiling and when runing this code i am getting an error:
    java.net.ConnectException: Connection refused: connect
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(Unknown Source)
    at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at java.net.Socket.<init>(Unknown Source)
    at com.sshtools.j2ssh.net.SocketTransportProvider.<init>(Unknown Source)
    at com.sshtools.j2ssh.net.TransportProviderFactory.connectTransportProvider(Unknown Source)
    at com.sshtools.j2ssh.SshClient.connect(Unknown Source)
    at com.sshtools.j2ssh.SshClient.connect(Unknown Source)
    at com.sshtools.j2ssh.SshClient.connect(Unknown Source)
    at ftpsample1.main(ftpsample1.java:36)
    I am getting this error.
    friend is saying some proxy should should be installed in that other system.
    Plase help me..
    my code is:
    import java.io.File;
    import java.util.List;
    import java.io.*;
    import com.sshtools.j2ssh.SftpClient;
    import com.sshtools.j2ssh.SshClient;
    import com.sshtools.j2ssh.authentication.AuthenticationProtocolState;
    import com.sshtools.j2ssh.authentication.PasswordAuthenticationClient;
    import com.sshtools.j2ssh.sftp.SftpFile;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    class ftpsample1
         public static void main(String[] args) {
         String username="administrator";
         String password="thota1976";
    try{
    // Make a client connection
    System.out.println("Before SSHCLIENT......");
    SshClient ssh = new SshClient();
         System.out.println("After SSHCLIETNT ......");
    // Connect to the host
    System.out.println("Connecting ......");
    System.out.println("ssh.connect ->9.182.54.70*************************......");
         ssh.connect("9.182.54.70");
    System.out.println("Connected***");
         // Create a password authentication instance
    PasswordAuthenticationClient pwd = new PasswordAuthenticationClient();
         // Get the users name
    pwd.setUsername(username);
         // Get the password
    pwd.setPassword(password);
         // Try the authentication
    int result = ssh.authenticate(pwd);
         System.out.println("ssh.authenticate(pwd):::" +result);
    System.out.println("AuthenticationProtocolState.COMPLETE:::***:" +AuthenticationProtocolState.COMPLETE);
              System.out.println("Beforet he AuthenticationProtocolState.COMPLETE ::");
         if (result == AuthenticationProtocolState.COMPLETE) {
              System.out.println("BOTH ARE SAME RESULT AND .COMPLETED*--------------");
    // The connection is authenticated we can now do some real work!
    SftpClient sftp = ssh.openSftpClient();
              sftp.put("c:/temp/Balaji.jpg");
                   System.out.println("after he AuthenticationProtocolState.COMPLETE ::");
    }catch(Exception e)
                        e.printStackTrace();
                        System.out.println("*****");
                        e.getMessage();

    You could use only Java classes without and 3rd party classes (com.sshtools.j2ssh) for doing this:
         * Upload a file to a FTP server. A FTP URL is generated with the following syntax:
         * <code>ftp://user:password@host:port/filePath;type=i</code>.
         * @param ftpServer FTP server address (incl. optional port ':portNumber').
         * @param user Optional user name to login.
         * @param pwd Optional password for <i>user</i>.
         * @param fileName Destination file name on FTP server (with optional preceeding relative path, e.g. "one/two/three.txt").
         * @param source Source file to upload.
         * @throws MalformedURLException, IOException on error.
        public void upload(String ftpServer, String user, String pwd, String fileName, File source) throws MalformedURLException, IOException {
            if (ftpServer != null && fileName != null && source != null) {
                StringBuffer sb = new StringBuffer("ftp://");
                if (user != null && pwd != null) { //need authentication?
                    sb.append(user);
                    sb.append(':');
                    sb.append(pwd);
                    sb.append('@');
                }//else: anonymous access
                sb.append(ftpServer);
                sb.append('/');
                sb.append(fileName);
                sb.append(";type=i"); //a=ASCII mode, i=image (binary) mode, d= file directory listing
                BufferedInputStream bis = null;
                BufferedOutputStream bos = null;
                try {
                    URL url = new URL(sb.toString());
                    URLConnection urlc = url.openConnection();
                    bos = new BufferedOutputStream(urlc.getOutputStream());
                    bis = new BufferedInputStream(new FileInputStream(source.getName()));
                    int i;
                    while ((i = bis.read()) != -1) { //read next byte until end of stream
                        bos.write(i);
                    }//next byte
                } finally {
                    if (bis != null) try { bis.close(); } catch (IOException ioe) { /* ignore*/ }
                    if (bos != null) try { bos.close(); } catch (IOException ioe) { /* ignore*/ }
            }//else: input unavailable
        }//upload()

  • How to use the XULRunner with JAVA Code

    Hi, all
    I have a big problem about XULRunner. I can not find a nice solution on the internet. So I have to request you to give me some ideas.
    We know the XULRunner is nice solution when we want to embed a browser into desktop program which is thunderbird, firefox and so on.
    My questions are the following:
    1. Can I execute a Java function accross the JAVASCript? We can execute javascript code in the JAVA, but I'm not sure I can do opposite it.
    2. What is javaxpcom?
    If you did program like this, please give me some ideas, thanks very much.

    I marked this as "off-topic" since it's not a Firefox support question.
    Another place for discussion related to XULRunner, besides the Mozilla community links at https://developer.mozilla.org/en-US/docs/Mozilla/Projects/XULRunner might be one of the [http://forums.mozillazine.org/ MozillaZine forums], such as the Mozilla Development forum:
    *http://forums.mozillazine.org/viewforum.php?f=27
    EDIT: I'm leaving this question open since it's about another Mozilla product and I'm escalating it to the Helpdesk in case anyone over there has a suggestion.

  • Compressing a large PDF document using command line or Java code without GUI operations

    hi,
    I have a programatically generated very large PDF file with lots of tables and cells in it. The size of the file is few MBs. Using Adobe pro, I am able to reduce the size of the PDF in KBs. I want to achive it either through a command line or using Java API without GUI interaction.
    I am using JDK1.6.
    Thanks.

    I think you need the scripting or SDK forums http://forums.adobe.com/community/acrobat
    As far as I know, Acrobat does not have command line operation

  • How to use ButeBuffer properly in java code

    hi,
    i am trying to use a bytebuffer and i don't kniow which methods allow reading its content...i need to retrieve this content in order to convert it ( byte by byte) into RGB values...so can anyone help me to do it please?

    The API documentation tells you exactly which methods are available in class java.nio.ByteBuffer.

Maybe you are looking for

  • Does encore come with the creative cloud

    I have Adobe Premier Pro CC but I cannot find Encore anywhere? Help please! Thanks, Justin

  • Day/week/Month is gray

    all buttons or tabs in the gray bar (including today/next day/week/month) are gray and can't be selected. how do i enable them?

  • BAPI/Function module for BATCH SPLIT

    Hi, is there a BAPI/Function module to enter BATCH SPLIT data in an outbound delivery. I used tcode VL02N to create an Outbound delivery(FOR an STO). I can use 'BAPI_DELIVERYPROCESSING_EXEC' to creat an Outbound delivery, but need to know what to use

  • Mapping EDI to IDoc

    hi all I need some good links for the entire mapping process from EDI to the SAP IDoc fromat. Please send me some good links or docs.This is a rather urgent requirement.

  • On preview, can i get a copy-able list of all of the notes I highlighted?

    I have a pdf file that I have benn taking notes from for a test, and I would like to print out JUST the text I highlighted, with no breaks inbetween (aka "blah blah blah" page 41 "blah blah" page 47) thanks and I will give points