Solved

IN JSP <% AND <%!

Posted on 2012-03-28
7
336 Views
Last Modified: 2012-03-29
What is the difference between

<%         %>

and

<%!         %>

Thnak you.
0
Comment
Question by:Mike Eghtebas
  • 3
  • 2
  • 2
7 Comments
 
LVL 27

Expert Comment

by:rrz
ID: 37778924
I would like to help you but I don't think you have been honest with me in your last two questions.
Did you even try my suggestions. ?
0
 
LVL 33

Author Comment

by:Mike Eghtebas
ID: 37778987
rrz@871311,

My apology for that. After work when I am home I would respond.

I was under gun and have to shift my focus elsewhere, Also, there was server setup which was adjusted and the attending to the question was not priority.

I will get back to you.

Also I thing <!-- to do with sort of public deceleration or just deceleration.

I am new and confused right now.

thx
0
 
LVL 27

Expert Comment

by:rrz
ID: 37779140
The solution you at
http://www.experts-exchange.com/Programming/Languages/Java/Q_27651282.html 
will not work for you. Why did you accept it ?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 20

Accepted Solution

by:
Sathish David  Kumar N earned 200 total points
ID: 37780532
<%         %>----------------> this is scriptlet

<%!    %> ------------> this declerative  

both are usefull to right java code but the main diffrences is if you want to use any filed or method any where in jsp then you can go with declerative  .
eg:
<%! String s="Sathish" %>
<% String  s1="David" %>

here you can use s in any where in your jsp but s1 will accessable inside the scriplet only ....
0
 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 37780539
check with this solution mike .... it will usefull for you to understand ...
0
 
LVL 33

Author Comment

by:Mike Eghtebas
ID: 37783283
thanks dravidnsr, t

o post No instead of null, I am using the following code:

      <body>
          
             <%! String str = "No" %>   <-- is this correct?
             
            <b>Margherita?:</b>
            <%
            str = ((request.getParameter("margherita") != null)? "Yes":"No");
                  out.println(str);
            %>
            <br>
            <b>Hawaiian?:</b>
            <% out.println(request.getParameter("hawaiian")); %>
            <br>
            <b>Pepperoni?:</b>
            <% out.println(request.getParameter("pepperoni")); %>
            <br>

      </body>

I want to declare str once such that its scope will hande all three items. After the first one works, I wiil change the remainig two.

Mike
0
 
LVL 33

Author Closing Comment

by:Mike Eghtebas
ID: 37783736
Thank you. I figured out the rest.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
When we talk about DevOps toolchains, I sometimes wonder how many people really get what we’re talking about. I don’t know if it’s just semantics or tone or something else, but sometimes I think it just sounds like buzzword sausage. So it’s always …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now