aspose file tools*
The moose likes Servlets and the fly likes JSP declaration tag and Scriptlet tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "JSP declaration tag and Scriptlet tag" Watch "JSP declaration tag and Scriptlet tag" New topic
Author

JSP declaration tag and Scriptlet tag

Anoop Krishnan
Ranch Hand

Joined: May 03, 2001
Posts: 163
Plaese see this simple jsp tags and tell me which one is safe in place of memory usage and in multiple threads
code 1
<%!
String value;
%>
<%
value=request.getParameter("id");
%>
code 2
<%
String value=request.getParameter(id);
%>
[This message has been edited by Anoop Krishnan (edited May 22, 2001).]


I just want to know is there any body call my bean's Getter and Setter methods with "Please" in front - My favorite quip from Bugzilla
Dharmesh Chheda
Ranch Hand

Joined: May 08, 2001
Posts: 204
Hello anoop
well in code 1, if you open multiple browser windows, then in that case value will hold the latest value .. for example
suppose you declare value as
<%! int value=0 ; %>
and in your code suppose you do
<% value=value+1;%>
then when you open one browser value you will get the value of the variable "value" as 1.

Again if you open another window and re run your code and get the value of the variable "value" then it will not hold one it will hold two.
So in this case the value is persistent
Where as in code 2 the variable "value" will remain local for each particular session.
i hope this clears your doubt .. in case i am wrong correct me or in case you didnt get it ... send a reply
bye


regards,<br />Dharmesh Chheda
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP declaration tag and Scriptlet tag