• 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:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

c:import var

 
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear All,
Please look at following code -
Can someone please explain why i get output as horse and after that
url:
What is meaning of the following about inputUrl-

'inputUrl' is name of the exported scoped variable for the processed url.
The type of the scoped variable is String.


How and why to use 'inputUrl'. Did not understood the meaning of above quote.

Thanks
 
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After the import, the var will contain the content fetched from the URL. ("inputUrl" isn't the best name for the var.)

Did you do a View Source on the page in the browser to see what was happening?

Did you look at what's at "http://www.wickedlysmart.com/skyler/horse.html" to see what will be fetched?
 
Sharmila Punde
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Bear Bibeault,
Sorry i could not come online for few days, was not well.
I get horse picture from that resource. Now i have changed the code as bellow-
Translated page doe not contain any variable of the name someVar1.
So i do not exactly know what is use of someVar1

 
Ranch Hand
Posts: 437
Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, Sharmila.


Here 'import' tag internally sends the request to "http://www.wickedlysmart.com/skyler/horse.html" and gets the contents of horse.html. Here it is and stores it in page scope(since we didn't mention any scope attribute, the default value is page scope) like

And if we say container searches for the attribute name(someVar1) in all scopes ranging from page to application. First it sees the is the attribute available in page scope? here it is available and write it's value to the response object and sends it to the client as HTTP response. Now the browser sees the and it makes another request to the container and the horse.gif image is displayed at the browser side.
 
Sharmila Punde
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Chinmay,
Will look at that and will do one more practicle of this. Let me check it as you say.
Thanks
 
It's a tiny ad. At least, that's what she said.
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic