jQuery in Action, 3rd edition
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes declaration Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "declaration" Watch "declaration" New topic
Author

declaration

Anoopriya Muthuswaami
Greenhorn

Joined: Nov 20, 2008
Posts: 25
Consider the following example
<%! String str="Hello"; %> //this becomes instance variable in generated servlet

<% String str="GoodDay"; %>//this becomes local variable in service method
<%= str %>

The result of this is GoodDay.

My question is how do I print the value 'Hello'?
Matteo Palmieri
Greenhorn

Joined: Sep 09, 2008
Posts: 28
This should do the case:


SCJP1.4: 96% SCWCD5: 91%
Anoopriya Muthuswaami
Greenhorn

Joined: Nov 20, 2008
Posts: 25
Thanks.. It worked.
Tuna Töre
Ranch Hand

Joined: Aug 17, 2008
Posts: 220

good question... Anoo Raj


blog: http://tunatore.wordpress.com

https://www.udemy.com/spring-framework-4-course-and-core-spring-certification/?couponCode=spring39coupon

Core Spring Certified Professional + SCJP 6.0 + SCWCD 1.5
 
Have you checked out Aspose?
 
subject: declaration
 
It's not a secret anymore!