Results 1 to 4 of 4
  1. #1
    farhaan@kazi is offline Member
    Join Date
    Jul 2012
    Posts
    2
    Rep Power
    0

    Default Dynamically including JSP page

    I want to know that how can I dynamically include b.jsp page in a.jsp page without reloading the whole a.jsp page and this inclusion should occur when user click on button in a.jsp page? Can I use ajax or JQuery for that because I do not want whole page reloading?

    The requirement is that a.jsp page is already there at client site. user now click the button on a.jsp page. this a.jsp page include b.jsp page on user click and the condition is that including page that is a.jsp, must not be reloaded entirely only part where b.jsp page includes, will be refreshed.
    Last edited by farhaan@kazi; 07-04-2012 at 03:26 PM.

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

    Default Re: Dynamically including JSP page

    jQuery can make a call to it (Ajax), directing the response to a div.
    That would be the usual route, if you are already using jQuery on the site.

    Not really a Java question at this point.
    Have a dig round the jQuery site, specifically this page on the get() method. It's the one I've used in these instances.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    farhaan@kazi is offline Member
    Join Date
    Jul 2012
    Posts
    2
    Rep Power
    0

    Default Re: Dynamically including JSP page

    Quote Originally Posted by Tolls View Post
    jQuery can make a call to it (Ajax), directing the response to a div.
    That would be the usual route, if you are already using jQuery on the site.

    Not really a Java question at this point.
    Have a dig round the jQuery site, specifically this page on the get() method. It's the one I've used in these instances.

    Here you writen about div. I think you mean <div> tag. I thnik you have suggested that showing server response data in divs. Instead of including jsps, we need to show and hide divs tag and displaying html control and data in these <div>s.

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

    Default Re: Dynamically including JSP page

    The get() method will put the response received from the server into the given element, usually a <div> or similar. There are examples at that link.
    You don't want to include a JSP, at least with the definition of "include" used by JSPs. You want to direct the HTML returned by the JSP to a part of the page that already exists. That's what get() does.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Including a .dll file
    By abalis3 in forum Eclipse
    Replies: 1
    Last Post: 01-16-2012, 01:40 AM
  2. Including an external url to a jsf page
    By hajer in forum JavaServer Faces (JSF)
    Replies: 2
    Last Post: 09-12-2010, 12:47 PM
  3. Sum of all even numbers up to but not including 100
    By bigpips305 in forum New To Java
    Replies: 41
    Last Post: 02-09-2010, 03:16 PM
  4. Dynamically loading the jsp page to the application
    By shekar in forum JavaServer Pages (JSP) and JSTL
    Replies: 3
    Last Post: 04-09-2008, 03:28 PM
  5. Including JAR in applications
    By bugger in forum New To Java
    Replies: 0
    Last Post: 01-11-2008, 09:36 AM

Posting Permissions

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