Results 1 to 2 of 2

Thread: Help with jsp

  1. #1
    ur2cdanger is offline Member
    Join Date
    Oct 2011
    Rep Power

    Default 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.

  2. #2
    Join Date
    Feb 2011
    Rep Power

    Default 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:
        // 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
    Last edited by hemant_metalia; 10-21-2011 at 08:53 AM.
    Hemant Metalia

Posting Permissions

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