tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: Syntax and Performance
Date Tue, 23 Jan 2001 09:19:30 GMT

In terms of performance, little difference is caused by splitting
scriptlets (perhaps the extra print noted below.

However, this may be a typo on your part, but

  <%! String hostname;%>

declares an *instance* variable "hostname".
While this assignment:

    hostname    = request.getParameter("Host");

happens in the _jspService method. Essentially the hostname variable is not
thread safe. When accessing the hostname value, you will have a race
condition if the JSP does not implement SingleThreadModel. on 22/01/2001 18:31:49

Please respond to; Please respond to

cc:    (bcc: Ken X Horn)
Subject:  RE: Syntax and Performance

I think it will generate a out.print("\n"); that is unecesary.
Why don't you look at the generated code?



  ----- Original Message -----
  From: Hobson, Don
  To: ''
  Sent: Monday, January 22, 2001 2:36 PM
  Subject: Syntax and Performance

   Is there any reason that I should not do this:

  <%! String hostname;%>
    hostname    = request.getParameter("Host");

  Does the compiler have to do any extra work? Should I combine them?

View raw message