Solved

IN JSP <% AND <%!

Posted on 2012-03-28
7
334 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 20

Accepted Solution

by:
Sathish David  Kumar N earned 200 total points
Comment Utility
<%         %>----------------> 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
Comment Utility
check with this solution mike .... it will usefull for you to understand ...
0
 
LVL 33

Author Comment

by:Mike Eghtebas
Comment Utility
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
Comment Utility
Thank you. I figured out the rest.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Mockito Method call failing. 3 169
lessBy10  challenge 15 89
Can't access image with tomcat/html 6 84
withoutString  challenge 40 146
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
A procedure for exporting installed hotfix details of remote computers using powershell
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the fileā€¦
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 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

18 Experts available now in Live!

Get 1:1 Help Now