Embedding a java application (servlets) in a portlet

Hi all,
We have an existing java application that we want to run as a portlet in our portal internet site. The application is a simple search form, which submits parameters (search criteria) and returns results, from there can click on a few other things and open some documents etc. We want all this to happen in the same portlet window, rather than opening out to a new window. Can someone please advise if this can be done? We are running release 1 of 9IAS (and we can't upgrade to rel 2 yet) with PDK March. We would preferably like to do this without touching/reprogramming the java code. I have seen a couple of conficting posts in this forum about this - some say can be done, some say can't be done. Please advise:
1. Is there some kind of wrapper that can be applied to keep this app inside the portlet?
2. What other alternatives are there to getting this java app inside?
3. Are there any step by step guides to doing this?
Any help would be much appreciated. Thanks heaps, Sarah

I have tried the URL services, it displays the page fine within the portlet. Just one problem though. The links that are embedded in the HTML will open new windows when clicked. We want them to stay within the portlet. Does something need to be changed in my xml file? I have
<renderer class="oracle.portal.provider.v1.RenderManager">^M
<showPage class="oracle.portal.provider.v1.http.URLRenderer">^M
<contentType>text/html</contentType>^M
<pageExpires>60</pageExpires>^M
<pageUrl>http://www.oracle.com</pageUrl>^M
<filter class="oracle.portal.provider.v1.http.HtmlFilter">^M
<headerTrimTag>&lt;center</headerTrimTag>^M
<footerTrimTag>/center></footerTrimTag>^M
<convertTarget>true</convertTarget>^M
</filter>^M
</showPage>^M
</renderer>^M
perhaps I need a different renderer? I saw another post had something in the xml :
<inlineRendering>true</inlineRendering>
that looks promising. Will that deliver the results I'm looking for? Where does it get added?
Thanks for any replies. Sarah

Similar Messages

  • Compile java applications,servlets etc.

    I am a newbie to java...what do i need to compile java applications,servlets etc.

    first you need java developers kit(jdk)
    download it
    then r.click on my computer and take it's properties
    go to advance properties
    go to envirinment variable
    set variables
    JAVA_HOME set to directory where you installed jdk
    CLASS_PATH set to the bin in your jdk
    then write a java class and save somewhere as .java file
    go to command prompt
    change directory to where you save java class
    and use javac (yourjavafilename) .java command to compile it
    wish you all the best

  • Embedded Tomcat Java Application

    Hi
    I am using an Embedded Tomcat Java Application.
    I am getting the following Exception when i run the program.
    java.lang.NullPointerException
         at org.apache.catalina.startup.DigesterFactory.register(DigesterFactory.java:174)
         at org.apache.catalina.startup.DigesterFactory.registerLocalSchema(DigesterFactory.java:130)
         at org.apache.catalina.startup.DigesterFactory.newDigester(DigesterFactory.java:92)
         at org.apache.catalina.startup.ContextConfig.createWebXmlDigester(ContextConfig.java:435)
         at org.apache.catalina.startup.ContextConfig.createWebDigester(ContextConfig.java:422)
         at org.apache.catalina.startup.ContextConfig.defaultConfig(ContextConfig.java:499)
         at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:623)
         at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:216)
         at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4290)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
         at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
         at org.apache.catalina.startup.Embedded.start(Embedded.java:846)
         at EmbeddedTomcat.startTomcat(EmbeddedTomcat.java:77)
         at EmbeddedTomcat.main(EmbeddedTomcat.java:135)
    could anyone tell me how to solve this problem
    Thanx & Regards
    Faisal

    Hi
    R u able to resolve the problems.... If yes please provide me the info... I'm also facing the same problem...
    REgards
    siddhu

  • Vst embedded in java application?

    hi
    I am writing here because I was redirected.
    I would like to know if it is possibile and where to find information and resources to do this:
    calling a vst virtual instrument from a java application displaying it in a frame and controlling it by calls.
    thanks

    vst is for "virtual instrument", a technology from steinberg.
    this kind of programs are dlls and are used in sequencer environments like cubase.
    a vst is a dll file that cubase or this sort of software can load and communicate with by function calls. it has a gui too to tweak its parameters.
    so, I ask someone who knows how all this work to please help with some information.
    thanks

  • Embedding video in Java Application

    I'm a total newbie, trying to decide if Java is the way to go for our application.
    We want to be able to create an interactive application with buttons, drag & drop, data input fields, hot spots, etc
    AND also show video... windows format, apple format, flash format.
    We want our application to be deployable either as...
    1 - a standalone app... running on a system not on a network or the internet
    2 - a web app
    We want the video player to be embedded in the application and not launch a player in a seperate window... thus we want to maintain as much control within the confines of our application as possible.
    MY QUESTIONS:
    1 - Will the Java Media Framework allow us to embed movies in our application as described?
    2 - Is it fairly easy to code such in our Java application?
    3 - Any code snippets around?
    4 - Re: Standalone/CD distribution version: Can the JMF be installed along with the application so the client doesn't have to "go out and install more stuff" ??
    5 - Re: Web - must the user download and install more stuff... other than the Java Virtual Machine to have the JMF work on their system?
    6 - Is the JMF multi-platform... Windows, Apple, Unix/Linux, etc like the JVM ?
    thanks for any help on this. Will

    Yes all of what you require is doable in Java
    Try
    http://java.sun.com/products/java-media/jmf/2.1.1/solutions/index.html
    Check some of these samples
    Also for a web version check
    http://java.sun.com/dev/evangcentral/totallytech/jmf2.html
    (Haven't studied this myself - but should give you an idea or two)
    Platform-wise - check here
    http://java.sun.com/products/java-media/jmf/2.1.1/download.html
    In terms of CD distribution - you should be able to package most stuff into a Jar file
    Not completely sure as there are 'Windows Performance pack' downloads which I think toake advantage of native DLLs
    Have a read around the JMF Installation pages - should answer most of your questions

  • Calling Java application from servlet

    Hi !
    I'm trying to run a Java application from within a servlet with Tomcat 4. I'm using the Runtime.getRuntime ().exec () method. So the application is run in a different JVM as a subprocess of the servlet. I use ObjectInputStream and ObjectOutputStream and a serializable object to enable communication between the servlet and the application.
    I tested the application and the serializable object with another Java application that works as the caller and it works fine. However, replacing the caller application with the servlet I get a StreamCorruptedException. The structure of the caller application and the servlet is the same.
    My questions are:
    - Is there something I should configure in Tomcat to create a subprocess ?
    - What is the cause of the StreamCorruptedException ? How do I get it with the servlet and not with the application ?
    - Should I use an environment with the call to Runtime.getRuntime ().exec () ? How do I use it ?
    - Is the called application forced to run in my servlet's context ?
    - Is there a better way to do this ?
    Thanks to all

    Here's my code:
    1. The serializable object:
    // Object Obj
    import java.io.*;
    public class Obj implements Serializable
    public int n;
    public Obj ()
    n = 0;
    public Obj (int n)
    this.n = n;
    public String toString ()
    return getClass ().getName () + " -> (n = " + n + ")";
    2. The application Sub (subprogram)
    // Application Sub
    import java.io.*;
    public class Sub
    private static File f;
    private static FileWriter fw;
    public static void main (String [] args)
    throws IOException, InterruptedException, ClassNotFoundException
    ObjectInputStream ois;
    ObjectOutputStream oos;
    Obj obj;
    ois = new ObjectInputStream (System.in);
    obj = (Obj) ois.readObject ();
    f = new File ("Sub.txt");
    fw = new FileWriter (f);
    fw.write (obj.toString ());
    fw.close ();
    oos = new ObjectOutputStream (System.out);
    oos.writeObject (obj);
    ois.close ();
    oos.close ();
    3. The application AMain (caller application)
    // Application AMain
    import java.io.*;
    class AMain
    private static File f;
    private static FileWriter fw;
    public static void main (String [] args)
    throws IOException, ClassNotFoundException
    Runtime r;
    Process p;
    ObjectInputStream ois;
    ObjectOutputStream oos;
    Obj obj, obj2;
    r = Runtime.getRuntime ();
    p = r.exec ("java Sub");
    oos = new ObjectOutputStream (p.getOutputStream ());
    obj = new Obj (5);
    oos.writeObject (obj);
    oos.flush ();
    B.comunica (obj);
    System.out.println ("AMain sends to Sub: " + obj.toString ());
    try
    p.waitFor ();
    catch (InterruptedException e)
    System.out.println ("Subprogram was interrupted");
    System.out.println (e.toString ());
    ois = new ObjectInputStream (p.getInputStream ());
    System.out.print ("Sub sends to AMain: ");
    obj2 = (Obj) ois.readObject ();
    System.out.println (" " + obj2.toString ());
    oos.close ();
    ois.close ();
    p.destroy ();
    4. The servlet SMain (the calling servlet)
    // Servlet SMain
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    public class SMain extends HttpServlet
    public void doPost (HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException
    Runtime r;
    Process p;
    ObjectInputStream ois;
    ObjectOutputStream oos;
    Obj obj, obj2;
    int state, i;
    res.setContentType ("text/html");
    ServletOutputStream out = res.getOutputStream ();
    out.println ("<html>");
    out.println ("<head><title>Sub</title></head>");
    out.println ("<body>");
    out.println ("Invoking subprogram...");
    out.println ("<br>");
    try
    r = Runtime.getRuntime();
    p = r.exec ("java -cp .;c:\\Programs\\Apache~1.0\\webapps\\SMain\\WEB-INF\\classes Sub");
    out.println ("...invoked<br>");
    oos = new ObjectOutputStream (p.getOutputStream ());
    obj = new Obj (5);
    oos.writeObject (obj);
    oos.flush ();
    out.println ("<br>SMain sends to Sub: " + obj.toString () + "<br>");
    try
    p.waitFor ();
    catch (InterruptedException e)
    out.println ("<br>Subprogram was interrupted<br>");
    out.println ("<br>" + e.toString () + "<br>");
    state = p.exitValue ();
    out.println ("<br>Subprogram state: " + state + "<br>");
    ois = new ObjectInputStream (p.getInputStream ());
    out.print ("<br>Sub sends to SMain: ");
    obj2 = (Obj) ois.readObject ();
    p.destroy ();
    catch (SecurityException e)
    out.println ("<br>SecurityException<br>");
    out.println ("<br>" + e.toString () + "<br>");
    catch (IOException e)
    out.println ("<br>IOException<br>");
    out.println ("<br>" + e.toString () + "<br>");
    catch (Exception e)
    out.println ("<br>Exception<br>");
    out.println ("<br>" + e.toString () + "<br>");
    out.println ("</body>");
    out.println ("</html>");
    So, as you can see, both application AMain and servlet SMain invoke application Sub and pass it the serializable object Obj. Oddly enough, application AMain works fine whereas servlet SMain throws a StreamCorruptedException exception.
    johnpoole said:
    �It's hard to guess what would cause the exception without seeing code, but the interaction between the processes would differ from that between two applications, because the servlet process is started with a different class loader. I'm not sure which one the jvm started by the call would use.�
    How can I enforce that a System classloader be used in the call to Runtime.getRuntime ().exec () ? (I mean by System classloader a classloader equals to the one applications are launched from console).
    johnpoole said
    �Is there a reason why you aren't starting the second process manually and then connecting to it on a port?�
    The idea is providing a Web interface for an application running in the server. The servlet is used to restrict access to this application but once access is granted (passing the servlet) the application should not be constrained.

  • Pl help ! ! Opening a servlet URL using stand aline java application

    Hi Guys, I have a standalone java application. This application will get executed after some by some thread. What I want to do is when this java application is executed, automatically open a URL in internet explorer which is of my servler/jsp and pass the parameters to this servlet/jsp. This servler jsp will intern use EJB and other services to get the data and display it.
    How should I automatically open a IE window and pass parameters using this standalone application.
    Pl help ! ! !
    thanks , Ava

    do you want to open internet explorer, or just access the servlet without internet explorer?
    if you want to use internet explorer, you'd want to use
    Runtime.exec,
    if you want to access the Servlet w/o ie, you would use
    URL, and HttpURLConnection classes

  • Steps to execute servlets on Sun Java Application Server

    Hi
    Could u tell me how to deploy servlets files and how to execute
    In specs. the ask us to start cloudscape database server
    In my Sun Java Application Server installations, i am not find even a single name as cloudscape
    Please anyone guide me get the servelts to execute
    thank u

    What specs do you refer to?
    Sun Java System Application Server does not include Cloudscape, nor is it required. SJSAS does include a development copy of Pointbase DB Server.
    To deploy your servlet application you will need to package them into a WAR file (Web Archive). Then you can either use asadmin CLI or the admin gui to deploy the WAR. The steps are included here: http://docs.sun.com/source/816-7150-10/dwdeploy.html
    Now I'm going to assume you application uses Cloudscape. To get that piece running you will need to download and install Cloudscape. You will also need the JDBC drivers for Cloudscape. Copy the JDBC driver jar file to either the <serverinstancedir>/lib directory or modify the JVM settings to include that jar file. Restart the Application Server. You will also need to add a JDBC Resource & Connection Pool. In the admin, create a new connection pool (probably called Cloudscape). Use the appropriate settings for classname and add any additional properties that are necessary (Usually URL, User, Password). Now create a JDBC Resource using that Connection Pool. Make sure the JNDI name matches what your application expects.
    Now just access the URL for the application
    -Jeff

  • Embedding Internet Explorer GUI in Java Application

    let me preface this post by saying that i have seen the javatip66 reference on javaworld.com and that has considerable merit. i may end up using that methodology.
    what i would like to be able to do, of course, is to embed JUST the "HTML pane" of IE/Netscape (excluding ToolBar and Address Bar, etc) inside a Java application. i am not an MFC developer, so i'm not sure where to begin looking or if JNI will allow me to hack that dll.--or even if that canvas/panel/whatever can be invoked independently to render a document.
    i have several complete, fully working GUI applications that use the javax.swing.JEditor interfaces to display various mime formatted documents (content types such as "text/html" and "text/plain"). unfortunately, the Java implementations of these Editors don't sync with what everyone is used to in IE/Netscape...to the degree that content is intractably mis-displayed (is that a word?)
    worst case scenario, i will invoke a new browser to display content, but i would prefer to frame those browsers in my applications. thoughts?
    note: one of the primary problems is the the JFC classes support only up to HTML 3.2 which is as good as archaic these days.

    i think you just nailed it. i do imagine that this is the correct forum for this, but i could cross-post to the Swing forum. certainly it is going to require switching on the version of Windows. perhaps we can find a general/create a discussion on integrating ActiveX controls in Java. [man, this is just the most bass ackwards thing ever. hate doing this kind of thing, but it's the "state of the world."] (at least until Sun/3rd party gets a reasonable HTML document renderer.)

  • Embedding Google earth in Java Application

    I have developed a java application with help of wings i wanna embed google earth can sum1 guide from were to proceed plz

    Hitish wrote:
    I have developed a java application with help of wings i wanna embed google earth can sum1 guide from were to proceed plzPlease don't use silly SMS speak.
    Embed Google Earth? Does it have any exposed APIs. If not then no.

  • Embedding JBoss Naming In My Own Java Application

    Hi all,
    Thanks in advance for taking the time and effort to answer my question.
    I'm trying to embed the JBoss naming server in my own Java application. I'm using the code from version 4.2.1.GA. I've thoroughly read the Java code, and found it a little confusing. Among other classes, I've read the code from org.jboss.naming.NamingService and org.jnp.server.Main. I've been trying for days with no luck. Here's a class from my simplest attempt:
    // Server.java
    package miaJs.server;
    import org.apache.log4j.Logger;
    import org.jboss.naming.NamingService;
    import org.jnp.server.Main;
    import org.quartz.Scheduler;
    import org.quartz.SchedulerException;
    import org.quartz.impl.StdSchedulerFactory;
    public class Server
    * Logger for this class.
    private static final Logger logger =
    Logger.getLogger("miaJs.server.Server");
    * Start the server.
    public void start()
    logger.debug("Server ClassLoader: " +
    this.getClass().getClassLoader().getClass().getName());
    try
    logger.debug("Starting JBoss naming server...");
    Main namingServer = new Main();
    namingServer.start();
    catch (Throwable t)
    logger.error("Error starting Java Job Scheduler: " +
    t.getMessage(),
    t);
    System.exit(1);
    try
    // Register a shutdown hook
    ServerShutdownHook shutdownHook = new ServerShutdownHook();
    Runtime.getRuntime().addShutdownHook(shutdownHook);
    catch (Throwable t)
    logger.error("Error adding server shutdown hook: " +
    t.getMessage(),
    t);
    System.exit(1);
    The above example gives me the following NullPointerException:
    lljava.lang.NullPointerException
    jvm 1 | at org.jnp.server.Main.getNamingInstance(Main.java:301)
    wrapper | Pause reading child output to share cycles.
    wrapperp | socket read failed. (An established connection was aborted by the software in your host machine. (0x2745
    jvm 1 | at org.jnp.server.Main.initJnpInvoker(Main.java:354)
    jvm 1 | at org.jnp.server.Main.start(Main.java:316)
    jvm 1 | at miaJs.server.Server.start(Server.java:45)
    jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    jvm 1 | at java.lang.reflect.Method.invoke(Method.java:585)
    wrapper | Pause reading child output to share cycles.
    wrapperp | server listening on port 32000.
    jvm 1 | at miaJs.server.Bootstrap.start(Bootstrap.java:135)
    jvm 1 | at miaJs.server.Bootstrap.main(Bootstrap.java:76)
    jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    jvm 1 | at java.lang.reflect.Method.invoke(Method.java:585)
    jvm 1 | at org.tanukisoftware.wrapper.WrapperStartStopApp.run(WrapperStartStopApp.java:238)
    jvm 1 | at java.lang.Thread.run(Thread.java:595)
    I've tried the JBoss forum but it didn't help.
    What I really want is a simple in-memory JNDI server that doesn't have external dependencies. I really hope the JBoss naming service can achieve this.
    Thanks again.

    I'm sorry, we don't generally have that kind of information in this forum. I'd suggest asking the developer of the add-on. If you're using [https://addons.mozilla.org/en-us/firefox/addon/selenium-expert-selenium-ide/ Selenium Expert (Selenium IDE)], the support link listed is http://blog.reallysimplethoughts.com/

  • Trying to do the simple HelloWorld java application for portal

    Hi:
    i've been trying to do the simple java application HelloWorld so that i can get a view of how will it be to integrate a pure java application that we have in a later step. The fact is that i've been following "how to build a java portlet" and "packaging and deploying your provider" documents.
    i've taken the code from that document:
    public class HelloWorldApp {
    public static void main (string[] args){
    //Display "Hello World!"
    System.out.println("Hello World!");
    That's my java code. (in fact i want to do this as a trial, 'cause later i will
    do the same with a java application of our own).
    So i compiled it, taken the .class, jar it and packaged it as told in the
    second document.
    I've deployed it in OC4J_portal and when i try to access the URL i get an
    error:
    500 Internal Server Error
    java.lang.NoSuchMethodException
         at java.lang.Class.getMethod0(Native Method)
         at java.lang.Class.getMethod(Class.java:888)
         at oracle.portal.provider.v2.render.http.JavaRenderer.postInitialize(Unknown Source)
         at oracle.portal.utils.xml.v2.DefaultNodeHandler.invokePostInitialize(Unknown Source)
         at oracle.portal.utils.xml.v2.DefaultNodeHandler.processNode(Unknown Source)
         at oracle.portal.utils.xml.v2.DefaultNodeHandler.processNode(Unknown Source)
         at oracle.portal.utils.xml.v2.DefaultNodeHandler.processNode(Unknown Source)
         at oracle.portal.provider.v2.http.DefaultProviderLoader.getProviderDefinition(Unknown Source)
         at oracle.portal.provider.v2.http.DefaultProviderLoader.init(Unknown Source)
         at oracle.webdb.provider.v2.adapter.soapV1.ProviderAdapter.init(Unknown Source)
         at oracle.webdb.provider.v2.utils.soap.SOAPProcessor.locateService(Unknown Source)
         at oracle.webdb.provider.v2.adapter.SOAPServlet.doHTTPCall(Unknown Source)
         at oracle.webdb.provider.v2.adapter.SOAPServlet.service(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
         at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:59)
         at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
         at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:523)
         at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:269)
         at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:735)
         at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.AJPRequestHandler.run(AJPRequestHandler.java:151)
         at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].util.ThreadPoolThread.run(ThreadPoolThread.java:64)
    does anybody know how to solve this problem?
    Thx.
    Regards. Urko.

    Hi Urko,
    Such an application as you have quoted will not have much luck as a Portlet - the code you supplied simply writes "Hello World" to standard out!
    Think of a portlet more like a servlet - you have an output stream to write to which, under the covers, is wired back up to the Portal Server which assembles the content into the page seen in the browser.
    Take a look at the extensive range of sample Java Portlets available with the PDK download.
    Anyway, from the stack trace it looks like you're using JavaRenderer. JavaRenderer invokes an arbitrarily named method on an arbitrary class **provided** that method takes a single argument of type PortletRenderRequest. So you would need something like:-
    public class MyApp
    // A bunch of app-specific code.
    public void renderPortlet(PortletRenderRequest pr)
    PrintWriter out = pr.getWriter();
    out.println("<b>Hello World</b>");
    Then, the relevant provider.xml section would look something like this....
    <showPage class="oracle.portal.provider.v2.render.http.JavaRenderer>
    <className>MyApp</className>
    <renderMethod>renderPortlet</renderMethod>
    </showPage>
    Hope this helps.....
    Regards,
    Gareth
    PDK-Java Development Team

  • Web Application and Java Application

    Hello,
    I have a standalone Java application and a web application (JSP/Servlets) that I would like integrate. The standalone app. should send some information to my web app (which is not a problem), but then the user can be at this web app. for a while and then once he sees something he likes here, he can select it which should take him BACK to the standalone application. My question is whether something like this is possible?
    If so, then how do i do it.
    Also the web app and the standalone app run to 2 separate machines and 2 different JVM's.
    Any kind of help will be great.
    Thanks

    Well let me describe the scenario in detail
    We have a standalone java application that is good to search for data across an enterprise database. We also have another application which is web based and uses jsp's and servlets and is good for displaying data in different ways, let's say different kind of graps. Now the user will typically search for something using the standalone application and once he finds what he is looking for, then he might say that he wants to graph the selected data using this web application. Now this part is not too difficult as the standalone app can simply POST the selected information to the web app and the web app can then plot the graph. However, the tricky part is that this web application has the capability to allow the user to select let's say a bar and then get additional info. on that bar. Now to get this additional info. the web app. must contact the standalone app and tell it what bar was selected to get the additional info.
    so my concern is how does the web app contact the standalone app. or even KNOW about this web app. Also, RMI is pretty flaky and i would much rather use web services to accomplish it. If that is the only way to go that is.
    Hope that helps.

  • Help please! Java application and web application...

    Hi,
    I have a problem with inserting a java application (Main.java) in a web application(index.jsp).
    I found a source demo of a drag and drop application on the Internet, but now I want to
    have the drag and drop application work in a Jpanel/JFrame in a webapplication.
    The drag and drop application code:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    public class Main {
        public static void main(final String[] args) {
            final ButtonGroup grp = new ButtonGroup();
            final JPanel palette = new JPanel(new FlowLayout(FlowLayout.LEFT));
            palette.setBorder(BorderFactory.createTitledBorder("Palette"));
            final MainPanel mainPanel = new MainPanel();
            mainPanel.setPalette(palette);
            for(int j=0; j<4; j++){
                final JToggleButton btn = new JToggleButton("Panel "+(j+1));
                palette.add(btn);
                grp.add(btn);
                btn.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        mainPanel.setAdding(btn.getText());
            final JFrame f = new JFrame("Drag and drop panels");
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(palette, BorderLayout.WEST);
            f.getContentPane().add(mainPanel, BorderLayout.CENTER);
            f.setSize(800, 600);
            f.setVisible(true);
    class MainPanel extends JPanel implements MouseListener, MouseMotionListener {
        private JPanel palette;
        private String adding="";
        private SubPanel hitPanel;
        private int deltaX, deltaY, oldX, oldY;
        private final int TOL = 4;  //tolerance
        public MainPanel() {
            setLayout(null);
            addMouseListener(this);
            addMouseMotionListener(this);
        public void mousePressed(final MouseEvent e) {
            if( adding != "" ){
                setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
                SubPanel sub = new SubPanel(adding);
                add(sub);
                sub.setSize(sub.getPreferredSize());
                sub.setLocation((int)e.getX(),(int)e.getY());
                revalidate();
                adding = "";
                return;
            Component c = getComponentAt(e.getPoint());
            if (c instanceof SubPanel) {
                hitPanel = (SubPanel) c;
                oldX = hitPanel.getX();
                oldY = hitPanel.getY();
                deltaX = e.getX() - oldX;
                deltaY = e.getY() - oldY;
                if( oldX < e.getX()-TOL ) oldX += hitPanel.getWidth();
                if( oldY < e.getY()-TOL ) oldY += hitPanel.getHeight();
        public void mouseDragged(final MouseEvent e) {
            if (hitPanel != null) {
                int xH = hitPanel.getX();
                int yH = hitPanel.getY();
                int xDiff = e.getX()-oldX;
                int yDiff = e.getY()-oldY;
                int cursorType = hitPanel.getCursor().getType();
                if( cursorType == Cursor.W_RESIZE_CURSOR){           //West resizing
                    hitPanel.setBounds( e.getX(), yH, hitPanel.getWidth() - xDiff, hitPanel.getHeight() );
                }else if( cursorType == Cursor.N_RESIZE_CURSOR){     //North resizing
                    hitPanel.setBounds( xH, e.getY(), hitPanel.getWidth(), hitPanel.getHeight() - yDiff );
                }else if( cursorType == Cursor.S_RESIZE_CURSOR){     //South resizing
                    hitPanel.setSize( hitPanel.getWidth(), hitPanel.getHeight() + yDiff );
                }else if( cursorType == Cursor.E_RESIZE_CURSOR){     //East resizing
                    hitPanel.setSize( hitPanel.getWidth() + xDiff, hitPanel.getHeight() );
                }else if( cursorType == Cursor.NW_RESIZE_CURSOR){     //NorthWest resizing
                    hitPanel.setBounds( e.getX(), e.getY(), hitPanel.getWidth() - xDiff, hitPanel.getHeight() - yDiff );
                }else if( cursorType == Cursor.NE_RESIZE_CURSOR){     //NorthEast resizing
                    hitPanel.setBounds( xH, e.getY(), hitPanel.getWidth() + xDiff, hitPanel.getHeight() - yDiff );
                }else if( cursorType == Cursor.SW_RESIZE_CURSOR){     //SouthWest resizing
                    hitPanel.setBounds( e.getX(), yH, hitPanel.getWidth() - xDiff, hitPanel.getHeight() + yDiff );
                }else if( cursorType == Cursor.SE_RESIZE_CURSOR){     //SouthEast resizing
                    hitPanel.setBounds( xH, yH, hitPanel.getWidth() + xDiff, hitPanel.getHeight() + yDiff );
                }else{      //moving subpanel
                    hitPanel.setLocation( e.getX()-deltaX, e.getY()-deltaY );
                oldX = e.getX();
                oldY = e.getY();
        public void mouseMoved(final MouseEvent e) {
            Component c = getComponentAt(e.getPoint());
            if (c instanceof SubPanel) {
                int x  = e.getX();
                int y  = e.getY();
                int xC = c.getX();
                int yC = c.getY();
                int w  = c.getWidth();
                int h  = c.getHeight();
                if(       y >= yC-TOL   && y <= yC+TOL && x >= xC-TOL   && x <= xC+TOL  ){
                    c.setCursor(new Cursor(Cursor.NW_RESIZE_CURSOR));
                }else if( y >= yC-TOL   && y <= yC+TOL && x >= xC-TOL+w && x <= xC+TOL+w ){
                    c.setCursor(new Cursor(Cursor.NE_RESIZE_CURSOR));
                }else if( y >= yC-TOL+h && y <= yC+TOL+h && x >= xC-TOL   && x <= xC+TOL ){
                    c.setCursor(new Cursor(Cursor.SW_RESIZE_CURSOR));
                }else if( y >= yC-TOL+h && y <= yC+TOL+h && x >= xC-TOL+w && x <= xC+TOL+w ){
                    c.setCursor(new Cursor(Cursor.SE_RESIZE_CURSOR));
                }else if( x >= xC-TOL   && x <= xC+TOL ){
                    c.setCursor(new Cursor(Cursor.W_RESIZE_CURSOR));
                }else if( y >= yC-TOL   && y <= yC+TOL ){
                    c.setCursor(new Cursor(Cursor.N_RESIZE_CURSOR));
                }else if( x >= xC-TOL+w && x <= xC+TOL+w ){
                    c.setCursor(new Cursor(Cursor.E_RESIZE_CURSOR));
                }else if( y >= yC-TOL+h && y <= yC+TOL+h ){
                    c.setCursor(new Cursor(Cursor.S_RESIZE_CURSOR));
                }else{
                    c.setCursor(new Cursor(Cursor.MOVE_CURSOR));
        public void mouseReleased(final MouseEvent e) { hitPanel = null; }
        public void mouseClicked(final MouseEvent e) {}
        public void mouseEntered(final MouseEvent e) {}
        public void mouseExited(final MouseEvent e) {}
        public void setAdding(final String string) {
            adding = string;
            setCursor(new Cursor(Cursor.HAND_CURSOR));
        public void setPalette(final JPanel panel) { palette = panel; }
    class SubPanel extends JPanel {
        public SubPanel(final String name) {
            setPreferredSize(new Dimension(100, 100));
            setBorder(new TitledBorder(new LineBorder(Color.BLACK), name));
    }This application works with JFrame, but I want to display the JFrame in a webapplication (JSP Page).
    I'm using Netbeans 6.0 (GlassFish) to create webapplication using Visual Web JavaServer Faces.
    So in summary:
    How can i display the drag and drop application into a JFrame (better in a JPanel) in a webapplication (index.jsp)??
    Hope you can help...
    Thanks in advance...
    Greetings,
    Rajsh

    So have an applet that opens a JFrame... JSP or not has nothing to do with it, since it's nothing but HTML the client gets.
    You can't have a JFrame embedded in an HTML page. And if you could have an applet but don't know how to get that copied code to fit inside (I mean, content pane is content pane), you might want to consider learning how to do that.

  • Error while performing SSO with java application

    hi ALL ,
    I got rhe following error when i call a java application in portal  using ticket logon sso
    Exception report
    message Internal Server Error
    description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.
    exception
    com.sap.test.TicketVerifierException: Request does not contain cookies
         at com.sap.test.TicketVerifierServlet.getSSOCookie(TicketVerifierServlet.java:149)
         at com.sap.test.TicketVerifierServlet.getUserFromRequest(TicketVerifierServlet.java:94)
         at com.sap.test.TicketVerifierServlet.doPost(TicketVerifierServlet.java:80)
         at com.sap.test.TicketVerifierServlet.doGet(TicketVerifierServlet.java:68)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
         at java.lang.Thread.run(Thread.java:484)

    Hi Sarang,
    It seems you are following the two basic pre-req.
    It may be now possible that your browser might be not allowing cookies. Which browser are u using? Version etc?
    Right now u can try two things:
    1) When you have logged into portal, type the following command in the adress bar "javascript:alert(document.cookie)". This will give u a popup displaying the cookies formed when logged into portal
    2) Use some software like HTTPWatch or ieHeaders and find out the details. It will give you all the cookie details etc.
    You should be able to see the JSESSIONID, MYSAPSSO2 cookies...Let me know the result of above..
    Regards
    Gaurav

Maybe you are looking for

  • Mac Mini can't see the same wireless networks as a Aluminum 24" Imac ....

    I have a question for ya'll. Is there any reason why my new Mac mini 2.0g system can't see the wireless networks that my Imac can? What I mean, is that I can see two Networks with my Imac: 1. Mine 2. Other networks around me. On the Mini, using 10.4

  • My Mom's 2011 iMac is having issues loading web pages.

    This past week my mother's iMac (2011) began having issues with the internet. She told me that whenever she ties to search for something on the internet, the reload bar in Safari constantly spins and takes forever to load (around 40 seconds). We are

  • X11vnc: cannot use host name in Windows

    Hi, i cannot find my host name if i start x11vnc. It works if i write on Windows XP "Real VNC Viewer" IP adress. When i start x11vnc The VNC desktop is: asus:0 But if i write to Real VNC Viewer "asus" or "asus:5900", it doesn't work but if i write "1

  • Do I need encoder or media sever?

    We want to add short video content to our non-profit web page. 30 - 60 segments telling people about our different programs etc. Our server is Datapipe, of which we are only using 1% of bandwidth with current use. For editing we have Mac and also can

  • Idml file wont open

    I can't get this file to open it says that there's a missing plug in .It was saved from cs6 as an idml file but now I can't get that to open. It doesn't say what plug in is missing either for me to try and figure it out? Any suggestions? I tried open