Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


guest
jsp function
1 Answer(s)      4 years and 4 months ago
Posted in : JSP-Servlet


how to make function in jsp... i want example of jsp method or function in which on button click function get data fron database and print that data.. don't want javascripts..

Advertisement
View Answers

September 23, 2010 at 1:08 PM


Writing Method in JSP an Example

We can write functions or methods into JSP using the Declaratives tags..

because any function that is defined in the declaratives tags are class level and

can be called anywhere in the JSP page.

Syntax of Declaratives tags:

<%!
//Write your method or function in between the declaratives tags
%>

a simple example of JSP Functions
<%@ page contentType="text/html;charset=ISO-8859-1"%>

<%!public String exampleName(){
return "RoseIndia JSP Method Example";
}
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Method in JSP</title>
</head>
<body>
<%=exampleName()%>
</body>
</html>

See the given simple button Example to submit or print the data from database using JSP.
http://www.roseindia.net/jsp/submit-comments-database.shtml

It'll be better if can post your query with the code and problems that you are facing during development.

More Example
http://www.roseindia.net/jsp/simple-jsp-example/jsp-methods.shtml


Related Tutorials/Questions & Answers:
jsp function - JSP-Servlet
jsp function  how to make function in jsp... i want example of jsp method or function in which on button click function get data fron database and print that data.. don't want javascripts..  Writing Method in JSP
calling function - JSP-Servlet
calling function  Hai, How to call a java file in jsp file... : 1.Create a jsp page "test.jsp" Example of Extends Attribute of page Directive in JSP 2.Use "import" attribute in JSP
Advertisements
user defined function inside a jsp
user defined function inside a jsp  how to write a user defined function inside a jsp page
multiplication function in jsp using scriptlet function
multiplication function in jsp using scriptlet function   how...">--> <script type="text/javascript"> function txtnull...; if(a=="") { alert("insert data"); } } function sum(txt
Help with javascript function - JSP-Servlet
is that the function BookSeat() to change the value of the button being clicked to "You... properties of those clicked buttons to be transferred to the next jsp page. ----So what should i write in the BookSeat() function that'll accomplish
calling zipping function - JSP-Servlet
calling zipping function  Hi, Is it possible to zip a jsp file. I wrote a java function for zipping a file.How to call that java file (zipping function ) in JSP ? pls help me Thanks.... 
How i write a function/method in jsp?
How i write a function/method in jsp?  How write the function/method in jsp? Using that method i can retrieve the value coming from database. give me example plz. Actually i want to show the list of user detail
Handle mail function using JSP & Servlet
Handle mail function using JSP & Servlet  Dear Sir, for my final year project i want to add email function to confirm registration & confirm appointment. I'm using JSP & Servlet and apache web server. I'm developing
how to invoket javascript function in JSP - JSP-Interview Questions
how to invoket javascript function in JSP  Dear Sir, my question is how to invoke javascript function written in .js file into our JSP. using which tag in JSP this is possible
function
function  difference between function overloading and operator overloading
callig jsp file from javascript function - JSP-Servlet
callig jsp file from javascript function  I want to call a jsp file from javascript function. What I want to do is Whenever a user clicks on a form in html, the function should call specified jsp file.The form has no dynamic
multiple form with multiple function in 1 jsp - JSP-Servlet
multiple form with multiple function in 1 jsp  Hi, I'm using Netbean... in triggering my jsp with 2 forms as 1 for registration and 1 for log in. I need to trigger each form to call several function when user click buttons of these forms
Displaying the values in text fields of a form from a javascript function in jsp
Displaying the values in text fields of a form from a javascript function... to call a javascript function by passing 3 values from applet. And i have... and javascript function must be available in the same web page. Any help
How to change the value of a variable which is set in jsp (by jstl method) by calling the function from js?
How to change the value of a variable which is set in jsp (by jstl method) by calling the function from js?  How to change the value of a variable which is set in jsp (by jstl method) by calling the function from js? I set
In JSP page, inside a javascript function, can I place a java code using scriptlet tag?
In JSP page, inside a javascript function, can I place a java code using... is trying to close a window, I am calling a java script function closeWind() in jsp page. In a separate java file, in a method checkListValue(), I am doing
isNaN function
isNaN function  What does isNaN function do
function addValue
function addValue  i have question about the javascript the function addvalue script is working to add some name but is not save on the html so please resolve my problem what can i do for addvalue function will be to save
function addValue
function addValue  i have question about the javascript the function addvalue script is working to add some name but is not save on the html so please resolve my problem what can i do for addvalue function will be to save
function addValue
function addValue  i have question about the javascript the function addvalue script is working to add some name but is not save on the html so please resolve my problem what can i do for addvalue function will be to save
using function
using function   using a function to find the value of v from the foiiowing expression 1v=1u+1*f
function method
function method  input Rs. 12000 Discount= 10%, 8% = Rs.(12000-1200) = Rs.(10800-864) = Rs. 9936
function method
function method  input Rs. 12000 Discount= 10%, 8% = Rs.(12000-1200) = Rs.(10800-864) = Rs. 9936
Calling a function
Calling a function  Hi, I have a function xyz() in php code. When a button is clicked it should execute that particular function for that i have... function function xyz() { } but this is not working can u tell me
If function in PHP
If function in PHP  Hi, Provide me the example of If function in PHP. Thanks   Hi, If function is PHP is used to check for some condition and the execute a block of code. He is an example of if() function in PHP
disable function
disable function  Sir, I have called a java script function when one radio button is checked i want to disable this function when another radio button is checked ,both radio buttons are of same group Please help Thanks in advance
unoin function
unoin function  how to define a union function in java?(ex:a=a U b) how to write tha java code?give ex.   Java Union Function You have learnt union, intersection etc in Sets. Here the given code finds the union of two
function method
function method  i. void display(String str.int p)with one string... is an example where we have created a function that accepts a string and an integer...); } }   Here is an example where we have created a function that accepts
using function
using function  write a program using function overloading to accept any sentence and print vowels and consonants sepratly   Here is an example that accepts a sentence from the user and display the vowels and consonants
Function pointer in c
Function pointer in c  What is the difference between function call with function pointer and without function pointer(normal function call
basic function of computer system
basic function of computer system  What is the basic function of computer system
 

 

 

DMCA.com