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.
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..
// 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 ));
you can have more idea about it on http://www.jsptut.com/Scriptlets.jsp