aspose file tools*
The moose likes JSP and the fly likes JSTL Help needed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSTL Help needed " Watch "JSTL Help needed " New topic
Author

JSTL Help needed

sonali sawant
Greenhorn

Joined: Oct 24, 2005
Posts: 13
Hi I want to replace following code of JSP with JSTL tags..

<td>
<a href="getretailercardinfo.do?retailerCardId=<%=retailerCardVO.getRetailerCardId()%>"><%=retailerCardVO.getCardNumber()%></a>
</td>


I replaced the code like below..

<td>
<a href="getretailercardinfo.do?retailerCardId= <cut value="${retailerCardVO.getRetailerCardId()}"/><cut value="${retailerCardVO.getCardNumber()}"/>></a>
</td>

But its giving error 'Element is not closed'...
Can anyone tell me where is the error?..
badri nath
Ranch Hand

Joined: Dec 21, 2005
Posts: 57
Hi Sonali,

<a href="getretailercardinfo.do?retailerCardId= <cut value="${retailerCardVO.getRetailerCardId()}"/><cut value="${retailerCardVO.getCardNumber()}"/>></a>

You have not closed the inverted comma, the one in bold.

More over, you will not call the getter directly like you were doing
<cut value="${retailerCardVO.getRetailerCardId()}"/>

It should be some thing like
<cut value="${retailerCardVO.retailerCardId}"/>
Mario Rezende
Greenhorn

Joined: Dec 13, 2006
Posts: 5
Try this:
1) Create a Instance of your class (may be in the top of the page):
<jsp:useBean id="retailerCardVO" class="com.site.YourClassName" />

2) Invoque the methods:
<td>
<a href="getretailercardinfo.do?retailerCardId=<cut value="${retailerCardVO.retailerCardId}"/><cut value="${retailerCardVO.cardNumber}"/>></a>
</td>

Note: You don't need the "get" and "()" when invoque a method in a TagLib.

Good Lucky :]
sonali sawant
Greenhorn

Joined: Oct 24, 2005
Posts: 13
Thanks Badri and mario.
I made changes and used usebean.Thanks.It is my first day of work in JSTL.Now program is not giving any error.
...Sonali
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSTL Help needed