File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes How to use a href tag within a custom tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to use a href tag within a custom tag" Watch "How to use a href tag within a custom tag" New topic
Author

How to use a href tag within a custom tag

Anjali Naveen
Greenhorn

Joined: Jun 28, 2005
Posts: 15
Hi
I have a custom tag which has to render a link. Im using a href for rendering the link

String str ="a href="+actionName+"?method="+methodName+"&productId="+productId+"&productName=" + productName+">"+ productName+"</a>";

The product id and name is retrieved from the data base
The link works fine except that if the product name consists of spaces, the spaces dont get passed through the request
Eg: If the product name is 'Photo Frame' just Photo gets displayed on the next page
How do i ensure that the spaces are escaped within the string
Plz help
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to use a href tag within a custom tag
 
Similar Threads
Displaying Non-English Characters in XML attribute
Part of Composite-Id is foreign Key:How specify in Mapping?
shopping cart prob
Setting string variable with bean tag
need to transfer productID from url to action class in struts 2