Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

JSP - Declaration

hedishedis Member Posts: 6
I know this is a very basic question but I need a good answer.

What is ALL the differents between at declare as this:
<%!
Date theDate = new Date();
%>

and this:

<%
Date theDate = new Date();
%>

I need a answer what explains on a easy way all the differents.


Comments

  • treshrtreshr Member Posts: 326
    If you use the "<%!" the variables are declared static.

    You have to watch out with this because when you do this with a variable that has to be declared everytime a client asks the page you get a problem.
    It is handy if you use a variable that only needs to be declared once.

    Hope this makes sense to you.
    : I know this is a very basic question but I need a good answer.
    :
    : What is ALL the differents between at declare as this:
    : <%!
    : Date theDate = new Date();
    : %>
    :
    : and this:
    :
    : <%
    : Date theDate = new Date();
    : %>
    :
    : I need a answer what explains on a easy way all the differents.
    :
    :
    :

    --=][tReShR][=--

Sign In or Register to comment.