This week's book giveaway is in the Java in General forum.
We're giving away four copies of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 and have ishori Sharan & Adam L Davis on-line!
See this thread for details.
Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

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
 
reply
    Bookmark Topic Watch Topic
  • New Topic