Accessing list-backed properties in JSP

Hello guys,
I am trying to generate a dynamic form using the list-backed properties following the guide in
http://struts.apache.org/struts-action/userGuide/building_controller.html#map_action_form_classes
It works as a map but can't make it work as a list
here is my jsp
<html:form action ="/addTemplate.do">
     <%List attributesList = (List) request.getAttribute("attributesList");
                    Integer count = new Integer(attributesList.size());
                    session.setAttribute("count", count);
                    session.setAttribute("attributesList", attributesList);
                    for (int i = 0; i <= count; i++) {
                         String name = "value(addTemplate-" + i + ")";
     %>
<!--make a list-->
          Attribute<%=i%>
                    <html:text property="<%= name %>"/>
          <br/>
          <%}%>
          <html:submit/>
          </html:form>and my bean
public class AddTemplateForm extends ActionForm {
    private final Map values = new HashMap();
    public void setValue(String key, Object value) {
        values.put(key, value);
    public Object getValue(String key) {
        return values.get(key);
}when I am trying to use a list , obviously modifying the bean and my jsp to
String name = "value[" + i + ")";I am getting
javax.servlet.ServletException: Exception thrown by getter for property value[0] of bean org.apache.struts.taglib.html.BEANusing a map I don;t really know how to get the properties values in the Action class
Any help is appreciated

try this.
<html:select property="selectedCountries" multiple="true" size="4">
<html:optionsCollection property="availableCountries" label="name" value="id">
</html:select>
public OptionsRecord
// make corresponding setters and getters
private String name;
private String id;
// constructor
public OptionsRecord(String nm, String idd)
name = nm;
id = idd;
----- Form class ----
public TestForm extends ActionForm
// make setters and getters for the following.
private String[] selectedCountries = new String[0];
private Collection availableCountries = new LinkedList();
init()
availableCountries.add(new OptionsRecord("Australia", "001"));
availableCountries.add(new OptionsRecord("Burma", "002"));
availableCountries.add(new OptionsRecord("USA", "003"));
Don't forget to reset selectedCountries to a new object.
-----

Similar Messages

  • How to access list box variable in jsp

    hi.......I'm new to jsp ...pls help me with the following.....i've created a form with some list boxes ,text boxes and radio buttons.....now i need to access the variables of these elements in order to validate and display them.....what is the syntax in jsp for accessing the list box variable(or txt box or radio button)
    tnx in advance.....

    You normally use a Servlet class for this. You can get request parameters by HttpServletRequest#getParameter() or #getParameterValues() then.
    This is fairly trivial though. Please go through a decent JSP/Servlet book/tutorial first.

  • Why does MAX say %22The remote access list on this system is blank%22%3F

    I am building and deploying a real-time data acquisition/control system using LabVIEW RT (2012 SP1) and a PXI controller.  I've tested my software, and it runs fine, now that I've figured out how to build stand-alone executables for both the Host and RT Target systems.
    Due to a bug on the RT side (which I hope I've now fixed), I needed to "rebuild" my PXI Controller, reinstall LabVIEW RT and related software, and reconfigure all of the Tasks in MAX (version 5.5).  To save the Configuration (and simplify reconfiguring the Tasks and Channels), I tried to export the configuration using the Configuration Export Wizard in MAX.  However, there were some (minor?) inconsistencies in some of the devices (such as NI-488.2) between the Host and Remote systems that generated some errors.  I was able to correct this by asking MAX to do a Reset Configuration Data on the Host, and those problems went away.
    After exporting the NI Configuration Export File for my PXI, I decided to use MAX to Create Reports on both my Host and Remote PXI systems.  While reviewing the PXI's report, I noticed that the last entry in the report, called "Security", reads as follows:
    "The remote access list on this system is blank. This means that no remote system has access to this system."
    What does this mean?  Where is the "remote access list on this system", and how is it maintained?  Note that I haven't (yet) tried deploying my (formerly-working) Project to this (rebuilt) Controller, but I haven't made changes in LabVIEW, itself.
    If I look at the Properties of the RT Target in Project, the VI Server properties (still) show TCP/IP enabled (port 3363) with Machine Access given to "*" (all machines) and, similarly, all Exported VIs allowed access.
    Am I missing something?  Can I safely ignore the above Security report entry generated by MAX, or is there a hidden setting I need to find and change?
    Bob Schor
    Solved!
    Go to Solution.

    Norbert_B wrote:
    Bob,
    i am not sure about your situation, but it seems to me that it is connected to "Security" Settings. Please refer to the help in MAX, topic "Logging into your System".
    Norbert
    I agree, but I've never heard about "Security Settings" in MAX. When I first read your note, I went looking and couldn't find "Logging into your System".  I came back a day later, was going to write a "There is not such topic!" reply, but fortunately I looked again, and found it.  I suspect the reason I never ran into this was that my controllers were all using older BIOSes -- I'd just "rebuilt" this controller, including updating its BIOS, and ran into the Login prompt for the first time ...
    Thanks for pointing me in (what turns out to be) the right direction!
    BS

  • Accessing bean attributes in a JSP

    Hi,
    I am sending a bean from a Servlet to a JSP as follows:
    request.setAttribute("newclientTEST", ro_client);
    this.getServletContext().getRequestDispatcher("/jsp/private/research/UserAdded.jsp").forward(request,
    response);I can then access the bean in UserAdded.jsp page as follows:
    <jsp:getProperty name="newclientTEST" property="username" />This works fine and returns the username from the bean but I am a little confused why this is working. From what i have read about JSPs so far in order to access properties of a bean in a JSP we first of all have to make a reference to the bean as follows:
    <jsp:useBean id="newclientTEST" scope="request" class="ie.scourced.beans.PrivateClientBean" />Why does it work for me when I don't refer to the bean using useBean??
    Thanks

    how?.... mmmm ... did ... (head scratch) ...I miss that.
    Thanks a million for spotting that, I really did appreciate that.
    jp.

  • We can figure this standard access list

    We can figure this standard access list that's important remember that we use a standard access list  want to block all traffic or permit all traffic from a particular
    source or destination let's take a look at this machine right here   that  is IP address say
    640-554 we want to stop him from going into the Ethernet interface I'm the ad man he made me midsummer block callers traffic he can get out anymore maybe this is even the internet out
    here we know people like their Internet access so to get back at them I'm a block it what I can do is I can use deny statement in my access list access list
    one did not .
    http://640-554cisco.com/

    Hi Suresh,
    ad 1) according to the documentation ( http://docs.oracle.com/cd/E28280_01/doc.1111/e26692/securityacls.htm#BEIIHJAH )
    "At least one of the following must be true for a user to be granted a particular permission:
    The user's name appears in the xClbraUserList metadata field with the appropriate permission.
    The user belongs to a group that appears in the xClbraAliasList metadata field with the appropriate permission.
    The user is part of an Enterprise role that appears in the xClbraRoleList metadata field with the appropriate permission."
    meaning that OOTB a user will be granted both Read permission as per user-granted permissions and RWD as per group-granted permissions (resulting into RWD because at the same level a union operation is used).
    I'd say that conceptually, the group assignment should not be used in your use-case, because you don't want to assign permissions to group's users, do you? You could create new groups, or use assignment of permissions per user.
    ad 2) check this: http://docs.oracle.com/cd/E28280_01/doc.1111/e26692/securityacls.htm#BEIIDCGD
    Using ACLs, regardless User or Group Access Lists, always impacts the performance. And, it is difficult to maintain. From the information at the link you may understand how it is implemented - basically, the execution of the query will be affected by: a) how many items have to be evaluated b) the length of strings (xClbraUserList, xClbraAliasList) to be evaluated.

  • Calling function from Backing Bean or JSP page

    We are on Jdeveloper 10.1.3.3.0, ADF Faces, JSF Faces .., Currently there is a function call from Javascript event (onmouseover) in the JSP page. I want to call this function from a backing bean or JSP page, as I have to pass some values to this function.
    For Ex., I have a function call like return submit('A','B','Test'); on the Javascript event (onmouseover) in jsp page. I want to remove this function from the javascript event and call from backing bean or jsp page to pass some values into the submit() function. I appreciate if anyone can give some example of how to call this function from backing bean or jsp page in the <SCRIPT> or <SCRIPTLET>
    Thanks,
    Ram

    A use case would be helpful so that we can get a better idea of what you want to do.
    As a general rule, there is no way to call a client side Javascript function from a backing bean, which is server side. However, there are ways to inject information from a backing bean into your Javascript call. For instance, I have an application that uses Google Maps API. It has an onload call to a Javascript function that builds the map and designates it's center point. The center point comes from a backing bean as latitude and longitude properties. So here is my body tag:
    <afh:body onload="initialize(#{backing_searchResults.latitude},#{backing_searchResults.longitude},#{searchCriteria.distance})"
              onunload="GUnload()">onload calls the Javascript function called initialize, and passes the latitude, longitude, and distance from the bean. Is the function really being called from my backing bean? No - the parameters are hard coded into the onload event code when the page is rendered. Does it do the job? Sure it does.

  • IP address is not on the target's allowable access list.

    when trying to deploy a lvlib or downloading code from a PC to a FP controller I get this error message "Access denied: This host computer's IP address is not on the target's allowable access list.". I have added the PC's IP address from within Max on the access list of the FP target (althoug default is full access to everyone). This did not help, I still get the same error message. Both systems are on the same IP segment.
    sincerely
    søren h. jensen

    Hello,
    Short of time right now, but I had the same problem: Here is a dump of my own notes on how I solved the pbolem (not necessary to reinstall software):
    I attempted to update these data with Measurement & Automation Explorer (MAX) using the "FieldPoint Access Control" panel in MAX: I set "*" and Read/Write and pressed "Apply": MAX Claims it has updated the Access Rightsm, but we are still unable to Deploy the CFP from the Project Explorer.
    SOLUTION:
    Use WS_FTP-PRO (or any FTP Client) and access the IP Address of the FieldPoint using anonymous login.
    Transfer the file ni-rt.ini from the root of c:\ on the Fieldpoint to the local PC and edit the settings as shown below.
    FTP the file back to the Fieldpoint.
    Set the following settings in "server.tcp.access" and "RTTarget.IPAccess":
    server.tcp.access=""+*""
    NOTE: Double Quotes here
    RTTarget.IPAccess="+*"
    NOTE: Single Quotes here
    +* means every IP address can access.
    It turned out that MAX had left the following (probably illegal) values in the fields:
    """" and ""
    Geir Ove

  • Unknown devices appearing in my access list

    I have a WPN824 wireless router and in the last two weeks, I've found three devices in the access list that I didn't put there.  I first found the three devices last week and deleted them from the list.  Tonight, I found them again.  All three devices have different MAC address, but use the same device name: "NMADDR."  My access list has 12 devices that I added for all the devices I've want to connect
    The router is connected to a broadband cable (ComCast) modem. 
    I manage the router and am the only one with the password. The passsword is a strong 10 character password.
    I use Cisco's Network Magic Pro v5.5.9 to manage my home network.  
    I was wondering if anyone else has run across something like this and can explain how these devices can be "automagically" added to what I thought was a secure router?
    Thanks.

    May I suggest that this could be either a PDA device, an Apple iTouch or perhaps a WiFi mobile - I had a similiar issue a little time back and this was the ghost in the system.

  • HT1766 Is there way of accessing your back up data without the use of an i-phone?

    Is there a way of accessing your back up data from the computor without the use of an i-phone?

    If it wasnt activated prior icloud wont help now. Did you ever use the save and print option to "send it itunes"?  I did that all the time prior to icloud to back up my docs. Then you can "copy from itunes" in the new document dialog.
    I still recommend doing the export to iTunes to create a local back up copy on ocassion.
    For future reference, To activate icloud for documents, go into the main settings app, tap icloud, then documents and data, and turn it on. Then go to the app (maybe numbers) further down the main settings list, tap it and turn on "use icloud".
    Jason

  • NAC access list question

    so we have a NAC in our lab, set up as L3 OOB....we have a vlan set up for internet only access..a route map is configured on the CORE to send the internet only traffic back to the NAC for restrictions (to mimic the inband solution)......in our unauthenticated role policy, we set up the access list on a vlan to only access the internet and block internal address...the weird thing is, the access list on the NAC works on any internal addresses, but when the pc pings/telnets the CORE itself (and any mgnt ip addresses) it works?????....anybody know the reason why...im sure a workaroud is to put an acl on the CORE itself to block that...
    Hope my drawing is enough to assist.....
    CORE--------l3 switch--------pc
    |
    |
    |
    NAC

    That's a great idea - the ACL on the management interfaces of the devices.
    Is the ACL for the unauthenticated role on the L3 switch or the Core?
    I would guess it is on the L3 switch, since it is likely the default gateway for that unauth vlan.
    peter

  • Show ip access-lists with remarks?

    We have a 6509E and use ACLs for our SVIs.  When viewing specific ones created I use "show ip access-lists NAME" and when finding remarks I have to constantly go back to the "show run | b NAME" but its seems clunky.  Is there way to see the view of the first with the sequence numbers but show the remarks that I can only find in the show run?

    Ok , i understand that i will have to use the public IP in my ACL on the ADSL connected interace.
    If i obtain a private IP on my ADSL interface from the ISP, then is it the best method to aply the ACL on the LAN interface and assign it as IP ACCESS-GROUP xxx OUT ????
    And one more question.
    I understand the concept with ACL with one public IP that will be NAT (overloaded). What if i am using multiple public IPs that i will NAT on all of them ???
    how does this affect my ACLs. Is there a way around this ????
    Thanks,
    George

  • Found a site in "history" frm 3/7/2014 and double clicked to see it--now it "removed" that site from the 3/12 history, need that listing back

    Found a site in "history" from 3/7/2014 and double clicked on it to insure it was the correct site I was searching for--now it "removed" that site from the 3/7/2014 history and its only listing is this morning; I need that listing of the original visit back in my history so I can prove I visited it on 3/7.....I can list the number of times it was visited, but I need the listing "back" with the date of when the site was visited ...any help would be appreciated

    See:
    *[[/questions/931864]] Can I access all dates that a website has been visited?

  • Removed ip access-list & lost network connectivity

    An access-list was removed to edit and replace. Once the access-list was removed we lost network connectivity to the remote router. This list is an extensive one. But when we remove on other remote routers network connectivity remained. Can anyone tell me why? Is this a typical of access-list, and good practice is to wait until after business hours?

    No problem.
    I am sure that we have all had experiences of looking at things we have written, or questions answered, and realized that what we wrote was not quite what we were thinking as we created it.
    Your main point is well taken that it is good practice to remove the access-group before removing and changing the content of access lists.
    Sometimes I take a slightly different approach: I will build a new version of the access list using a different number (if I am changing access list 101, I may create list 102) which is the modified version of the list. I then change the access-group to reference the new version of the list. This may have a couple of advantages including the fact that the interface is always protected by some access list. Also it makes backing out changes easier if we discover that there was some flaw in our list modification.
    HTH
    Rick

  • Wi-Fi Card Access List no longer accessible

    At Telstra's suggestion I recently upgraded to a Telstra Gateway Max router. I set it up in the same way as my previous router with a Wi-Fi Access list of MAC addresses of devices to which I chose to give access to my Wi-Fi network. Yes I know that is not absolutely necessary but the facility is there so why not use it. Some time in the past few weeks the firmware on the router has been updated to cater for the new Telstra Air function. At the same time the ability to maintain the Wi-Fi Card Access List has disappeared although it still shows on the Help screen for the W-Fi functions. So now I am no longer able to add new devices or delete old devices from my Wi-Fi card Access List which is still being recognised by the software. This is a little like buying a family-size car and then having the dealer weld the back doors shut. The Telstra support staff struggle to understand the problem and suugest I contact the higher level support area who will not charge me if they can not solve the problem. Why should I pay for Telstra to solve a problem they caused! Has anyone else had a similar issue and how was it resolved?   

    It is something which has come up a few times since the release of the new Firmware update, it looks like it might be something to do with making Air work... but a number of features of the device in its initial state as intended by the manufacturer have been removed or limited by the Firmware in order to ensure the system runs as Telstra intend it to run... it is a matter of give and take... you have less features but it makes it simpler for the 'average user'...

  • Questions on Reflexive Access Lists

    Hi Sir,
    I'm trying to protect a server farm using reflexive access lists. I also would like any hosts to originate connections to the servers on TCP ports 23 (telnet) and 25 (smtp).
    The config on the core router is as follows:
    int Vlan10
    description *** Server Farm ***
    ip address 172.16.10.1 255.255.255.0
    ip access-group inboundfilters in
    ip access-group outboundfilters out
    int Vlan20
    description *** Marketing Department ***
    ip address 172.16.20.1 255.255.255.0
    int Vlan30
    description *** Engineering Department ***
    ip address 172.16.30.1 255.255.255.0
    ip access-list extended outboundfilters
    permit tcp any any eq telnet
    permit tcp any any eq smtp
    evaluate iptraffic
    ip access-list extended inboundfilters
    permit ip any any reflect iptraffic
    My questions:
    (1) I yet to test the above config on an actual router. However, is it correct theoretically?
    (2) If I were to allow outside hosts to initiate connections to the servers on more protocols/ports, I would be adding more normal "permit" statements in the outboundfilters ACL before the "evaluate" statement. Wouldn't this become very static-based, as far as security is concerned?
    (3) If you have other better feature options that meet my requirements, please do recommend.
    Please advise.
    Thank you.
    B.Rgds,
    Lim TS

    Hi Lim,
    CBAC is good as well, considering the following features:
    1. Traffic Filtering:
    - filters TCP and UDP packets based on application-layer protocol session information.
    - permit specified TCP and UDP traffic through a firewall when the connection is initiated from inside protected network, or outside network.
    2. Traffic Inspection
    - discover and manage state information for TCP and UDP sessions which is used to create temporary openings in the firewall's access lists to allow return traffic and additional data connections for permissible sessions.
    - Protect against DoS attack by checking/verifying sequence no (must be within the expected range) and discard unknown packets. Same goes to attack via fragmented IP.
    3. Alerts and Audit Trails
    - can send real-time alerts and audit trails to syslog server (or buffer log)
    4. Intrusion Detection
    - Embedded with 59 well-known IDS signatures. Similar to IDS features in PIX.
    Limitations:
    1. Only protect protocol you specify. The rest will depend on ACL you have in the router but not up to session layer.
    2. No protection for attacks originating from internal network, unless if you have firewall (pix/asa/ios-firewall) protection.
    3. Only protect certain type of well-known attacks only - based on 59 embedded IDS signatures
    For spoofing protection, i.e spoof attack from outside/common user segment, maybe you should apply RFC2827 (prevent IP on protected segment from coming back into that segment from outside). Make sure your ACL has the 'establish' keyword as well. As recommended by Cisco, you should apply multiple layer of security protection both on your router and other devices connected to it.
    Cheers!

Maybe you are looking for

  • SBO 2005 SP1

    I have SBO 2005 A on my computer. I have just downloaded SBO 2005 SP1. What are the differences between SBO 2005 and SBO 2005 SP1?

  • Time Machine now available for advanced configuration on 10.5.2 ?

    Just updated my server to 10.5.2 and the first thing I noticed was a new time machine icon in the menubar, the server is advanced configuration and previously I thought time machine wasn't supported, does anyone know if this means it now is, or it ju

  • ASO SEND Issue

    Good morning How robust is the send function when using an ASO database? I have had an issue recently where the database locks up (error message "Cannot Send, Cannot Receive data") This seems to corrupt the database Has anyone experienced this before

  • Keynote scale animation "jumps" in iBook

    I want to use the scale animation on a character in a keynote presentation. when I import it into ibooks author with the keynote widget i get no errors. But when I play it in the ibook there is a strange bug: After all animations on the slide are fin

  • Warning message "Your device might not be able to play or view this file" when copying MP3s to MTP device

    Some new phones are doing away with the virtual HDD and switching to MTP for transferring files to/from the device. Because of this every time I want to copy MP3s to my MTP device I get a Windows message saying "Your device might not be able to play