Forums Register Login

<c:url>

+Pie Number of slices to send: Send
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.

+Pie Number of slices to send: Send
nisha,

Please quote your source and try to more clear while posting, so ranchers can help you in better way
+Pie Number of slices to send: Send
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)
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
 


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.
+Pie Number of slices to send: Send
Did you find the solution??
+Pie Number of slices to send: Send
nope.
+Pie Number of slices to send: Send
 



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.

+Pie Number of slices to send: Send
so, we do href="${inputURL}" when we use the var attribute in this example.
thanks it helped.
+Pie Number of slices to send: Send
Yup you got it
This one time, at bandcamp, I had relations with a tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1111 times.
Similar Threads
getting null value, from a variable being sent from JavaScript in the page
Why encodeURL not including Context name
About Session
jstl tags for url rewriting
write data to the database to send servlet (click)
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 17:31:18.