aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes c:url Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "c:url" Watch "c:url" New topic
Author

c:url

Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 844
Question No: 6 (Question ID: 2404) Building JSP Pages Using Tag Libraries : Tough
Contributed By: Enthuware

Problem

Which of the following code correctly performs URL rewriting?


Options

Select 1 correct option.

1 <a href="<c:url url='/cart.jsp?userid='ramesh'/>">View Cart</a>

2 <a href="<c:url url='/cart.jsp' userid='ramesh'/>">View Cart</a>

3 <a href="<c:url url='/cart.jsp' attr='userid' value='ramesh'/>">View Cart</a>

4 <a href="<c:url url='/cart.jsp'>
<c aram name='userid' value='ramesh'/>
</c:url>">
View Cart</a>


SCJP 1.4, SCWCD 5, SCBCD 5, OCPJWSD 5,SCEA-1, Started Assignment Part 2
My blog- http://rkydesigns.blogspot.com
Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 844
According to me the correct answer should also ne a. But that is wrong.
Please advise,
Atul Samnerkar
Ranch Hand

Joined: Sep 20, 2003
Posts: 44
1 <a href="<c:url url='/cart.jsp?userid='ramesh'/>">View Cart</a>
>> in this case, the url attribute for c:url will be completed partailly coz of multiple usage of single quote. So Containter will treat the value of URL as url='/cart.jsp?userid='. Hence this is wrong.

I feel the correct answer should be 4. this way the parameter is passed using 'param'.


Thanks,
Atul Samnerkar
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Originally posted by Amandeep Singh:

Which of the following code correctly performs URL rewriting?




<c:url value="" />

Hope This Helps
Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 844
Thanks guys i got it.
Savyatha Reddy
Greenhorn

Joined: Jun 10, 2008
Posts: 14
so the attribute for c:url tag should be "value" and it is not "url". then which among the 4 options would be correct as all the 4 are using url attribure
 
 
subject: c:url