File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes calling jsp page using Jquery Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "calling jsp page using Jquery " Watch "calling jsp page using Jquery " New topic

calling jsp page using Jquery

jazy smith
Ranch Hand

Joined: Nov 18, 2009
Posts: 101
Hi all,

I have this code snippet where I am passing data to another jsp file. and in Ajax.jsp , my code is . Now when I click on text box in index.jsp, I am getting alert promt saying data has been saved. but when I display Ajax.jsp the value is null. My doubt is , am I really passing data to another jsp ? Am I wrong in code ? Please correct me.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63870

Let's start by cleaning up the basics.

If you are using jQuery, what with: onclick="javascript:getInput()" ? Use jQuery to set up event handling. ALos, never use the javascript: prefix when not using jQuery.

Your JSP does not create valid HTML. Is it supposed to?

[Asking smart questions] [About Bear] [Books by Bear]
jazy smith
Ranch Hand

Joined: Nov 18, 2009
Posts: 101
Hi Bear,

so what could be the way if I want to use the same two code and want to pass parameter to another jsp using same jquery function. From your reply what I understood is , I have to create event handler. Any help or link you can provide to run this simplest example. ( i want to use same jquery ajax function and want to pass data to another jsp )

thanks in advance,
Ganesh Ravi Kumar

Joined: Dec 06, 2010
Posts: 17
Here is the code, that will do..........

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script type="text/javascript" src="js/jquery-1.4.2.js"></script>
<script type="text/javascript">
Name: <input type="text" id="name" name="name"><br/><br/>
Age  : <input type="text" id="age" name="age"><br/><br/>
<button id="click">Click Me</button>
<div id="response"></div>
I agree. Here's the link:
subject: calling jsp page using Jquery
It's not a secret anymore!