This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of Darcy DeClute's Scrum Master Certification Guide: The Definitive Resource for Passing the CSM and PSM Exams and have Darcy DeClute on-line!
See this thread for details.
  • 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
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

Bean-based hyperlink not working

 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I am sure this is down to something simple, but I'm having no luck with it.


I am retreiving a collection of numbers from my business tier, iterating through this and displaying the contents as hyperlinks as per the above code. The html source generated by the above displays as:

What appears to be happening is that if I click on the hyperlink, the entire collection is sent to the ActionServlet. I can also send 'null', but am having difficulty in just sending the value represented within the hyperlink.

Your help, as always, appreciated.
 
Alana Sparx
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Still not working: have included some other info;
[code]
THe struts-config action

<action
path="/EligabilityPolicySubmit"
type="app.EligabilityPolicyAction"
name="eligabilityForm"
scope="request"
validate="true"
input="/pages/EligabilityQuery.jsp">
<forward
name="success"
path="/pages/EligabilityPolicyDisplay.jsp"/>
</action>

The struts-config form bean

<form-bean
name="eligabilityForm"
type="app.EligabilityPolicyForm"/>

The eligability form bean
/..
public void setPolicyNumber(String policyNumber){this.policyNumber = policyNumber;}
public String getPolicyNumber(){return policyNumber;}
public void setDescription(String description){this.description = description;}
public String getDescription(){return description;}
public void setPolicyId(String policyId){this.policyId = policyId;}
public String getPolicyId(){return policyId;}
../
[code]

Thanx
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First off...the id attribute of the logic:iterate is the name of the current item retrieved from the list. It seems that a name like "accountId" would be better than "listAccountIds". Second...I would expect your html:link tag to reference the current item (your id attribute) and included a paramId. I am not real clear what your beans look like (you mention account id and policy id). Maybe something like this would work:


This should generate links with a parameter "policyId" like this:

- Brent
 
Alana Sparx
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cheers Brent

I was getting mixed-up between what each of the tags specifically referred to, but managed to get some feedback on comp.lang.java.programmer, to the effect my link now looks like:


Cheers
A
 
The moth suit and wings road is much more exciting than taxes. Or this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic