tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From horn_...@jpmorgan.com
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.






cga@ciudad.com.ar on 22/01/2001 18:31:49

Please respond to tomcat-user@jakarta.apache.org; Please respond to
      gastuch@bigfoot.com

To:   tomcat-user@jakarta.apache.org
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?

Bye,

Gaston


  ----- Original Message -----
  From: Hobson, Don
  To: 'tomcat-user@jakarta.apache.org'
  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?

Mime
View raw message