Results 1 to 8 of 8
  1. #1
    Join Date
    May 2013
    Posts
    4
    Rep Power
    0

    Default How to trigger a simple java class from JSP page?

    I am doing directory monitoring with watch service API. i have written a class and its Working well.
    Now i want to call this class from JSP page.
    How can i do this? Whenever i click monitor button on the page, the class should start its execution.
    Give me some idea.
    The directory is selected by the user dynamically.
    Thanks in advance.
    Last edited by sreenivassadhu@gmail.com; 05-15-2013 at 10:50 AM. Reason: clarity

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,935
    Rep Power
    19

    Default Re: How to trigger a simple java class from JSP page?

    Where is the directory that you wish to monitor?
    If it's on the client then this won't work.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    Join Date
    May 2013
    Posts
    4
    Rep Power
    0

    Question Re: How to trigger a simple java class from JSP page?

    Directory is dynamically selected by the user.
    I have java class running perfectly, but i want it to triggred from JSP or Servlet.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,935
    Rep Power
    19

    Default Re: How to trigger a simple java class from JSP page?

    Is it on the client, though?
    Or is this supposed to monitor a directory on the server?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    Join Date
    May 2013
    Posts
    4
    Rep Power
    0

    Default Re: How to trigger a simple java class from JSP page?

    It doesn't matter for me to monitor a directory. I have a class (ie WatchDir) to monitor the directory wherever it is.
    I just want the way to trigger that class from a JSP page or a servlet. how could i trigger that from my JSP?

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,935
    Rep Power
    19

    Default Re: How to trigger a simple java class from JSP page?

    I'm trying to save you some time.
    Because if you have a JSP running on your server (which is where they live), and the user selects a directory on their (the client) machine, then the code will not work, as the server (where the code runs) cannot monitor something on the client.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  7. #7
    Join Date
    May 2013
    Posts
    4
    Rep Power
    0

    Default Re: How to trigger a simple java class from JSP page?

    Thanks Tolls, but
    I just want the way to trigger that class from a JSP page or a servlet. how could i trigger that from my JSP?

  8. #8
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,935
    Rep Power
    19

    Default Re: How to trigger a simple java class from JSP page?

    OK.
    Not knowing what the class looks like or the method, but presumably this should be launched in its own thread, so wrap it in a Runnable and launch it in a Thread.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. take code from java class put it in JSP page.
    By anavagomez in forum New To Java
    Replies: 2
    Last Post: 04-26-2012, 05:14 PM
  2. How to get the URL of current page in java class
    By Eswaraiah in forum New To Java
    Replies: 17
    Last Post: 03-16-2012, 12:43 PM
  3. Replies: 0
    Last Post: 08-23-2011, 12:38 PM
  4. how to Import my Java Class in Jsp Page
    By pos in forum JavaServer Pages (JSP) and JSTL
    Replies: 20
    Last Post: 04-06-2010, 02:51 PM
  5. generating trigger using java
    By money3 in forum JDBC
    Replies: 1
    Last Post: 10-06-2009, 11:56 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •