Calling jsp page from a java program

Is it possible to call a JSP page from a java program? If so, please let me know how it is possible.
I have a JSP page that inserts 10 records in a database based on the attribute given to the page. When the java program is executed all the 10 records need to be inserted.
The JSP page is already running fine in Tomcat.
Thanks and Regards,

MVC has applied the standard of seperate your view , model and controller. I believe nobody will insert data from jsp page,better practice should be inserted from your database layer, normally is like DAO layer. so you should pass your data from jsp to your backend.
hopefully it's help u

Similar Messages

  • Can I call JSP page from forms6i C/S?

    How can I call JSP page from forms6i Client/Server?

    What is your problem with a host command? You can use:
    host('c:\program files\internet explorer\iexplore.exe http://server/page.jsp');
    There a disadvantage indeed: you have to close the browser before you can return to the form.

  • Calling jsp page from plsql

    Please help me to the following
    How to Call jsp page from plsql??
    Please its urgent
    Edited by: 883730 on Mar 19, 2012 12:05 AM

    The best approach would be to change the behavior of your site so that it includes index.jsp as one of the default files. Typically that is done using the upper-level control files of the site. Here's a link from Sun that describes their approach.
    Actually, you don't say what type of webserver you're using, so it's really hard to guess. But if you were using an Apache webserver, you might want to review the "DirectoryIndex" directive here...
    In fact, if you were using Apache and didn't want to do that, you could do a redirect to another page using the "redirect" directive in the webserver control files as described here:

  • Possibility of calling standard actions from a java program

    Hi ,
    I am working for a project where customer wants to have option of saving orders as draft only and later convert to order if need be. However since we do not want many drafts to reside on server there is a need to delete these at a specified time. For draft orders I am using order templates since they stay in the database without getting converted to orders. Now I do not know how to go about the deletion part.
    i need to write a program that would run on the server and which would fetch the templates (drafts) that have been created till a particular time and call the delete action of the template. Now the question is how do i call these actions from a java program where this java program will have to run on the server end (ie will be a backend process).
    Please suggest.

    hello roopali,
    you can create a separate thread that will run your
    code that will check for stale drafts and delete them.
    it is just like a session management program but here
    we will be looking over the drafts and not the session
    now if you want the invocation of the action from another
    program, a socket program would suffice but opening ports
    will cause you network connections thru firewall.
    if you can make use of HTTP servlet as your service
    provider e.g., you can then just pass some action params
    to invoke it.

  • Calling OCX Methods from a Java Program

    Hi All,
    Is it possible to call OCX methods from a Java program? If yes, can you please refer me to any documents or sample code to achieve this.
    All inputs are highly appreciated.


  • Calling another application from a java program

    Hi, Java ppl.
    I wanted to know how can I call another program say a help application or an exe from a java program. anyone with any advice or a piece of code would help.

    I had the same situation and I tried the code that you sugested and it works. I was wondering, what am I expecting in the while loop that appears after the int inp; statement? Is some data going to be displayed on the screen? How essential is to have that while loop after the calling the exec() method?
    Sorry for the amount of questions, I never tried this before.
    Best regards,
    Luis E.

  • Calling a servlet from a java program

    I could not find a forum for servlet hence am posting
    I have a servlet that accepts prameters and
    gives some out put .
    I want to be able to call this servlet ( invoke )
    from a Java Program .
    How do i do that ..
    Any sample code /pointer would be appreciated.

    you can try this code.
    URL url = new URL("http://localhost:8888/yourServlet?param1=value1");
    URLConnection con = url.openConnection();
    StringBuffer sBuf = new StringBuffer();
    BufferedReader bReader = new BufferedReader(
    new InputStreamReader(
    String line = null;
    while((line = bReader.readLine()) != null) {
    hope this helps

  • Calling an executable from a java program

    How can I call a compiled program from a java program. I have a fortran program, which I would like to call for execution from within my java program. My OS is linux.

    Not quite sure in the case of fortran program, but one thing can be done, call ur fortran program from a batch (.bat file) and call this .bat file from java ;
    try {
    Process p = Runtime.getRuntime().exec("run.bat");
    catch( Exception e ) {

  • Call ODI Scenario from a Java Program

    I would like to invoke the ODI Scenario from a Java Program. Is there any way i can do this?
    Please let me know if you have any posts related to this.

    Check this ..
    How to run ODI scenario from java?

  • Calling another class from a java program

    I tried to call the Server1.class from the password program, but I failed. The password program source code is as follows:
    class PasswordDialog extends java.awt.Dialog implements java.awt.event.ActionListener
         * Constructor. Create this visual dialog component.
         public PasswordDialog(java.awt.Frame parent, PasswordVerifier verifier)
              addWindowListener(new WindowEventHandler());
              setLayout(new java.awt.FlowLayout());
              setSize(500, 100);
              this.verifier = verifier;
              add(useridField = new java.awt.TextField(10));
              add(passwordField = new java.awt.TextField(10));
              add(okButton = new java.awt.Button("Submit"));
              add(cancelButton = new java.awt.Button("Cancel"));
         public void actionPerformed(java.awt.event.ActionEvent e)
              if (e.getSource() == okButton)
                   // Invoke password verification callback
                        boolean result = verifier.verifyPassword(
                             useridField.getText(), passwordField.getText());
                        if (! result) return;     // verification failed; don't close this dialog
                   catch (Exception ex)
                   // Close this dialog
                   System.out.println("I still can't call the Server1 class");
              else if (e.getSource() == cancelButton)
         class WindowEventHandler extends java.awt.event.WindowAdapter
              public void windowClosing(java.awt.event.WindowEvent e)
         // Private objects
         private PasswordVerifier verifier;
         private java.awt.TextField useridField;
         private java.awt.TextField passwordField;
         private java.awt.Button okButton;
         private java.awt.Button cancelButton;
    interface PasswordVerifier
         public boolean verifyPassword(String userid, String password) throws Exception;
    public class password implements PasswordVerifier
         * Main routine for testing only.
         public static void main(String[] args)
              password verifier = new password();
              java.awt.Frame f = new java.awt.Frame("Password Verifier");
              f.setSize(100, 100);
              PasswordDialog d = new PasswordDialog(f, verifier);
         public boolean verifyPassword(String userid, String password) throws Exception
              return (userid.equals("Albert") && password.equals("Einstein"));
    and the is as follows:
    //Server Application
    import java.awt.*;
    import java.awt.event.*;
    public class Server1 extends Frame implements ActionListener,Runnable,KeyListener
    ServerSocket s;
    Socket s1;
    BufferedReader br;
    BufferedWriter bw;
    TextField text;
    TextField name;
    Button exit,clear;
    Label label;
    List list;
    Panel p1=null;
    Panel p2=null;
    Panel sp21=null;
    Panel sp22=null;
    Panel jp=null;
    public void run()
              try{s1.setSoTimeout(1);}catch(Exception e){}
              while (true)
                   }catch (Exception h){}
    public Server1(String m)
    {       super(m);
    jp=new Panel();
    p1=new Panel();
    p2=new Panel();
    sp21=new Panel();
    sp22=new Panel();
    jp.setLayout(new GridLayout(2,1));
    p1.setLayout(new GridLayout(1,1));
    p2.setLayout(new GridLayout(2,1));
    sp21.setLayout(new FlowLayout());
    sp22.setLayout(new FlowLayout());
    exit = new Button("Exit");
    clear = new Button("Clear");
    list = new List(50);
    text = new TextField(43);
    name = new TextField(10);
    label = new Label("Enter your name");
    s = new ServerSocket(786);
                   br = new BufferedReader(new InputStreamReader(
                   bw = new BufferedWriter(new OutputStreamWriter(
                   Thread th;
                   th = new Thread(this);
              }catch(Exception e){}
    public static void main(String args[])
    new Server1("Server");
         public void actionPerformed ( ActionEvent e)
    if (e.getSource().equals(exit))
    else if (e.getSource().equals(clear))
    { name.setText(" ");
    public void keyPressed(KeyEvent ke) {
                   }catch(Exception m){}
    else if(name.equals(ke.getSource())) {
    public void keyReleased(KeyEvent ke)
    public void keyTyped(KeyEvent ke)
    I tried to create a new object by typing:
    Server1 s = new Server1();
    then call the main function
    new Server1("Server");
    but it doesn't work. Anybody can help me with this?

    Server1 s = new Server1();
    new Server1().Server1("Server");

  • Calling JSP page from BSP

    Dear Guys,
    From  BSP application I want to call a JSP Page. Is itpossible?
    How can we integrate BSP and JSP....?
    Any configuration has to be done.....?

    if you have the url of it you can call from BSP.

  • Problem in calling JSP page from a servlet

    can anyone please tell me how to call a JSP from servlet?
    My code is:
    ServletContext sc = this.getServletContext();
                                                 RequestDispatcher rd = sc.getRequestDispatcher("./Welcome.jsp");
                                                 if (rd !=null)
                                                           rd.forward(req, res);
                                                      catch (Exception e)
                                                           sc.log("---------------Problem invoking JSP.------------------", e);
    I n the browser when i call this servlet it gives error-404.
    NOT Found.
    please help.

    I would try to change "./Welcome.jsp" to "/Welcome.jsp". I'm not sure what that period will do.
    Are you able to access that JSP directly from your browser (even if it's not designed to be accessed that way)? If not, then you have some other problem.
    When you say you get a 404 when you access the servlet, is that when you access the servlet, or when it tries to forward to the JSP? If you get the 404 when you access the servlet, perhaps your servlet-mapping to the servlet is invalid.

  • How to run jsp pages  from webdynpro java

    Hi experts
         I want to run the jsp pages present in a webserver like tomcat or weblogic servers from webdynpro.Is there any way to run a jsp from webdynpro environment?
    Thanks and regards
    venkat kalyan

    hi Venkat,
    Check out this threads. They might be helpful
    Re: web dynpro jsp
    Re: Opening a jsp from another server(Weblogic) from webdynpro running on WAS

  • How to call jsp page from OA page

    Hi all,
    I am new to OA Framework..I have a requirement where i have to navigate to a new jsp page.. on clicking a link in the OA page.The major trouble in this is that , that new jsp page should open in a new window.. not in the same window.
    Please give me some solution as it is very urgent for me.
    Thank you.

    Similar issue has been discussed in last few weeks. Search in threads before posting the issues.

  • How to call JSP page from applet?

    I have some page1.jsp from which I call applet.
    User works with this applet but some information does not in date inside applet.
    So user click on some component at applet (some button etc.) and now I would like to do this:
    1) open new window;
    2) call page2.jsp at this new window.
    The reason is that page2.jsp will read some data from database and then displays it in HTML inside page2.jsp itself. It is not necessary to pass these date back to applet for displaying them inside of applet.
    So user then can have 2 windows: page1.jsp with applet and page2.jsp with some details information.
    But I DO NOT know how to call page2.jsp from applet, and do ti in a new window. Is it possible and how?

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class MainMenu extends JApplet implements ActionListener
         private JMenuBar mbar;
         private JMenu Master,Leave,Report,Logout;
         private JMenuItem UserMaster,DeptMaster,DesignationMaster,LeaveAvailable,LeaveApply,Generate;
         private JPanel jp;
         public void init()
              mbar=new JMenuBar();
              Master=new JMenu("Master");
              Leave=new JMenu("Leave");
         Report=new JMenu("Report");
              Logout=new JMenu("Logout");
              UserMaster=new JMenuItem("UserMaster");
              DeptMaster=new JMenuItem("DeptMaster");
              DesignationMaster=new JMenuItem("DesignationMaster");
              LeaveAvailable=new JMenuItem("LeaveAvailable");
              LeaveApply=new JMenuItem("LeaveApply");
              Generate=new JMenuItem("Generate");
              Container con=getContentPane();
         public void actionPerformed(ActionEvent ae){

Maybe you are looking for

  • Using Cinema Display - Please Help

    Hi All, I have been working with my new 15" MBP and loving it, not one problem to report! I will be traveling with the MBP and when I come home, I would like to use this computer with my cinema display and apple wireless keyboard and all of my other

  • Is it possible to unload a class?

    Suppose I take a classloader and load a class. Then I set my classloader to null and get rid of any objects of it that I've instantiated. Can that class be garbage collected? I'm thinking that it probably isn't possible. Even if you can get rid of al

  • Functions slowing down performance question

    Hey there. I've got a query that really slogs. This query calls quite a few functions and there's no question that some of the work that needs to be done, simply takes time. However, someone has adamantly told me that using functions slow down the qu


    I think I may have found a solution to the Shuffle/iTunes 7 issue that doesn't involve buying a new mp3 player or banging it on the desk lol!! I was having all the same troubles described by everyone else (flashing lights, "cannot update", not recogn

  • Double postings after running transaction FAGLF101

    Hi All, After running transaction FAGLF101 some postings double (only in Ledger 0L, YQ seems to work) While running this transaction, we have to do it twice, with two different valuation areas. This resulted in double postings for few Adjustment acco