Solved

IN JSP <% AND <%!

Posted on 2012-03-28
7
338 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

This article outlines why you need to choose a backup solution that protects your entire environment – including your VMware ESXi and Microsoft Hyper-V virtualization hosts – not just your virtual machines.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

777 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