• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

<c:url>

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what's the difference between these:


1. click here

2. click here

the first works while the second doesn't.In the second the request doesn't go to inputComment.jsp when i click on the link while in the first it goes to inputComment.jsp. var is just an attribute of c:url, so why would it make any difference ? when i view the source code from the brower, i see href=""(empty string) for the second option.

 
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
nisha,

Please quote your source and try to more clear while posting, so ranchers can help you in better way
 
nisha chidella
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i don't know how to post this..my code is not displaying.

i have
1. <c:url value='/inputComment.jsp' />
and
2.<c:url value='/inputComment.jsp' var='inputURL' />

as value for href.

the first link works while the second doesn't.In the second the request doesn't go to inputComment.jsp when i click on the link. var is just an attribute of <c:url>, so why would it make any difference ? when i view the source code from the browser, i see href=""(empty string) for the second option.hope i am clear.

Source is: page 455 in my HFSJ(topic:<c:url> for all your hyperlink needs)
 
Poonam Agarwal
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not sure,
But just try to invoke the "var" attrubute with the "scope" attribute set. I hope inputComment.jsp belongs to the same context.
 
nisha chidella
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


just try to invoke the "var" attribute with the "scope" attribute set.



that makes no difference.still doesn't work.


I hope inputComment.jsp belongs to the same context.



yup. it belongs to same application. I mentioned that the first option works.
 
Poonam Agarwal
Ranch Hand
Posts: 324
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you find the solution??
 
nisha chidella
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
nope.
 
Ranch Hand
Posts: 874
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator



1. <c:url value='/inputComment.jsp' />
and
2.<c:url value='/inputComment.jsp' var='inputURL' />



If 'var' is used with value attribute , it assigns the 'value' to the 'var' attribute , where as when 'value' attribute is used alone, it writes to HTML . and thats why you see "" when var is used and "/inputComment.jsp'", when 'value' alone is used. HTH.

 
nisha chidella
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so, we do href="${inputURL}" when we use the var attribute in this example.
thanks it helped.
 
Balu Sadhasivam
Ranch Hand
Posts: 874
Android VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yup you got it
 
Never trust an airline that limits their passengers to one carry on iguana. Put this tiny ad in your shoe:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic