How to set iframe src from java dynammically

Hi,
Iam calling a servlet from jsp and servlet calls the databse query and returns the value,
in my jsp i have ifrme, i want to change the source of iframe from java depends on the result from database , and the result must display on the iframe can any one tell me how to do this

aurelian_cl wrote:
I need to know how to set environment variables from java
I want to set from java for example the environment variable "TestVar" with the value "TestValue"!1) That functionality does not belong in an application. You're trying to set environment variables, which are global across all applications, at either the user level as a whole, or across the entire machine (system level). Or, if you're only trying to set a variable active for the current process, you don't need to do that.
2) Environment variables are not a platform-independent entity, and are thus against the nature of Java.
My gut feel is that you are designing something in a backwards way, so my point is mainly to point that out, not to try to help you solve that particular problem.

Similar Messages

  • How to set proxy authentication using java properties at run time

    Hi All,
    How to set proxy authentication using java properties on the command line, or in Netbeans (Project => Properties
    => Run => Arguments). Below is a simple URL data extract program which works in absence of firewall:
    import java.io.*;
    import java.net.*;
    public class DnldURLWithoutUsingProxy {
       public static void main (String[] args) {
          URL u;
          InputStream is = null;
          DataInputStream dis;
          String s;
          try {
              u = new URL("http://www.yahoo.com.au/index.html");
             is = u.openStream();         // throws an IOException
             dis = new DataInputStream(new BufferedInputStream(is));
             BufferedReader br = new BufferedReader(new InputStreamReader(dis));
          String strLine;
          //Read File Line By Line
          while ((strLine = br.readLine()) != null)      {
          // Print the content on the console
              System.out.println (strLine);
          //Close the input stream
          dis.close();
          } catch (MalformedURLException mue) {
             System.out.println("Ouch - a MalformedURLException happened.");
             mue.printStackTrace();
             System.exit(1);
          } catch (IOException ioe) {
             System.out.println("Oops- an IOException happened.");
             ioe.printStackTrace();
             System.exit(1);
          } finally {
             try {
                is.close();
             } catch (IOException ioe) {
    }However, it generated the following message when run behind the firewall:
    cd C:\Documents and Settings\abc\DnldURL\build\classes
    java -cp . DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
    at java.net.Socket.connect(Socket.java:452)
    at java.net.Socket.connect(Socket.java:402)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
    at sun.net.www.http.HttpClient.New(HttpClient.java:339)
    at sun.net.www.http.HttpClient.New(HttpClient.java:320)
    at sun.net.www.http.HttpClient.New(HttpClient.java:315)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:510)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:487)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:615) at java.net.URL.openStream(URL.java:913) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    I have also tried the command without much luck either:
    java -cp . -Dhttp.proxyHost=wwwproxy -Dhttp.proxyPort=80 DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.io.IOException: Server returned HTTP response code: 407 for URL: http://www.yahoo.com.au/index.html
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1245) at java.net.URL.openStream(URL.java:1009) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    All outgoing traffic needs to use the proxy wwwproxy (alias to http://proxypac/proxy.pac) on port 80, where it will prompt for valid authentication before allowing to get through.
    There is no problem pinging www.yahoo.com from this system.
    I am running jdk1.6.0_03, Netbeans 6.0 on Windows XP platform.
    I have tried Greg Sporar's Blog on setting the JVM option in Sun Java System Application Server (GlassFish) and
    Java Control Panel - Use browser settings without success.
    Thanks,
    George

    Hi All,
    How to set proxy authentication using java properties on the command line, or in Netbeans (Project => Properties
    => Run => Arguments). Below is a simple URL data extract program which works in absence of firewall:
    import java.io.*;
    import java.net.*;
    public class DnldURLWithoutUsingProxy {
       public static void main (String[] args) {
          URL u;
          InputStream is = null;
          DataInputStream dis;
          String s;
          try {
              u = new URL("http://www.yahoo.com.au/index.html");
             is = u.openStream();         // throws an IOException
             dis = new DataInputStream(new BufferedInputStream(is));
             BufferedReader br = new BufferedReader(new InputStreamReader(dis));
          String strLine;
          //Read File Line By Line
          while ((strLine = br.readLine()) != null)      {
          // Print the content on the console
              System.out.println (strLine);
          //Close the input stream
          dis.close();
          } catch (MalformedURLException mue) {
             System.out.println("Ouch - a MalformedURLException happened.");
             mue.printStackTrace();
             System.exit(1);
          } catch (IOException ioe) {
             System.out.println("Oops- an IOException happened.");
             ioe.printStackTrace();
             System.exit(1);
          } finally {
             try {
                is.close();
             } catch (IOException ioe) {
    }However, it generated the following message when run behind the firewall:
    cd C:\Documents and Settings\abc\DnldURL\build\classes
    java -cp . DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
    at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
    at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
    at java.net.Socket.connect(Socket.java:452)
    at java.net.Socket.connect(Socket.java:402)
    at sun.net.NetworkClient.doConnect(NetworkClient.java:139)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:402)
    at sun.net.www.http.HttpClient.openServer(HttpClient.java:618)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:306)
    at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
    at sun.net.www.http.HttpClient.New(HttpClient.java:339)
    at sun.net.www.http.HttpClient.New(HttpClient.java:320)
    at sun.net.www.http.HttpClient.New(HttpClient.java:315)
    at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:510)
    at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:487)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:615) at java.net.URL.openStream(URL.java:913) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    I have also tried the command without much luck either:
    java -cp . -Dhttp.proxyHost=wwwproxy -Dhttp.proxyPort=80 DnldURLWithoutUsingProxy
    Oops- an IOException happened.
    java.io.IOException: Server returned HTTP response code: 407 for URL: http://www.yahoo.com.au/index.html
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1245) at java.net.URL.openStream(URL.java:1009) at DnldURLWithoutUsingProxy.main(DnldURLWithoutUsingProxy.java:17)
    All outgoing traffic needs to use the proxy wwwproxy (alias to http://proxypac/proxy.pac) on port 80, where it will prompt for valid authentication before allowing to get through.
    There is no problem pinging www.yahoo.com from this system.
    I am running jdk1.6.0_03, Netbeans 6.0 on Windows XP platform.
    I have tried Greg Sporar's Blog on setting the JVM option in Sun Java System Application Server (GlassFish) and
    Java Control Panel - Use browser settings without success.
    Thanks,
    George

  • How to execute Linux command from Java app.

    Hi all,
    Could anyone show me how to execute Linux command from Java app. For example, I have the need to execute the "ls" command from my Java app (which is running on the Linux machine), how should I write the codes?
    Thanks a lot,

    You can use "built-in" shell commands, you just need to invoke the shell and tell it to run the command. See the -c switch in the man page for your shell. But, "ls" isn't built-in anyays.
    If you use exec, you will want to set the directory with the dir argument to exec, or add it to the command or cmdarray. See the API for the variants of java.lang.Runtime.exec(). (If you're invoking it repeatedly, you can most likely modify a cmdarray more efficiently than having exec() decompose your command).
    You will also definitely want to save the returned Process and read the output from it (possibly stderr too and get an exit status). See API for java.lang.Process. Here's an example
    java.io.BufferedReader br =
    new java.io.BufferedReader(new java.io.InputStreamReader(
    Runtime.getRuntime().exec ("/sbin/ifconfig ppp0").
    getInputStream()));
    while ((s = br.readLine()) != null) {...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Help! How to convert an instance from java.lang.Object to a particula class

    * How to convert an instance from java.lang.Object class to a particular class
    witch is known only at the running time?
    Roster EJB component is make up of RosterHome, Roster and RosterBean.
    RosterHome is the home interface of Roster EJB.
    Roster is the remote interface of Roster EJB.
    RosterBean is the implement of Roster EJB.
    The following code segment is to invoke Roster EJB component.
    String jndiName="roster.RosterHome";
    javax.naming.Context initial = getInitialContext();//getInitialContext() returns a instance of Context.
    Object objref = initial.lookup(jndiName);
    RosterHome home =
    (RosterHome)javax.rmi.PortableRemoteObject.narrow(objref,
    RosterHome.class);
    Roster myRoster = home.create();
    String team="T1"
    String player="Tom"
    myRoster.addPlayer(player,team);
    But, now, all the home interface, the remote interface and the JNDI Name of
    Roster EJB component are not been known at the compiling time. However They are
    known at the running time, throught reading from the XML config file.
    Questions:
    1,How to write code for this case ? or
    2,How to convert an instance from Object class to a particular class witch is known
    only at the running time?
    String jndiName="roster.RosterHome";// in fact, reads from XML file.
    String homeClassName="roster.RosterHome";// in fact, reads from XML file.
    String remoteClassName="roster.Roster";// in fact, reads from XML file.
    javax.naming.Context initial = getInitialContext();//getInitialContext() returns a instance of Context.
    Object objref = initial.lookup(jndiName);
    Object objHome= javax.rmi.PortableRemoteObject.narrow(objref,
    Class.forName(homeClassName));
    /* how to do next?
    }

    I am not sure what you are trying to do. But at some point you should know which methods to call on the remote interfaces. Maybe the method names are stored in the XML file as well or you have a set of standard method names (also consider parameters).
    However, this can be solved by reflection. Look at the java.lang.reflect package, especially java.lang.reflect.Method, and also at java.lang.Class.
    If you are doing this on the app server:
    I've seen posts where people say that reflection is not permitted in EJB, but I don't think so. Check the EJB spec.
    If you are doing this in an application: reflection is always permitted. Probably also in applets and JSP.

  • How to set a language from LTR to RTL in illustrator cs4

    how to set a language from LTR to RTL in illustrator cs4.....plz help

    Mac or PC
    In either case the language has to be selected on the Mac go to the SystemPreference and language and text and select arabic as the language etc.
    That should do it.
    Oh, yes just in case you have to also select and arabic type face and it helps if you have a ME computer.

  • TS4006 how to set a tracking from the computer if someone stolen the ipod

    how to set a tracking from the computer if someone stolen the ipod

    Welcome to the Apple Community.
    You can only locate your device when it is logged into iCloud and 'Find My Phone' is enabled, additionally the device will need to be switched on and connected to a wifi or cellular network.
    Unfortunately, you cannot activate iCloud or 'Find My Phone' remotely.

  • How to Create adf table from java bean

    Hi,
    How to Create adf table from java class (Not from ADF BC).
    Thanks
    Satya

    @vlsn -- you have to follow what shay said.
    Do the following in Model layer ::
    create a table property java class with your columns setters and getters like :
    *public class gridProps {*
    private int sno;
    private String orderNum;
    *public void setSno(int sno) {*
    this.sno = sno;
    *public int getSno() {*
    return sno;
    *public void setOrderNum(String orderNum) {*
    this.orderNum = orderNum;
    *public String getOrderNum() {*
    return orderNum;
    Create another table java class which will populate the values to your column values and return the collection :
    *public class gridPopulate {*
    private  List<gridProps> gridValues ;
    *public List<gridProps> setToGrid(ArrayList<ArrayList> valuesToSet) {*
    *if (valuesToSet == null) {*
    return gridValues;
    gridValues = new ArrayList<gridProps>();
    if(btnValue.equals("completeBtn"))
    return gridValues;
    for(ArrayList<String> tempArr:valuesToSet)
    gridProps gp = new gridProps();
    gp.setSno(Integer.valueOf(tempArr.get(0)));
    gp.setOrderNum(tempArr.get(1));
    return gridValues;
    Right click gridPopulate class and create this as data control.This class will be seen in Data control list.Under this data control,Drag the grid property collection(created earlier) to your page.Then execute your binding(gridPopulate) according to your logic.
    Thanks.(My jdev version 11.1.1.5.0)

  • How to call gnuplot command from java

    Hi there,
    In our course, we are required to develop an GUI for gnuplot. In case you don't know about gnuplot, it's a plotting program and has lots of command. We want to use java and swing, but now we don't know how to call gnuplot command from java, or how to execute a shell command(script) from java.
    By the way, since we need read in files with several columns of data and allow user to select a column, we want to use JTable. Is that reasonable?
    Thanks a lot for any suggestions!
    Jack

    Hi, there:
    Will using JTable add much overhead? I may have to use several JTables and switch among them. I can add scroll bar to or edit JTables, right?
    BTW, do you have experience about gnuplot? Can I find the command tree of gnuplot somewhere? Or do you know a better place to post question about gnuplot? unix/linux group, maybe.
    Thanks,
    Jack
    P.S. Would you guys answer my question after I use up my duke dollars? :- )

  • How to set up printer from ipad?

    how to set up printer from ipad?
    Johs.

    iOS AirPrint Printers  http://support.apple.com/kb/HT4356
    How to Print from Your iPad: Summary of Printer and Printing Options
    http://ipadacademy.com/2012/03/how-to-print-from-your-ipad-summary-of-printer-an d-printing-options
    Print from iPad / iPhone without AirPrint
    http://ipadhelp.com/ipad-help/print-from-ipad-iphone-without-airprint/
    How to Enable AirPrint on a Mac and Use Any Printer
    http://ipadhelp.com/ipad-help/how-to-use-airprint-with-any-printer/
     Cheers, Tom

  • How to invoke BPEL process from JAVA API

    Hi Guys
    Any idea if you can tell me how to invoke BPEL process from JAVA API ?
    What to do in BPEL process manager to achieve that?
    Regards
    Deepak

    See http://download-west.oracle.com/docs/cd/B31017_01/integrate.1013/b28981/invoke.htm#sthref1373 and the JavaDocs http://download-west.oracle.com/docs/cd/B31017_01/integrate.1013/b28986/toc.htm.

  • How to Link to MATLAB from java?

    Hi
    Anyone knows how to link to MATLAB from java? I am programming in Java (Eclipse) and I want to link to MATLAB.
    Thanks,
    Bing

    Hi, there:
    Will using JTable add much overhead? I may have to use several JTables and switch among them. I can add scroll bar to or edit JTables, right?
    BTW, do you have experience about gnuplot? Can I find the command tree of gnuplot somewhere? Or do you know a better place to post question about gnuplot? unix/linux group, maybe.
    Thanks,
    Jack
    P.S. Would you guys answer my question after I use up my duke dollars? :- )

  • How to terminate an exe from Java

    Hi Everyone
    Can anyone let me know the code to how to terminate an exe from Java
    I run an exe using
    Runtime.getRuntime().exec(dialog); //where dialog is a string (pointing to an exe)
    Now i need to kill this exe
    How do i do this in java
    Any help is highly appreciated
    Thanks!

    getafix14 wrote:
    I run an exe using Runtime.getRuntime().exec(dialog); //where dialog is a string (pointing to an exe)
    Now i need to kill this exe
    How do i do this in java
    ejp wrote:
    Process.destroy();
    And don't forget to take a swig of magic potion first.
    Winston

  • How to set variable to run java and j2ee

    how to set variable to run java and j2ee

    Please ask a specific and comprehensible question. Consider describing with less vagueness the actual current problem that you are encountering.

  • How to run ODI scenario from java?

    I am new to java, need to do some testing on how to invoke ODI scenarios from java.
    Can somebody drop me some simple code?
    Thanks a lot,
    Lei

    Hi there
    1. Start your agent (double click agent.bat)
    2. generate scenario for ur package(right click ur package , select generate scenario)
    3. Add the odi-sdk-invocation.jar file to your java project
    ODIcmdScenario=new OdiCommandScenario();
    ODIConnection=new OdiRepositoryConnection();
    ODIConnection.setOdiUser("ur-username");
    ODIConnection.setOdiPassword("ur-password");
    ODIConnection.setJdbcDriver("Driverdetail");
    ODIConnection.setJdbcUrl("url-details");
    ODIConnection.setJdbcUser("dbusername");
    ODIConnection.setJdbcPassword("dbpass");
    ODIcmdScenario.setScenName("scenarioname");
    ODIcmdScenario.setScenVersion("scenarioversion");
    ODIcmdScenario.setLogLevel(5);
    ODIcmdScenario.setContext("context");
    ODIConnection.setWorkRepositoryCode("repository");
    ODIInvocation = new OdiInvocation("hostname", 20910); //20910 default port
    OdiInvocationResult result=ODIInvocation.invokeCommand(ODIcmdScenario,ODIConnection);
    Hope this helps!
    Cheers

  • Weblogic, how to reload trust keystore from java appliacation?

    I have application, which add and delete certificates from trust keystore from java code using the keytool command line (like "keytool -delete -keystore trust.jks -storepass password -alias test").
    But weblogic loaded certificates from this keystore only one tame - during startup.
    How can i reload trust keystore programmaticaly?
    I try same trick to restart https listener by set/reset "CustomTrustKeyStoreType" attribute using JMX:
                ctx = new InitialContext();
                MBeanServer server = (MBeanServer)ctx.lookup("java:comp/env/jmx/runtime");
                ObjectName objName = new ObjectName("com.bea:Name=" + serverName + ",Type=Server");
                String pathJKS = (String) server.getAttribute(objName, "CustomTrustKeyStoreFileName");
                System.out.println(pathJKS);
                server.setAttribute(objName, new javax.management.Attribute("CustomTrustKeyStoreFileName", null));but get error: javax.management.AttributeNotFoundException: Attribute is readonly.
    Any other ideas also are welcome.
    JDeveloper 11.1.1.5.0, Weblogic 10.3.5.0

    Some description purpose of this action. I realize the two-way ssl connection.
    At first I wanted to sign client certificates by self-signed "MyOwnCA" certificate, but there was a troubles with revoked certificates - i cant find how it realised in WebLogic without truth CA. Therefore I have decided to put self-signed client certificates in trusted keystore. If certificate is compromised - it delete from keystore, without CRL processing.

Maybe you are looking for

  • My Apple TV is no longer showing any of my purchased movies or TV shows

    My Apple TV is not showing any of the movies or TV shows that I purchased.  They used to be there under the "Purchased" section of movies and TV shows, but now the list is empty.  How can I get them to show up again?

  • Is there an equivalent of CSS technology in flash?

    Hi At the very outset let me apologize if my question is not in the right group here. Just like how one can use different CSS files to view the same text rendered differently in HTML. I would like to find how to do the same with Flash. My goal is to

  • Problem with output format

    Hi , Whle submitting AP prepayment balance report able to get the output in XML format. But, if for the same report when the output format is changed to PDF or Text not able to get the report. Anybody pls suggest any changes to be done in setup to re

  • Optimizing an sql query

    Hi all, I guess the issue with huge tables won't end :(, I have a table with 100 millions rows (1 unique index, 2 timestamps column and 15 numbers), I have to backuo this table, is it faster to just copy it into another table or export it into a dump

  • Budget Vs Actual report for FM

    Hi SAP FM Gurus We had implemented BCS in ECC 6.0. We are able to get the availability control for the commitment item & fund centre through the release procedure for specific periods. In the above said situtaion, we are facing the following issues.