Accessing ArrayList of Bean through c:forEach

I have created a bean type array list. Now I wanna show the values in a jsp page, for which I wanna use <c:forEach> tag.
From a servlet I hv sent the arraylist thru session by
request.setAttribute("BeanVal",list);
        rd= request.getRequestDispatcher("myPage.jsp");Then in jsp page its collected as
ArrayList <ReportBean>list= (ArrayList)request.getAttribute("BeanVal");Then to show the data I used the code
<c:forEach var="i" items="${list}" >
                                    <c:out value="<tr><td>${i}</td></tr>"/>
                        </c:forEach>The list is perfectly displayed by scriptlets.Some body please help me.

Java_Subhadip_P wrote:
Then in jsp page its collected as
ArrayList <ReportBean>list= (ArrayList)request.getAttribute("BeanVal");
No need to do it.
Just get it in the c:forEach items:
<c:forEach var="i" items="${BeanVal}" >

Similar Messages

  • Problem in accessing a EJB bean through a servlet

    Dear all,
    I'm a trying to call a stateless session bean which has its home and component interfaces, which prints the name it receives from the servlet client.
    I'm trying to access a remote server EJB beans, which has been registered with JNDI & when deploying the EJB beans onto the Jboss server which operates in localhost: 8081 it has shown
    20:19:16,890 INFO  [EjbModule] Deploying greetBean
       20:19:17,109 INFO  [ProxyFactory] Bound EJB Home 'greetBean' to jndi 'greetJndi'
    20:19:17,125 INFO  [EJBDeployer] Deployed: file:/C:/jboss-4.0.5.GA/server/default/deploy/greet.jarThis is my servlet which is there in tomcat container which runs in localhost:8082 to access the bean:
    import java.net.*;
    import javax.ejb.*;
    import javax.rmi.*;
    import java.rmi.*;
    import javax.naming.*;
    import java.util.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class greetServlet extends HttpServlet
    public void doPost
    (HttpServletRequest req, HttpServletResponse res)
    throws ServletException,IOException
    res.setContentType("text/html");
    PrintWriter out=res.getWriter();
    try
         out.println("Inside servlet");
    Properties props=new Properties();
    props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
    *props.put(Context.PROVIDER_URL, "localhost:8081");*
    props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
    System.out.println("Properties ok");
    Context ctx=new InitialContext(props);
    System.out.println("context ok");
    greetHome home = (greetHome)
    ctx.lookup("greetJndi");
    System.out.println("home ok");
    greetRemote remote=home.create();
    System.out.println("remote ok");
    String a = req.getParameter("text1");
    String s = remote.greetme(a);
    System.out.println(s);
    out.println(s);
    catch(Exception e)
    {System.out.println(""+e);}
    }When i try to access the bean it's throwing a communication exception. The exact stack trace is:
    javax.naming.CommunicationException: Could not obtain connection to any of these
          urls: localhost:8081 and discovery failed with error: javax.naming.Communicatio
         nException: Receive timed out [Root exception is java.net.SocketTimeoutException
         : Receive timed out] [Root exception is javax.naming.CommunicationException: Fai
         led to retrieve stub from server localhost:8081 [Root exception is java.io.EOFEx
    ception]]Could anyone say why this is occuring and how this can be fixed.
    Thanx in advance.

    when i change the properties url attribute to jnp://localhost:1099 like
    props.put(Context.PROVIDER_URL, "jnp://localhost:1099");It's throwing unmarshall exception:
    javax.naming.CommunicationException [Root exception is java.rmi.ServerException:
    RemoteException occurred in server thread; nested exception is:
            java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
    tion is:
            java.net.MalformedURLException: no protocol: Files/Apache]Could anyone throw light on this?

  • Access a manage bean through other bean/validator

    Hello
    I want to access a session managed bean from a Validator i created.
    I did added that to my faces-config.xml :
         <referenced-bean>
              <referenced-bean-name>userDetails</referenced-bean-name>
              <referenced-bean-class>com.ibm.manageBeans.UserDetails</referenced-bean-class>          
         </referenced-bean>
    but how do i access the bean within the validator class ??
    Thanks

    I found why this happen but i can't fix it :
    It happen because the validator class is invoking
    before the bean's setters are.
    So naturally the validator get a null when he uses
    the getters.
    What should I do in such a case ?Based on what you have written I imagine you are expecting the bean's values to be set from values in the request? If you are just acting on one value, i.e. the thing you are validating then that value is passed into the validator method, you do not need to get it from a bean.

  • How to get the value of a session bean through a scriptlet

    Hi,
    I have defined a session bean in faces-config file and now I want to acces this bean object through a scriptlet. How should I go about doing that ?
    eg in faces-config file I have something like this
    <managed-bean>
    <managed-bean-name>pc_DepTest</managed-bean-name>
    <managed-bean-class>pagecode.WEBINF.Pages.DepTest</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    Now in another pager called xyz.jsp
    I want to access the pc_DepTest object through a scriptlet... How should I do that ?
    Thanks

    I avoid scriplets, but you could write:
    pagecode.WEBINF.Pages.DepTest test = (pagecode.WEBINF.Pages.DepTest) FacesKit.getBean("pc_DepTest");
    //you use WEBINF in package names? gack!
    ...Where in FacesKit you've defined:
    public static Object getBean(String expr){
        FacesContext context = FacesContext.getCurrentInstance();
        Application app = context.getApplication();
        ValueBinding binding = app.createValueBinding("#{" + expr + "}");
        return binding.getValue(context);
    }

  • Accessing the KM Respository through Portal Code.

    Hi,
    I am New to Portal development.
    I want to Access the KM Repository through AbstractPortalComponent.
    Plz Reply ASAP with code.
    Thanks and Regards
    Kiran

    Hi Kiran,
    Here's some sample code that I've got of an abstract portal component that goes through the contents of a KM folder and displays the KM description for the file:
    package com.graybar.portal.titleload;
    import com.sapportals.portal.prt.component.*;
    import java.io.File;
    import java.util.ArrayList;
    import com.sapportals.portal.prt.component.IPortalComponentResponse;
    import com.sapportals.portal.security.usermanagement.*;
    import com.sapportals.wcm.repository.*;
    import com.sapportals.wcm.repository.service.IRepositoryServiceFactory;
    import com.sapportals.wcm.util.uri.*;
    public class TitleLoad extends AbstractPortalComponent {
        public void doContent(IPortalComponentRequest request, IPortalComponentResponse response) {
              response.write("starting... <BR>");     
              response.write("***************************** <BR>");
              IUser user = (IUser)request.getUser().getUser();
              IResourceContext resourceContext = new ResourceContext(user);
              // starting folder
              RID repositoryID = new RID("/documents/TitleLoad");
              // Get the Service
              IRepositoryServiceFactory repServiceFactory = null;
              try {
                   repServiceFactory = ResourceFactory.getInstance().getServiceFactory();
              } catch (Exception ex) {
                   ex.printStackTrace();
              if(repServiceFactory == null) {
                   System.out.println("Repository Service Factory is null!!");
              try {
                   IResource resource = ResourceFactory.getInstance().getResource(repositoryID, resourceContext);
                   if( resource != null ) {
                        if (resource.isCollection()) {
                             ICollection collection = (ICollection)resource;
                             IResourceList children = collection.getChildren();
                             int resourceCounter = 0;
                             String attrType = new String();
                             response.write("size = " + children.size() + "<BR>");
                             IProperty prop = null;
                             String propValue = null;
                             String resRid = null;
                             for (int i = 0; i < children.size(); i++){
                                  String validTo = new String();
                                  ArrayList attributes = new ArrayList();
                                  IResource ir = children.get(i);
                                  if (ir.getRID() != null)
                                       resRid = ir.getRID().toString();
                                  PropertyName propNameP = new PropertyName("http://sapportals.com/xmlns/cm", "description");
                                  prop = ir.getProperty(propNameP);
                                  response.write("before <BR>");
                                  try {
                                       propValue = prop.getStringValue();
                                  } catch (Exception e) {
                                       propValue = "";
                                  response.write("after <BR>");
                                  response.write("Name = " + ir.getName() + "; Description = " + propValue + "<BR>");
                                  resourceCounter++;
                   } else {
                        // resource not found
                        System.out.println("resource " + resource.getRID() + " does not exist");
              } catch( ResourceException e ) {
                // problem while retrieving the resource
                System.out.println("exception while trying to get resource " + e.getRID() + ": " + e.getMessage());
         response.write("finished <BR>");

  • How to use Axis to access a web service through Authentication  proxy

    Using axis access internat web service is success,but access a web service through Authentication proxy is failure.But other java classes connect through a proxy to the internet which works very well:
    please help me ,thank you!!!
    import org.apache.axis.client.Call;
    import org.apache.axis.client.Service;
    import javax.xml.namespace.QName;
    //this is my access webservice faliure   codes
    public class TestClient
       public static void main(String [] args) {
           try {
                System.getProperties().setProperty("http.proxySet", "true");
                System.getProperties().setProperty("http.proxyHost","proxy.com");
                System.getProperties().setProperty("http.proxyPort", "8080");
                System.getProperties().setProperty("http.proxyUser", "username");
                System.getProperties().setProperty("http.proxyPassword","password");
               String endpoint =
                        "http://nagoya.apache.org:5049/axis/services/echo";
               Service  service = new Service();
               Call     call    = (Call) service.createCall();
               call.setTargetEndpointAddress( new java.net.URL(endpoint) );
               call.setOperationName(new QName("http://soapinterop.org/", "echoString") );
               String ret = (String) call.invoke( new Object[] { "Hello!" } );
               System.out.println("Sent 'Hello!', got '" + ret + "'");
           } catch (Exception e) {
               System.err.println(e.toString());
       }I get an "(407)Proxy authorization required" error?

    I am also looking for a solution. Does any one know how to do through code instead of jvm settings?
    Thanks in advance!

  • I get problem loading page (error 404) it says the page cannot be found when i try to access the game Mobsters through my mysapce account and i cannot access it no longer through firefox and i want to find out why i cant, can you guys please help?

    i cant access my mobsters account through myspace. every time i try to access it i get "problem loading page" "this page cannot be found" "404 error" and it wont let me access it. myspace works fine but as soon as i click on the mobsters app i get the 404 error, this page cannot be found, problem loading page! can you please help?
    == This happened ==
    Every time Firefox opened
    == i try to access mobsters game through myspace

    I dont understand the answer
    '''''""The problem can be solved by opening FF and choosing Tools...Add On's...select the SEARCH addon and choose UNINSTALL...restart FF browser when asked, then reload Mobsters. This worked for me. The suggestion on the 404 that says to remove Search via Add/Remove Programs is completely BS, as Search doesnt show there. ""'''''

  • Can I access my other email through iCloud

    Is there any way to access my other email accounts through iCloud?
    Example: My work email is through cox mail. (it is [email protected] I never really used my mobileme email (that is now in iCloud).
    For iCloud to be useful for me, I would want to access my work email through it when I am on the road. Is it possible to add other email accounts?
    Of course, I can access my cox mail through their own website - but it sure would be useful to access my calendar, mail, etc all in one place (the cloud). Isnt that the point?
    I have heard of people setting up - for example - a gmail account but have it actually LOOK like their work email to the receiver. If I cannot just add my other accounts to iCloud, is this a possibility?

    thats too bad. Oh well. So far I dont see a big use for iCloud. I much prefer the older MobileMe.
    I could park my iWeb websites of my children - with iCloud that disappeared. Kinda defeats the user-friendliness of iWeb. One click publishing through mobileme account was a great idea.
    One day there will be one spot where I can park all my stuff. I guess iCloud is not that place. Hopefully this is just the first step and it will get fine tuned and expanded in the future.

  • How can I set a third party application to access my organizations intranet through my organizations network

    how can I set a third party application to access my organizations intranet through my organizations network  . I am using blackberry bold 9700 OS 6

    Hi deepajithesh
    This feature is not available. Applications access the BlackBerry Network using the connection to BIS.
    Thanks
    -CptS
    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)!

  • Hello, I can no longer access my gmail account through the mail icon.  When I use the icon gmail tells me my password is invalid, however when I log in through Safari I have no problems.  Any suggestions?

    Hello,
    I had no problem accessing my Gmail account through the mail icon until two weeks ago.  I can still access my Gmail account through Safari, but when I attempt to access my Gmail through the mail icon, Gmail tells me that my password is invalid.  Any Suggestions?  Any help would be greatly aprecieated.
    Thanks,
    Frank

    I see you are using LastPass. Could that add-on be interfering with your login?? You could try disabling it temporarily under Tools > Add-ons to test that theory.

  • I have a Mac computer and am trying to use a Photoshop CS4 program, but after accessing my desktop files through Adobe Bridge and clicking twice on any of the pictures to get into Photoshop,  instead of entering photoshop I get an enlarged version of the

    I have a Mac computer and am trying to use a Photoshop CS4 program, but after accessing my desktop files through Adobe Bridge and clicking twice on any of the pictures to get into Photoshop, instead of entering photoshop, I get on the lefthand side an enlarged version of the picture with red, yellow and green buttons on top. Any suggestions on what is wrong, or what can be corrected ?

    And there is the problem. Your pictures are opening up in Mac's own Preview app.
    Do you want all your jpegs to open in Photoshop, or only when you are in Bridge?
    Selecting a program to open a certain file is called: File Type Association.
    You can choose this at the MacOS level or the Bridge level.
    Here's how to do both:
    Either MacOS or Bridge has the wrong app associated with the jpeg. Let's start with MacOS
    Close Bridge and Preview. Select one of your jpegs, and press Cmd i, That will bring up the file info window.
    Go down to the "Open with" section of File Info.
    Choose Photoshop CS4 and click on the Change All... button to apply this choice to every jpeg on your Mac.
    Then open Bridge and see if double-clicking opens it in Photoshop.
    Now that means all jpegs on your Mac will open in Photoshop.  Maybe you don't want that.
    You can set your jpegs to open in Preview when Bridge is closed.
    When you open Bridge, there is Preferences > File Type Associations where you can direct Bridge to open the jpegs in Photoshop when you are viewing in Bridge.

  • Can't access some secure sites through proxy?

    can't access some secure sites through proxy server on osx it just keeps going local authority couldn't be contacted, i had the same problem with parental controls, but now that is off and its still doing it, is there a setting or something i need to enable?

    In my original post, not today's, I had said I was having the issues on the Mini, running OSX 10.6.8 and Safari v.5.1.5 for my bank's pill pay. I should have been more specific as to which machine and OSX Safari browser I'm having the T-Mobile problem with. My mistake.
    It is on both the MacMini and now the Air too. A moment ago, I was able to log in to my.t-mobile.com on the Air, but after putting into my Bookmarks folder, I can't do it anymore. The Log in button comes up greyed out instead of green.
    I'm also still having trouble with my bank's bill pay section on both computers too.
    I wonder if it's related to the saving of the log in info or putting in the Bookmark Folder?

  • I can't access my pictures anymore through iPhoto because I simply don't know where they are stored when imported into iPhoto. The library used automatically before is not shown anymore. Can anyone help me to recover all my pictures?

    I had some problems with my MacbookPro and did some clean up and further back-up (time machine already in place for a long time). Now, suddenly I can't access my pictures anymore through iphoto asking me for a library (never asked for before) and I have no clue where the pictures are actually saved when imported in iphoto. Can anyone help me recover my pictures, such as telling me WHERE the pictures are actually stored? Thank you so much!

    I had some problems with my MacbookPro and did some clean up
    A critical question - exactly what "clean up" did you do and how?
    Do you have an iPhoto library in yoru pictures folder? If you depress and hold the option key and launch iPhoto - what do you see in the select library window? Select each library there and see what you have
    LN

  • Beans through jsp

    hi,
    i' m trainee developer and working in struts. i'm totally novice in this regard. my pl asked me to develop an application on struts. i'm getting problem while using bean through jsp. i'm writing code:
    <jsp:useBean id="myBean" class="MyBean" type="MyBean" scope = "session"/>
    the error is:
    cannot resolve symbol
    symbol : class MyBean
    location: class org.apache.jsp.confirm_jsp
    MyBean myBean = null;
    ^
    total 3 errors associated with it. MyBean class is located in WEB-INF/classes
    can any one help me out?

    put your bean in a package and put that package under the WEB-INF/classes directory. Then use the fully qualified class name for the jsp:useBean:
    //in the bean
    package net.thelukes.myprog.beans;
    //the jsp:useBean
    <jsp:useBean id="myBean" class="net.thelukes.myprog.beans.MyBean" scope="session"/>

  • HT201303 How can I access my itunes account through my new computer

    How can I access my itunes account through my new computer

    Your account is just a user name and password.  Just sign into your account and use it as you like.
    Are you asking about your library (music and other content)?
    It will only be where you put it.  Have you copied it from your old computer to your new one?  If not, then do that.

Maybe you are looking for

  • MaxDB on Linux

    Dear all, I am a beginner in maxdb.I have installed maxdb(7.5) on Linux and its running remotely. I connect through my current Windows XP machine. I have the DBMGUI and SQL studio running in my local Win-XP machine and I want to connect to the databa

  • How to wiggle a layer on odd frame numbers.

    Hello. I am using AE CS6. Now I am trying to make an cartoon animation, and now I am trying to wiggle some layers' position. But I don't want to wiggle the layers on every frame. I want to wiggle them only on odd frame numbers. I mean, I want to wigg

  • Question regarding ASO application in Essbase 11 version

    Hi All, Thanks for the replies to my previous posts. I have a question regarding the ASO applications for telecom company built in Essbase 11 version. Please provide your feedback on the design. The ASO application has the following number of Dimensi

  • Which size to set up project for video?

    I have a file that's 720 x 480. Which size should I use when setting up a project? 16:9 or 4:3 - thanks for the help.

  • Vista Ultimate: 64-bit Installation Problem

    Ok so I'm trying to install vista ultimate 64 bit, and when boot camp tells me to insert the disk, I did, then It restarted and when booting, it came to a black screen with white text saying: 1. 2. *+Select cdrom boot type:+* The problem here is that