Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

difference between declaration a variable with Expression and without

 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Can any one say me the difference between declaring
<%! int Val %>
&
<% int Val %>
Regards,
Sangeetha
 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<%! int Val %> belong to the servlet class of the jsp page
&
<% int Val %>belong to the jsp_service() method of the servlet class of the jsp page Only accessible within that service() method....
 
Vasantha Prabha
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hai Baran,

I have a Question
<%!
int Str;
%>
What does this means Will this called as decalarative statement
If this is not consider as declared under declarative syntax <%! %>
Then how can the below example is considered
<%!
public class innerclass
{
public void test()
{
System.out.println("Welcome");
}
}
%>
 
Ranch Hand
Posts: 282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
anybody can answer this question?
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<%!
int Str;
%>
What does this means Will this called as decalarative statement
If this is not consider as declared under declarative syntax <%! %>

If you begin a scriptlet with <%! it is a declaration. It doesn't matter how many lines there are between the start and end markers.
<%!
int Str;
%>
is exactly the same as
<%! int Str; %>
was that your question?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic