How do I pass objects into EL so they can be printed with c:out ?

Hi, I have an already made jsp and it contains data that is printed with <c:out>
<c:out value="${model.biz.address.city}" />Now I would like to make changes to the page, but still use these object names. I'm pretty new to java, so I just assumed to make classes: a big class for model with basic fields; a secondary class for biz, containing name, description, etc in public fields; and an address class, which holds the city, state, etc variables.
I have tomcat/jstl. On the server, there is all this database code and etc that will provide the information, but as for me, I would like to make a simple page, that will have just one model with all the information filled in, so that, I can use the ${model.biz.address.city} or ${model.biz.name} or whatever information objects I've provided.
I can access my classes with <% out.println(model.biz.name) %>, but I can't access it with EL. How can I do it?
I mind you there is nested information: model has model.biz & model.user; biz has biz.name, biz.phone, biz.email, and biz.address; biz.address has address.address1, address.address2, and address.city, etc.
ANY help will be greatly appreciated! Thanks!

Geez .. Your class doesn't fulfill the javabean specifications. The properties should not be public.
It should rather look likepublic class TheAddress {
    // Properties ---------------------------------------------------------------------------------
    private String address1;
    private String address2;
    // Constructors -------------------------------------------------------------------------------
    public TheAddress() {
        // Default constructor.
    public TheAddress(String address1, String address2) {
        // Full constructor.
        this.address1 = address1;
        this.address2 = address2;
    // Getters ------------------------------------------------------------------------------------
    public String getAddress1() {
        return address1;
    public String getAddress2() {
        return address2;
    // Setters ------------------------------------------------------------------------------------
    public void setAddress1(String address1) {
        this.address1 = address1;
    public void setAddress2(String address2) {
        this.address2 = address2;
}

Similar Messages

  • How to cast an Object into a specific type (Integer/String) at runtime

    Problem:
    How to cast an Object into a specific type (Integer/String) at runtime, where type is not known at compile time.
    Example:
    public class TestCode {
         public static Object func1()
    Integer i = new Integer(10); //or String str = new String("abc");
    Object temp= i; //or Object temp= str;
    return temp;
         public static void func2(Integer param1)
              //Performing some stuff
         public static void main(String args[])
         Object obj = func1();
    //cast obj into Integer at run time
         func2(Integer);
    Description:
    In example, func1() will be called first which will return an object. Returned object refer to an Integer object or an String object. Now at run time, I want to cast this object to the class its referring to (Integer or String).
    For e.g., if returned object is referring to Integer then cast that object into Integer and call func2() by passing Integer object.

    GDS123 wrote:
    Problem:
    How to cast an Object into a specific type (Integer/String) at runtime, where type is not known at compile time.
    There is only one way to have an object of an unknown type at compile time. That is to create the object's class at runtime using a classloader. Typically a URLClassloader.
    Look into
    Class.ForName(String)

  • How To Insert A object into Conext

    Hi Techies,
    I have 8 tables in my designer
    and I have two contexts at designer level
    And how to insert a object into a context that is not referencing any table.
    For Example I have an object like "rownum" (Which should must be added at Universe level only not at report level). Here this object is not referencing any table and I want this to be used in a query where the remaining objects are coming from the context..
    Thanks in Advance..

          Double-click the Objects and click the TABLES button and select the table you want to associate the object to for the context to work properly (see below).
    Regards,
    Ajay

  • How to convert Java Objects into xml?

    Hello Java Gurus
    how to convert Java Objects into xml? i heard xstream can be use for that but i am looking something which is good in performance.
    really need your help guys.
    thanks in advance.

    There are apparently a variety of Java/XML bindings. Try Google.
    And don't be so demanding.

  • How to upload a file into server using j2ee jsp and servlet with bean?

    How to upload a file into server using j2ee jsp and servlet with bean? Please give me the reference or url about how to do that. If related to struts is more suitable.
    Anyone help me please!

    u don't need j2ee and struts to do file uploading. An example is as such
    in JSP. u use the <input> file tag like
    <input type="file"....>You need a bean to capture the file contents like
    class FileUploadObj {
        private FormFile srcFile;
        private byte[] fileContent;
        // all the getter and setter methods
    }Then in the servlet, you process the file for uploading
        * The following loads the uploaded binary data into a byte Array.
        FileUploadObj form = new FileUploadObj();
        byte[] byteArr = null;
        if (form.signFile != null) {
            int filesize = form.srcFile.getFileSize();
            byteArr = new byte[filesize];
            ByteArrayInputStream bytein = new ByteArrayInputStream (form.srcFile.getFileData());
            bytein.read(byteArr);
            bytein.close();
            form.setFileContent(byteArr);
        // Write file content using Writer class into the destination file in the server.
        ...

  • How to put my podcasts into playlist folders? Can't drag'em.

    How to put my podcasts into playlist folders? Can't drag'em.
    I've subscribed to a number of podcasts & they appear in my iTunes window under the Podcasts section.
    There i have
    2 problems:
    1st: I can't rearrange or group them so can listen consecutively to different topics.
    I must listen to one, then come to the keyboard and select the next to start playing. Now, I know that I can get them to play consecutively once I've placed them into Playlist folders,
    but that brings me to my second problem:
    2) I can't drag and drop them into separate iTunes FOLDERS (by topics).
    (Though I have been able to drag&drop separate items from my 'Music' section into iTunes playlist folders.)
    But can't drag from Podcasts section into Playlists,
    as everytime I try they just refuse to go in and scurry back to their starting position under Podcasts.
    Zupwidiss? This can't be.
    I would be grateful for your solution.
    And also grateful if I could have easily found the solution explained
    before I had to resort to bothering this forum with this question.
    Just using my MacMini, Snow Lep.

    Thanks very much.
    You have reminded of the
    difference between
    Playlists and Playlist Folders:
    One can only drag things from the Master list into PLAYLISTS.
    And can only drag Playlists into Playlist Folders.
    I'm an older man, and easily confused by these things.
    Many thanks to my friend in Germany.
    P.S. Your English is excellent.

  • Laserjet 2605dn - how do I turn it into a black and white only printer?

    How do I turn it into a black and white only printer?
    I just bought ink replacement for a whopping $563 which is way too much. My ink supplies have run out. I replaced the Balck ink but the printer is stuck in the "replace supplies" error w/ orange light flashing.  Is there any way to re-configure the printer to only use as a B/W printer?

    Found myself in the same boat. Try this link, worked for me
    ebay review
    As for printing in B&W only, I don't think this printer has that capability, at least from what I've read. 
    Message Edited by j_s on 02-06-2009 08:51 PM

  • How can I print with a wider left margin in Preview? (OSX 10.5)

    How can I print with a wider left margin in Preview? (OSX 10.5)
    To punch Binder Holes.
    Should be easy ... Make a Custom page with a wider left margin ... easy to set up, but it does not actually work for any printer I am connected to.
    Info so far:
    Found an older post from 2002 ... "Make a custom page"
    Mac Help has a limited, simple, incomplete answer: "Make a custom page"
    Tried three printers. One Postscript Level 3 One Level 2 and one non postscript
    Switching between page types in the drop down shows a change in the print preview, and the floating information shows the correct page size and larger left margin... but the "Custom Page Size" does not show a larger left margin, in the preview, no mater how it is set.
    There also appear to be a relation ship between the radio Buttons for scale and the margin settings.
    Test prints have simply cut off the left side of the document, and scaled the document from the right side in and the top down.
    Printing a PDF from Preview
    MacBook Pro
    OSX 10.5.6
    Thanks
    Peter

    Thanks ... tried the Paper Handling, but no lock.
    Based on the fact that any scaling, "moves" the image down and to the left on the paper ...
    Th only "work around" solution is to ...
    Rotate the PDF page 180, then scale slightly (90% or so ...)
    This pushes the upside down page, down and to the left.
    While this is the opposite of what is desired, the print is then correct when
    it is punched and placed into a three ring binder.
    Assumption is the application that creates the documnt, needs to have the paper margins set. The reality is, an application like Preview, that does not "create anything", needs to handle existing documents PDF, JPEG and print to Custom Page configurations.
    ie: In Preview, Custom Page does not work correctly,
    Thanks allfor the comments and help ...

  • How can I print with the black and white cartridge only?

    I am trying to print using the black and white cartridge only because magenta is out of ink but I'm getting the following error message in HP Photosmart C7200 series print dialog:
    The printer is out of ink.
    The following ink cartridges are empty: Magenta. Replace these ink cartridges to resume printing.
    How can I print with the black and white cartridge only?
    Mac OSX 10.7.3
    HP Photosmart C7280 (7200 series)
    This question was solved.
    View Solution.

    I am absolutely disgusted by this; clearly a scam from HP to make more money by selling extra ink cartridges!!  I will make sure to never buy any products from the shoddy rip off merchants at HP ever again!!
    You should be ashamed!!

  • Trying to print 4x6 photos.  How can I print with no borders on LR5 with my HP OfficeJet 7410?  Even when in Print mode in LR5, my photos show a border.  Page Setup shows "borderless".  Image Settings show "zoom to fill". But cannot print, nor even previe

    Trying to print 4x6 photos.  How can I print with no borders on LR5 with my HP OfficeJet 7410?  Even when in Print mode in LR5, my photos show a border.  Page Setup shows "borderless".  Image Settings show "zoom to fill". But cannot print, nor even preview, without borders.

    JimHess~  Many thanks.  In my short history with LR, it's amazing how many people I've seen ask this question.  I'm nearly embarrassed at how simple the fix was, but grateful that you didn't dismiss such a basic question.  You made my week.  And my friend's photo album...

  • Hi, how can i have a live chat with one of the people from apple so i they can help me with my problem?

    hi, how can i have a live chat with one of the people from apple so i they can help me with my problem?

    https://getsupport.apple.com/Issues.action

  • Passing objects into a class constructor

    I've created a frame for inputting a patient's medical results. There are lots of buttons for temperature, blood pressure, etc. I've created a separate, inner class that creates a NumberPad frame to enter the patient's results. Press the "Temp." button, for example, a NumberPad appears, you enter the temperature, press the "Enter" button on the NumberPad and the number appears in a Label next to the "Temp." button.
    The problem is that I've written the constructor of the NumberPad with a label parameter so that the right label gets updated. e.g.
    class NumberPad extends Frame implements ActionListener
    public NumberPad(Label aLabel)
    However, because I've implemented ActionListener, I've had to override the actionPerformed method and I don't know how to pass the aLabel object that I give to the NumberPad constructor into the actionPerformed method so that, for example
    public actionPerformed(ActionEvent evt)
    String s = evt.getActionCommand
    if (s.equals("ENTER")
    aLabel.setText(display of numberpad);
    How do I transfer the aLabel object into the actionPerformed method so that the correct label gets updated?

    Store the label as an instance variable.
    class NumberPad extends Frame implements ActionListener {
        private Label aLabel;
        public NumberPad(Label aLabel) {
            this.aLabel = aLabel;
        public actionPerformed(ActionEvent evt) {
            String s = evt.getActionCommand;
            if (s.equals("ENTER") {
                aLabel.setText(display of numberpad);
    }[/code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How could I pass object to the other object

    Hi,
    How could I pass an object to the new initializing object, so that I can reference to the first object later?

    You mean something like
    MyClass1 myclass1 = new MyClass1();
    MyClass2 myclass2 = new MyClass2(myclass1); // <-- myclass1 is being passed to the constructor of myclass2                                                                                                                                                                                                                                                                                                                                                       

  • How to combine FileReferenceList objects into one?

    Hi there,
    I'm successfully uploading multiple files to a server using
    the FileReferenceList object. But if you go to browse() for more
    files to add to the ones you've already selected (perhaps they are
    in another folder), then the original FileReferenceList object is
    emptied and replaced with the new files that are chosen.
    What I want is the ability to create a "master"
    FileReferenceList that can hold the results of multiple browse()
    calls. I've used "concat" to combine arrays before but I can't get
    it to work here. Here's the idea that I'm going for:
    private var myMasterFileList:FileReferenceList;
    private var myFileList:FileReferenceList;
    var myMasterFileList = myMasterFileList.concat(myFileList)
    Then when the user is ready, they can send the
    myMasterFileList:FileReferenceList off to be uploaded in one batch.
    In other words how do I create a running master file list from each
    subsequent file list call.
    Thanks for your advice!

    Well, it appears as I'm reading up on this a bit, that it may
    be that the FileReference or FileReferenceList objects are
    "read-only" therefore cannot be manipulated like a typical array.
    This doesn't make sense to me why this would be the case because in
    a multi-file upload situation, there could very well be a user who
    choose some files from one folder, but needs to upload additional
    files from another folder. The process of initiating another
    browse() method clears out the first list. If you could manipulate
    the file list like a normal array then you could just continue to
    add items to the first file list or a new "master" file list...
    THEN send all those items to upload at once.
    I want this functionality and so I think I'll need to
    creatively create many different instances of a FileReferenceList
    object so a user can gather up a variety of files from different
    locations and send them all at once.
    If anyone has any enlightenment on this I would love to
    discuss it because I'm still new to Flex and may be missing
    something obvious.
    Thanks!

  • How to import BW Objects into Prodcution faster?

    Hi Gurus,
    i am facing a problem with the objects import into the production.
    The inport is very slow. Importing 4 infoobjects ca take more than 30 minutes. The import in Q was faster.
    Is there any settings i can do to influence the import speed? Or Transaction? The Basis Team can not help.
    Many thanks in advance.
    Gilo

    Hi Gilo,
    You could ask the Basis Team to monitor the Production system during a transport so that they can analyze the issue and detect the possible causes.  They should be involved as much as possible because the solution is up to them.
    I hope you can solve your concern.
    Regards,
    Maximiliano

Maybe you are looking for

  • How to automatically remove the wiki page's images from the Images library , when a wiki page is deleted

    I have noted the following strange behavior inside my Publishing enterprise wiki site collection. Now by default when I create a new wiki page and I add Pictures to it, the pictures will be saved under the "Images" library and will be inside a unique

  • Modifying existing reports

    Suppose, I have two query in my report like : first query - select code,a,b,c,d from abc where some condition second query - select code code1,e,f,g from xyz where some condition Now I change a column in abc table and want to calculate differently. w

  • Win10: 7.5.0.102 crashes after changing language via Alt+Shift+(2\3)

    Windows 10 build 10130 @ English MUI Skype 7.5.0.102 Language changing is set up to use Alt+Shift+(1\2\3) to switch to English\Russian\Ukrainian accordingly. After pressing Alt+Shift+2 or Alt+Shift+3 in any chat Skype stops responding. Bug existed si

  • X fi2 does not show playlists

    Hi all, The title is pretty self explanatory. I've got this player for my birthday a few days ago and now it doesn't work properly. I was using mediamonkey to sync playlists/audio podcasts, which was working fine and they showed up in the player no p

  • Switch to "full screen" mode is not working (only sound)

    Hello, When i watch a video from internat sites and switch to full screen mode - i saw the picture for a moment and than "black screen" - by pressing ESC i returen to the site. Can you help ? Thanks, Itzik I use 3000 N200 Notbook running Vista