• 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

Doubt in c:url

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 " ".
 
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[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,
 
sakthikumaran navakumar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you please explain me how does that actual EL part with out double quotes works.?
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you so much for your explaination!!!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic