| Author |
Doubt in c:url
|
sakthikumaran navakumar
Greenhorn
Joined: Jul 25, 2007
Posts: 7
|
|
Hi, Can you please tell me wat will be output of this code. <c:set var =�first� value = �Hidden Cursor�/> <c:set var =�last� value = �Crounching Pixels�/> <c:url value =�\inputComments.jsp?first=${"first"}&last=${"last"}� var = �inputURL�/> Input URL : ${"inputURL"} In the HFSJ page 456 they have explained this example for Using <c:url> with a query string. There they have used first=${first}&last=${last} and in printing the output they have used it as Input URL : ${inputURL}. I wanted to know what will be impact of using the EL values with a double quotes " ".
|
Thanks and Regards,<br />Sakthi.<br /> <br />SCJP 1.4
|
 |
Chandra Bhatt
Ranch Hand
Joined: Feb 28, 2007
Posts: 1707
|
|
[sakthikumaran]: I wanted to know what will be impact of using the EL values with a double quotes " ". It is error. Your JSP page wont get translated. Thanks,
|
cmbhatt
|
 |
sakthikumaran navakumar
Greenhorn
Joined: Jul 25, 2007
Posts: 7
|
|
|
Can you please explain me how does that actual EL part with out double quotes works.?
|
 |
Chandra Bhatt
Ranch Hand
Joined: Feb 28, 2007
Posts: 1707
|
|
Following works well If you write ${"inputURL"} or ${'inputURL'} it is evaluated as String and inputURL will be the output on the browser. Following also works: Thanks, [ July 28, 2007: Message edited by: Chandra Bhatt ]
|
 |
Chandra Bhatt
Ranch Hand
Joined: Feb 28, 2007
Posts: 1707
|
|
From JSP Specification:
Quoting in Attributes Quotation is done consistently regardless of whether the attribute value is a literal or a request-time attribute expression. Quoting can be used in attribute values regardless of whether they are delimited using single or double quotes. It is only required as described below. A � is quoted as \�. This is required within a single quote-delimited attribute value. A � is quoted as \�. This is required within a double quote-delimited attribute value. A\ is quoted as \\
Thanks,
|
 |
sakthikumaran navakumar
Greenhorn
Joined: Jul 25, 2007
Posts: 7
|
|
|
Thank you so much for your explaination!!!
|
 |
 |
|
|
subject: Doubt in c:url
|
|
|