Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: calling java from jsp

  1. #1
    Junior Member
    Join Date
    Dec 2011
    Location
    India
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default calling java from jsp

    //Remotetest.jsp

    <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <body>
    <font size="20" color="red">

    <jsp:useBean id="obj" class="Opne_App.Call_OpenApp" scope="session" />
    <%
    obj.show();
    %>

    </font>
    </body>
    </html>

    // Call_OpenApp is the java program and Opne_App is the package contains Call_OpenApp.java
    here there is error :
    Multiple annotations found at this line:
    - Undefined type:
    Call_OpneApp.Call_OpenApp


    what error is this ?

    package opne_App;



    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;

    //import com.sun.org.apache.xml.internal.resolver.helpers.P ublicId;

    //Call_OpenApp.java program
    public class Call_OpneApp
    {
    public String show()
    {
    OpenApp obj = new OpenApp();
    System.out.println("Enter Application:");
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String app = null;
    try
    {
    app = br.readLine();
    }
    catch (IOException e)
    {
    System.out.println("Error!");
    System.exit(1);
    }

    obj.process(app);
    return app;
    }
    }

    thanks in advance ..
    Last edited by lanpan; February 27th, 2012 at 08:35 AM.


  2. #2
    Member
    Join Date
    Feb 2012
    Posts
    58
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default Re: calling java from jsp

    You should use import property of the <@page > directive to import the class: Call_OpneApp.Call_OpenApp

  3. #3
    Think of me.... Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Pakistan
    Posts
    1,136
    My Mood
    Grumpy
    Thanks
    20
    Thanked 82 Times in 78 Posts
    Blog Entries
    1

    Default Re: calling java from jsp

    Quote Originally Posted by Bob_Sadarka View Post
    You should use import property of the <@page > directive to import the class: Call_OpneApp.Call_OpenApp
    Really???? Can you kindly explain it?
    Multiple annotations found at this line:
    - Undefined type:
    Call_OpneApp.Call_OpenApp
    You must refer it in the proper file to let server know, where to find the class file.

Similar Threads

  1. calling c code from java
    By sara in forum Java Native Interface
    Replies: 3
    Last Post: April 6th, 2013, 09:53 PM
  2. calling native c code from java using JNI
    By ashok_jeev in forum Java Native Interface
    Replies: 3
    Last Post: November 20th, 2012, 05:28 AM
  3. Calling platformRequest() in Java MIDP 2.0
    By Nano in forum Java ME (Mobile Edition)
    Replies: 0
    Last Post: February 21st, 2011, 11:57 AM
  4. Calling exe files from Java
    By linuxrockers in forum What's Wrong With My Code?
    Replies: 3
    Last Post: March 26th, 2010, 04:20 AM
  5. [SOLVED] How to call string in another class in java?
    By tazjaime in forum What's Wrong With My Code?
    Replies: 4
    Last Post: April 23rd, 2009, 09:31 AM