Results 1 to 2 of 2
Thread: Help with jsp
- 10-21-2011, 01:34 AM #1
Member
- Join Date
- Oct 2011
- Posts
- 6
- Rep Power
- 0
Help with jsp
Hi Im some kind of newbie to JSP.So please help me.I have a Java file and an JSP file.How to use the java class i have in the JSP file.
I have been inserting the whole java code in the jsp file.But it seems to be wrong programming practice.Can anybody tell me how to do this?
Thanks in advance.
- 10-21-2011, 08:51 AM #2
Member
- Join Date
- Feb 2011
- Location
- Ahmedabad
- Posts
- 36
- Rep Power
- 0
Re: Help with jsp
I think you are trying to use functions of java class in jsp.
for that you can write java code in jsp inbetween jsp expression,scriptlets etc..
Java Code:<HTML> <BODY> <% // This scriptlet declares and initializes "date" System.out.println( "Evaluating date now" ); java.util.Date date = new java.util.Date(); %> Hello! The time is now <% // This scriptlet generates HTML output out.println( String.valueOf( date )); %> </BODY> </HTML>
you can have more idea about it on http://www.jsptut.com/Scriptlets.jspLast edited by hemant_metalia; 10-21-2011 at 08:53 AM.
Hemant Metalia
cool-.gif)


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks