• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

c:import var

 
Sharmila Punde
Ranch Hand
Posts: 133
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64202
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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

 
Chinmaya Chowdary
Ranch Hand
Posts: 432
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic