Html:link not working in struts project driving me mad, please help...

Afternoon all,
Can anyone help me with an issue I'm having with my first struts project, I'm learning as I go.
Anyway, I'm trying to create a bog standard hypertext link which passes a value back to a specified struts action. The flow of the application
is as follows:
1) search.jsp
User enters a name and postcode to search on, then click submit
2) searchAction
Struts action 'search' is called and does the search in a back-end db.
Each result found from search is created as a javabean (named resultsBean), and added to a list object. The list object is set as a request
attribute named 'SearchResults'.
The action is then forwarded on to another jsp page named results.jsp
3) results.jsp
The results.jsp page retrieves the list object from the 'SearchResults' attribute and loops through each entry
in the list and converts each entry to the 'resultsBean' javabean object.
Each resultsBean object has a getVirtualID method which stores a string value. This value is retrieved and a hypertext link is created which
passes this value on to another struts action named 'select'.
When this link is clicked on, the select struts action is called and the value passed as a parameter is retrieved.
This is the part I can't get to work, I can't get the link to render properly. When I click the link the select action retrieves
& lt;%= resultsBean.getVirtualID() & gt; as the value of the parameter 'vid' instead of the value stored in the getVirtualID method of the resultsBean.
Listed below is the code from my results.jsp page. If anyone can help me get this to work I would be very grateful.
Thanks in advance,
Alex
results.jsp code
<%
   List searchResults = (List)portletRequest.getPortletSession().getAttribute("SearchResults");
%>
<div id="table_layout" style="width: 713px; margin: 0px 0px 0px 3px;">
  <div id="row">
    <div id="column"><img src='<%= response.encodeURL("/images/results.gif") %>' alt="" width="223" height="159" border="0" /></div>
     <div id="column" style="width: 30px;"></div>
     <div id="column">
      <div id="table_layout" style="width: 460px;">
        <div id="row" style="width: 430px; border-bottom: 1px solid #4e137d;">
          <div id="column" style="width: 155px;">Name</div>
          <div id="column" style="width: 10px;"> </div>
          <div id="column" style="width: 130px;">Address</div>
          <div id="column" style="width: 10px;"> </div>
          <div id="column" align="right" style="width: 120px;">References</div>
        </div>
<% if (searchResults.size() > 0) {
       Iterator it = searchResults.subList(0, searchResults.size()).iterator();
       ResultsBean resultsBean = new ResultsBean();
       while (it.hasNext()) {
            resultsBean = (ResultsBean)it.next(); %>
        <div id="row" style="padding: 5px 0px 10px 0px;">
          <div id="column" style="width: 155px;"><html:link styleClass="results"  page="/select.do?vid='<%= resultsBean.getVirtualId() %>'" title="<%= resultsBean.getFullName() %>"><%= resultsBean.getFullName() %></html:link></div>
          <div id="column" style="width: 10px;"></div>
          <div id="column" style="width: 130px;"><%= resultsBean.getFullAddress() %></div>
          <div id="column" style="width: 10px;"></div>
          <div id="column" align="right" style="width: 120px;"><%= resultsBean.getReferenceIcons(portletResponse) %></div>
          <div id="column" style="width: 13px;"></div>
          <div id="column" style="width: 22px;"><input id="<%= resultsBean.getVirtualId() %>" name="ckbox" type="checkbox" value="" title="tick to select for merging" style="border: 0px solid #ffffff;"></div>
        </div>
<%     }
   } %>
       </div>
     </div>
  </div>
</div>
<br />
<br />
<html:link forward="/searchpage">Return to search page</html:link>

If you have part of an attribute dynamic, you need to make the entire attribute an expression.
ie instead of
page="/select.do?vid='<%= resultsBean.getVirtualId() %>'"
it has to be
page="<%= "/select.do?vid=" + resultsBean.getVirtualID() %>"
However for my approach, I would aim for zero scriptlets, and use the struts tags even more. For instance instead of an iterator, use the struts logic:iterate tag (or the JSTL c:forEach>
Also instead of div tags, I would use html table tags - <table> <tr><td> etc etc. Thats what its for right?
Here is at least some of it rewritten with struts tags.
I left out the div tags so I could focus on the "important" stuff.
<logic:iterate id="resultsBean" name="SearchResults">
  <html:link styleClass="results"  page="/select.do" paramId="vid" paramName = "resultsBean" paramProperty="virtualId">
    <bean:write name="resultsBean" property="fullName"/>
  </html:link>
  <bean:write name="resultsBean" property="fullAddress"/>
<%= resultsBean.getReferenceIcons(portletResponse) %>
<input id="<%= resultsBean.getVirtualId() %>" name="ckbox" type="checkbox" value="" title="tick to select for merging" style="border: 0px solid #ffffff;">
</logic:iterate>I'm not entirely certain what you are doing with that checkbox at the end. They all have the same name, but no value. You couldn't identify at the server end which one was clicked.
Hope this helps some,
evnafets

Similar Messages

  • My ipad mini is not syncing music onto in, my ipad has been replaced to see whether the issue is to do with the ipad but its still not working. i have a a windows PC please help thanks

    my ipad mini is not syncing music onto in, my ipad has been replaced to see whether the issue is to do with the ipad but its still not working.
    ive tried everything and ive been to the store which was when i was given a new ipad mini. i have a a windows PC please help thanks

    Are you attempting to sync music from your iTunes Music Library on your PC?
    What options do you have set on the Music Tab for your iPad in iTunes?
    What happens when you sync?
    Any error messages?

  • IPad 2 microphone not working. On 4.3.3. Please HELP!

    Just noticed that the internal microphone on my ipad 2 64 GB (white) is not working. I even tried to record a video to see of it was an application problem but the video did not record sound either and just recorded static. I am still on the 4.3.3 firmware and haven't ever had any problems.
    Thank you in advance for your help.

    Pichkeopiseth-
    The iPad 2 has been out less than a year, so it is still under warranty.  Apple should repair or replace.  Whether they replace with a new or reconditioned unit, I can't say.
    For an out-of-warranty unit, an Apple Authorized Repair Center may be your best bet, since it is probably an easy repair.
    I suggest you verify that the problem exists in at least two Apps.  One I use is the free Skype App.  Skype has a test server you can call, that will record and play back your voice.
    If the microphone works sometimes but not others, try resetting (rebooting) the iPad.  Hold both the Home and Sleep buttons for several seconds until the Apple logo appears.  Ignore the "Slide to power off" arrow.  The iPad will restart after a couple of minutes.  Resetting this way will not hurt anything, and sometimes clears up mysterious problems.
    Fred

  • Kodak printer will not work after upgrading to Yosemite.. Please Help

    I have uninstalled and re installed my kodak 5250 more than once and it still does not work. I have carried out a clean install of my Yosemite OS and still no joy. How do i fix this? 

    I've got the 7250 as well -- same exact issue. I sent an e-mail to Kodak support on Friday last week -- haven't heard anything, but they did ask for 2 business days time to respond.
    I've been running the Yosemite Beta on one of my machines for a few months now and my printer stopped working on that one after the upgrade. I kept Mavericks on my other Mac until this weekend, and printing still worked from that machine until I upgraded to Yosemite over the weekend.
    I've got Linux and Windows virtual machines that can print to the ESP 7250, so I can still print, albeit with the hassle of firing up a VM and printing from there... I sure hope Kodak responds! I offered to help them test any beta-quality drivers they may have, so -- we'll see what they say!
    I've been planning to ditch the printer and get a new one, but I'd rather not have to do it right this minute just for a driver issue :-/

  • Javascript not working in any browser except Opera! Please help!

    I don't know for what particular reason, javascript has stoppped working in all the browsers I have, (Safari, Firefox, Camino, OmniWeb,)except on Opera. Can anyone direct me in the right direction to solve this issue?

    Ok...
    1.) Unless it is a horribly designed site javascript not working would not prevent you from at least opening said site. You might not be able to use some of the features, or in the example of acual applications like gmail or then new yahoo mail you might not be able to use those at all since they are written soley for js. But for sites like VersionTracker it shouldnt make a difference.
    2.) Javascript is an interpeted language run on the client - ie the web browser. There is nothing to install. its part of the web browser youre using. You can uninstall and reinstall the browser itself but javascript is not a seperate component or something that is shared across applications that utilize it.
    Javascript is not the issue here at least in the case of versiontracker and 1010wins. I turned JAvascript off in my browser and visited both and they load jsut fine. Your eChalk mail might need js but i dont know about all that.
    So.... what happens when you try to visit one of these sites in one of the problem browsers???? Do you get a balck white screen? A server Error message? a DNS error? Does the app crash? etc..

  • Lan/Ethern​et not working but WIRELESS is... PLEASE HELP!!!

    Good Afternoon,
    I have an HP Omni-220-1025 and had to have my hard drive replaced, since that time I have been unable to go on the internet using the Ethernet setting.  My ISP came here to check their wiring to make sure and the technician told me I was missing those drivers.  Not very tech savvy (as I am learning) but I cannot seem to figure this out.
    Any help will be greatly appreciated.   P.S.  The computer also has BEATS Audio which is not working as well.... seems like drivers were not reinstalled.... Thanks just me rambling...
    This question was solved.
    View Solution.

    Hi:
    Sorry that didn't work either.
    The specs for your PC indicate that it has the Realtek 8111 gigabit ethernet adapter.
    Please see if installing the chipset driver gets the ethernet controller to wake up from its deep sleep.
    http://h10025.www1.hp.com/ewfrf/wc/softwareDownloa​dIndex?softwareitem=cp-103327-1&cc=us&dlc=en&lc=en​...=

  • I just tried to convert a PDF file to a word file and it DID NOT WORK!!!!  Can you please help?? I'v

    I just purchased the converter.  Tried to convert PDF to word document. Did NOT work!!!!

    Hi Philip,
    The attachment didn't come through, but if the problem occurs with just one file, you can use the
    File Conversion Issue form to send us your file and Adobe will take a closer look at it.
    Best,
    Sara

  • After this latest update to iOS 6, FaceTime and my WiFi network is not working for my iPhone 4S, could you please help me on what to do? I have already reset my network (which made it worst)

    Could you please help me to fix my iPhone 4S
    After the latest update we've had to iOS 6, I was not able to use FaceTime, it kept giving me an error that I was supposed to wait for an activation code which never arrived, after that I read many solutions which included resetting the networks, which I did to try and fix my problem. What this actually did was to break my network settings an now it doesn't recognize any wifi signal unless I have the router next to me and even the it is difficult.
    Now I don't have FaceTime or access to wifi with my iPhone!
    Please help me!

    Do a factory reset .. nothing will be deleted from your backups and you will be able to get access to them again.
    The Factory Reset Gen1-4.
    Unplug your TC. Hold in reset. and power the TC back on.. without releasing reset for about 10sec. When the status light flashes rapidly; release it.
    Be Gentle! Feel the switch click on. It has a positive feel..  add no more pressure after that.
    TC will reboot after a couple of minutes with default factory settings and will wipe out previous configurations.
    No files are deleted on the hard disk.. No reset of the TC deletes files.. to do that you use erase from the airport utility.

  • Photoshop CS6 not working with new version of Yosemite. Please help!

    When I was running Mavericks on my Macbook pro 15" Intel i7,everything seemed to be working completely fine. Now when I try to run Photoshop CS6 on Yosemite, the program keeps on crashing and giving me an error. Please help!

    Sometimes the Yosemite upgrade breaks the install. You may have to uninstall and reinstall CS6, and do so as an administrator.
    Gene

  • My landscape is not working i have an ipod touch 4g please help

    MY landscape worked before but just stoppted one day this is my first ipod so i dont know how to do all of the stuff yet and cant figure out how to make landscape work on my texting again please help.

    - Do you have the orientation lock on?  If on there will be a circle arrow icon with a padlock inside next to the battery indicator in the upper right. To turn off, double click the Home button and swipe the bottom row fully to the right past the music controld. Tap the circle arrow with the padlock inside
    - Reset the iPod. Nothing is lost.
    Reset iPod touch:  Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Restore the iPod from backup
    - Restore the iPod to factory defaults/new iPod.

  • UNKNOWN SYMBOL DRIVING ME MAD, PLEASE HELP!!!

    I have a symbol that has come up on my screen. It's a white box with a black dot inside and a red dot like the 'notification star' on it. It's in the same area as where you get your bbm, facebook, email, etc. notifications. I've tried going through all my apps and nothing is helping. It's driving me mad. PLEASE PLEASE HELP!

    Hi DivaAoife,
    Sounds like an update notification for BlackBerry App World. Do you have an email regarding an update? If not, you may be able to see the update notification in My World within App World.
    -FS
    Come follow your BlackBerry Technical Team on Twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.
    Click Solution? for posts that have solved your issue(s)!

  • Airport Express (AX) not found after restart....driving me mad, please help...!

    Hello,
    I tried to search for this issue but never found the solution. In the meantime, it drives me mad......so please do respond if you know the answer.
    Here is the problem. I have a WDS setup for our home, time capsule as base and several airport extremes (AX) for the wifi net through the house. In addition there is one AX for iTunes and I have one setup for the printer. Untill last week everything worked just fine. However, after installing a new printer, the printer AX blinked amber. I performed a reset and went through the setup, my AirPort Utility found it right away. I followed the steps for setting it up to join my current wireless network (usb printer). However, after the message: "The settings for this AirPort Express have been successfully updated. You can close this window or wait for this AirPort Express to restart" , the AX restarted, I finally got a message telling me there was an error joining my network. So I closed the ultility, resetted the AX and went through the process again. Unfortunately, the same result. Tried to connect the old printer, same result. Tried another AX, same result. Tried connecting it with a LAN cable, same result. It all goes fine untill right after the restart phase. NExt the AX is not recognized.
    As nothing has been changed in the meantime, I have no clue at all what might be the problem. Anyone ????
    Looking forward to the answer, untill now, I have not been able to find a solution.
    Kind regards,
    Mark

    Mark,
    I am having the same problem.  I found this website, not sure if you have already given this a try.
    http://adamantventures.com/blog/airport-express-setup-troubleshooting/

  • After update to version 12, iTune will not work on some of my idevices. Please help!!

    I have total of 7 iDevices (iPhone + iPad), after I update iTune to the latest version which is v12 then only 2 of my iPad 4 can performed the update the rest were not recognize by iTune.

    list your iDevices by:
    the ones that Don't work
    the ones that Do work
    be sure and give corresponding iOS versions
    ÇÇÇ

  • Preloader not working for 35 MB swf file. Please help!

    Hello,
    I'm working on a glorified slideshow, it has a music track that is 3+ minutes long, pretty nice graphics, and transitions. I started builing in Flash and am halfway done... it looks great too !
    Problem is, when I'm testing the preloader with the download profiler set to DSL - it crawls and at 1% and on, the soundtrack starts to play... by the time the download is at 42% its at least a minute into the soundtrack and it's in and out, coming on then cutting out but not starting over. Needless to say, this is not okay! I know it's a huge file. SHould I maybe export it as an mov and put it in a FLV player?
    Thanks for reading & helping
    Ms.Lee

    Ok, so my preloader code was all wrong, now it's this:
    import flash.events.ProgressEvent;
    var request:URLRequest = new URLRequest("HitTheGround6.swf");
    var ldr:Loader = new Loader();
    this.addChild(ldr);
    ldr.x=0;
    ldr.y=0;
    ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
    ldr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressHandler);
    ldr.load(request);
    function progressHandler(evt:ProgressEvent):void {
        var percent:Number = evt.target.bytesLoaded / evt.target.bytesTotal;
        preloader.fill.scaleX = percent;
    function completeHandler(evt:Event):void {
        this.removeChild(preloader);
        evt.target.content.gotoAndPlay(2);  //this is the key
    This awesome blog post has the files & explaination!!!
    http://www.negush.net/blog/how-to-preload-as3-clips/

  • Iphone airprint does not work on my new HP8500 Premier (a910n). please help.

    I just got the HP 8500A premier printer (a910n) and it's set up for wireless printing from my 2 laptops at home.  I just tried printing from my iphone 4 but it is unable to locate the printer. 
    Does anyone know how I can fix that?  The product page clearly said this model works with apple's airprint...  but i don't find any info.
    Thanks!

    Airprint DOES work with HP 8500!!!!!!!!!!
    1. Make sure your computer is connected to your network and is on.
    2. Go to the hp website. Find the page for drivers, software and downloads and go there.
    3. Select your product ( ie. hp 8500a plus all-in-one). Find "firmware" in the list. If you aren't sure print a test page from your printer and get it from there.
    4. Download the file, save it to your desktop.
    5. After it saves to your desktop, open the file and click "run".
    6. Tell your computer and your anti-virus to trust and to continue.
    7. After running the update, you will see a bar go across your computer screen saying that it is updating your printer. If you then look at your printer, it should show a green screen, this means it is working. Give it time to do its thing. The screen might flash on and off, but that is ok.
    8. Finally, your printer will turn off and restart, which means the download is complete, it will also print off a "Self Test Diagnostics" page.
    9. On your computer, it should say it is completed updating your printer where it had the bar going across saying it was updating it.
    Now you should be able to print from your iphone, ipad, or ipod using airprint.
    Enjoy!

Maybe you are looking for

  • Migrar de TAXBRJ para TAXBRA

    Bom dia pessoal , preciso de uma ajuda de vocês. A empresa que estamos dando suporte quer trocar de TAXBRJ para TAXBRA, no entanto não fizemos isto antes e não sabemos os possíveis impactos na operação, se podemos ter pedidos de compras abertos, orde

  • Regarding datasource i'e., The OLTp source still has errors

    Hi experts, I was getting an error while creating datasource i.e, "The OLTP source still has errors". Last 2 days onwards i was getting this error. Previously i have created many datasources.Eventhough i was gettign sam error while doing any changes

  • ITunes 10.5 on Windows 7 (64) - can not sync

    Hello, I've upgraded my iPhone 4 to iOS 5.0, and iTunes to 10.5 (Windows 7 64 bit). Now, when I connect my iPhone to the iTunes, the Sync button in iTunes is disabled, and single yellow bar is shown at the left (where capacity is typically being disp

  • Producer Consumer Start Trigger

    Short Explanation: I'm using a 3rd party device to send a TTL signal to use as my start trigger in my VI. My cDAQ and modules appear to have the ability to send a start trigger independantly but I have been unable to hunt down how to do this in a pro

  • Java files from a EAR file and from inner (inside EAR)

    I want to read all Java files from a EAR file and from inner (inside EAR) EAR or WAR file with out unpacking. suppose "Demo.ear" contaions the following files: abc.java programs / a.java programs / b.java src / index.java src / com / myFolder / main.