Question about jsp tags

Hello to all the programmers ,
I have the code below , i get from servlet the attribute that called carList and then i use the forEach iterator for
view the list of employees.
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head><title>The list of the Employees</title></head>
<body>
  <table>
     <tr>
       <th bgcolor="cccccc">EMP_ID</th>
       <th bgcolor="cccccc">FIRST_NAME</th>
       <th bgcolor="cccccc">LAST_NAME</th>
     </tr>
  <c:forEach items='${empList}' var='emp' >
    <tr>
    <td>${emp.id }</td>
    <td>${emp.first_name}</td>
    <td>${emp.last_name}</td>
    </tr>
  </c:forEach>
  </table>
</body>
</html>The result that i get us :
EMP_ID FIRST_NAME LAST_NAME
${emp.id} ${emp.first_name} ${emp.last_name}
with the suitable headers of course.
Why i get this result and not get as i expected the empBean.
Regards
Ofer

I checked the web.xml and version is 2.4.
I don't thhink that problem related to the web.xml , because i have another example that worked like this one :
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    // DON'T FREAK OUT!!! This scriptlet code will go away once
    // we have a model and controller in place...
    String[  ][  ] empList = {
            {"22254", "Joe", "Pashi"},
            {"15487", "Yos", "Alke"},
            {"8777", "Jhon", "Gatez"}
    pageContext.setAttribute("empList", empList);
%>
<html>
<body>
  <table border="1">
    <tr>
      <th bgcolor="cccccc" align="left">Id</th>
      <th bgcolor="cccccc" align="left">First_Name</th>
      <th bgcolor="cccccc" align="left">Last_Name</th>
    </tr>
    <c:forEach items='${empList}' var='emp'>
      <tr>
      <td align="left">${emp[0]}</td>
      <td align="left">${emp[1]}</td>
      <td align="left">${emp[2]}</td>
      </tr>
    </c:forEach>
  </table>
</body>
</html>when i run this jsp page in tomcat i get the this result as expected :
Id First_Name Last_Name
22254 Joe Pashi
15487 Yos Alke
8777 Jhon Gatez
I think that maybe i missed something in the previous example , something that related to the iterator forEach.
I try to do the same thing but get the array of the employee from the servlet that's all , i see that the arrayList of the employees is created and i assign as an attribute.

Similar Messages

  • Question about Id3-tags and song managem

    Hello, I am getting ready to buy a Zen Touch 20GB in a couple of weeks and I have a few questions about the management software.
    (Correct me if I am wrong about something)
    ) Are songs organized into groups by Genre instead of just folders like on the Ipod?
    2) Are Id3-tags used instead of filename for identification?
    3) What parts of the tag are needed besides title and artist?
    4) Which version of tags does the Zen Touch recognize: Version or Version 2?
    5) If I edit my tags using an external program such as Id3-TagIT, will the tags carry over to the Creative software and to the player?
    Thanks a lot for your help. I want to make sure I have my music collection in order before I get my Zen Touch.

    euph_jay wrote:Ok, so lets say I have all my music in folders right now seperated into different categories on my hard dri've. Some folders denote the artist, some the album, and some a genre. Example: Folder: Chicago Contents: Chicago .mp3 files Folder: Techno Contents: various Techno artist's songs What is the best way of organizing my folder system, so that the transition will be easy to the player?
    Folders are pretty much irrelevant. What the software will do is look at the *tags* in the files and then use these to build the player's library.
    Will imbedded folders work on the player? (like Techno->Crystal Method->Cystal Method .mp3's)
    Again the player has no concept of folders, although if you set Techno as a Genre tag you will be able to view via this in the Music Library.
    Or, am I misunderstanding how music is stored into the mp3 player. Instead of storing music in a "folder like" system (like the Chicago folder or Techno folder), does it store all the songs individually on the device? Then you have to sort it by artist, album, or genre?
    Using your example, in the Music Library you have essentially three categories: Album, Artist, and Genre. So under Album you would see "Vegas" (the Crystal Method's album), under Artist you would see "The Crystal Method", and under Genre you would see "Techno" (and then either the album or artist under this... I forget which it is offhand).
    Make sense?

  • Questions About JSP?

    hi;
    I am php devloper and I am learning Java now.
    I am using NB6.1 , Tomcat 6.0 , J2ee 5.
    I have some questions about devleoping web application with jsp.
    1.What are
    /WEB-INF/web.xml
    /META-INF/context.xml
    /META-INF/MANIFEST.MF
    files that generated with NB.are important or optional.are auto generated or may I edit.
    2.can I distribute my web application in non text format.How?
    3.if I want to add some files to my application that its running in tomcat.how can i do that with out rebuild all.
    thank you
    Add to mtz1406's Reputation

    thank you all for helping.
    I will write more information about my questions may this help others:
    *{ /WEB-INF/web.xml* - The +Web Application Deployment
    Descriptor+ for your application. This is an XML file describing
    the servlets and other components that make up your application,
    along with any initialization parameters and container-managed
    security constraints that you want the server to enforce for you.
    This file is discussed in more detail in the following subsection.
    As mentioned above, the <code>/WEB-INF/web.xml</code> file contains the
    Web Application Deployment Descriptor for your application. As the filename
    extension implies, this file is an XML document, and defines everything about
    your application that a server needs to know (except the context path,
    which is assigned by the system administrator when the application is
    deployed).
    The complete syntax and semantics for the deployment descriptor is defined
    in Chapter 13 of the Servlet API Specification, version 2.3. Over time, it
    is expected that development tools will be provided that create and edit the
    deployment descriptor for you. In the meantime, to provide a starting point,
    a [basic web.xml file|http://localhost:8080/docs/appdev/web.xml.txt]
    is provided. This file includes comments that describe the purpose of each
    included element.
    NOTE - The Servlet Specification includes a Document
    Type Descriptor (DTD) for the web application deployment descriptor, and
    Tomcat 6 enforces the rules defined here when processing your application's
    <code>/WEB-INF/web.xml</code> file. In particular, you must
    enter your descriptor elements (such as <code><filter></code>,
    <code><servlet></code>, and <code><servlet-mapping></code> in
    the order defined by the DTD (see Section 13.3).
    h4. } from tomcat documentation
    Tomcat Context Descriptor
    bq. A /META-INF/context.xml file can be used to define Tomcat specific \\ configuration options, such as loggers, data sources, session manager \\ configuration and more. This XML file must contain one Context element, which \\ will be considered as if it was the child of the Host element corresponding \\ to the Host to which the The Tomcat configuration documentation contains \\ information on the Context element.
    }from tomcat documentation
    but I still want more information about this question:
    Q3: I want to distribute (sell to another organaization) without give sorce code in jsp files.So I want to precompile it to be just class files or jar files.
    I want to use ant that become with netbeans 6.1.can anyone give me information about how to do that.
    thank you again

  • About jsp tags..............

    Pls help
    I am studing about JSP
    if we write code in scriptlet tag i.e. < % %>
    code goes into service() method of servlet ,which is automatically created by jsp Engine
    if we write code in declaration tag i.e. <%! %>
    code goes outside service() method of servlet ,which is automatically
    created by jsp Engine means at class level.
    is their any tag so that jsp code goes into init() method of servlet ,which is automatically created by jsp Engine for that jsp

    simple and straight u need to code init() method using <%! %> tags.. but in case JSP it has to be jspInit() method.
    The jspInit method is called by the container once and only once for a servlet instance. As you might guess from its name it is used to do initial once only setup such as getting resources and initialising variables that are used in the JSP page. The jspInit method can be overridden within a JSP page with code like the following.
    <%!
    public void jspInit(){
    /*getServletConfig is inherited */
    ServletConfig config= getServletConfig();
    %>REF : http://www.examulator.com/moodle/mod/resource/view.php?id=380
    REGARDS,
    RaHuL

  • Noob question about DIV tags

    Learning DW and CSS so patience is in order .
    I've being reading numerous posts here and on the web about avoiding tables for laying out web pages. I can see the advantages in terms of cleaner codes and easiness of updating and changing sites at a later time. So I started learning about DIV tags (although tables is very easy for me) and have practice a few times with fairly good results, love the absolute positioning with it. Having said that, for the love of me, can't find a way of centering horizontally a page designed with DIV tags (due to ignorance), for example, 1 column/three rows page, after defining styles, size and colors I enclosed everything in another DIV tag, wrapper I think is called, but have not found a way of centering it on the page, text-aligment on the DIV tag only centers the text not the DIV itself, how to go about this? Help is appreciated.

    love the absolute positioning with it.
    Get over it.  It's a trojan horse.  Absolute positioning is not a general layout method.
    To center ANY block (non-absolutely positioned) element, use CSS to give it a width and left/right margins of 'auto'.  For example -
    <div id="foo">...</div>
    That div will be centered with this CSS -
    #foo { width:300px; margin:0 auto; }
    I think you are on the wrong path already, though.  Stick with tables (which you say are very easy for you) UNTIL you a) understand CSS well enough to understand what absolute positioning is and why I say it's bad, and b) understand how to use float, margin, and padding to place things on the page.  Then you are ready to move away from tables.

  • Simple question about custom tags really easy!!

    I am trying to make my own custom tags, so far i have created simple one that have i use for heading or to set the page layout for a jsp page, My question is I want to make a custom tag with a body , with a start and end tag can anybody give a simple example of a custom tag which has a body.
    I do not mean write me a tag i mean what could a tag with a body be used for? Can you give me some example of what a tag of this kind could do?

    Thanks having read that and some other pages i have another question:
    would it be possible to put the following code into a custom tag so that i can pass in a list and have it output it to a table?
    <TABLE >
    <% 
    out.println("<TABLE >\n" +
                    "<TR BGCOLOR=\"#FFDDAA\">\n" +
                    "  <TH>ID Number\n" +
                    "  <TH>Artist\n"
    Iterator it = pricePassed.getpricePassed().iterator();
    while( it.hasNext() ){
       MySite.VideoBean vids = (MySite.VideoBean) it.next();
       out.println( "<TR>\n" +
                   "<TD><Center><B>" + vids.getRecId() + "</TD>" +
                    "<TD><Center><B>" + vids.getArtist() + "</TD>"
    </TD></TR>\n" );
    %></TABLE>At the moment i use the above in a jsp to put data into a table, would it be a massive task to undertake to put into a custom tag?

  • Question about id3 tags

    i had all of the fields of all my songs just how i liked them. i thought itunes had written everything i had edited into the id3 tags of all the songs. apparently, it didn't work.
    i am using another software called serato. i took the mp3's whose tags i edited in itunes and imported them into serato. i know this program is able to read all versions of tags, so i found a suggestion someone made to strip the id3 tags. this process called for selecting all the songs, converting the id3 tags to "none", then changing them back to a certain version (v2.3 or v2.4).
    after doing this, i take a look at my itunes library and about 80% of all my songs have their tags messed up. either the genre is back to what it was before i changed it a while ago, or (more annoyingly) the song titles are all truncated to a certain length.
    1. is there any way to undo this? or am i going to have to manually go back and re-edit all the fields?
    2. is there a better way of ensuring itunes is correctly changing the id3 tag fields? for example. if i edit the id3 tags on itunes on one profile on my mac, then take the same mp3 file and import it into itunes on another profile, the id3 tags seem to not have been changed at all.
    help anyone? this whole thing has got me really frustrated. thanks in advance.

    In Serato setup, check box Read iTunes Library. However this doesn't solve the problem, only creates yet another location for cleaning up....
    Having somewhat same issue: Converted all id3 from iTunes succesfully, but couldn't import files correct on other macbook in iTunes (same version)?!?!? Doesn't read id3...

  • Question about Hidden Tags

    I have two forms Page1.jsp and Page2.jsp
    when i invoke page1.jsp i pass a customer id to it ... the actionclass gets it and displays Page 1.jsp
    now when i click on Page 1.jsp i need to pass the same id to Page 2.jsp's Action class
    How do i do it
    Is it possible using <html:hidden> tag
    Thanks
    ~K

    that's certainly 1 way to do it, sure.

  • Question about custom tags

    Hi All,
    Please tell me what is differnce between javabean and custom tags.
    thank you.

    Javabean is a data object (or a data holder) whose properties can be accessed using getters, setters - ex getName() and setName()
    JSP custom tags are merely Java classes that implement special interfaces (Tag interface). Once they are developed and deployed, their actions can be called from your HTML using XML syntax. Refer the article http://java.sun.com/developer/technicalArticles/xml/WebAppDev3/
    Cheers,
    Janesh

  • Question about JSP, XSLT and JDOM

    hi, folks. Let's say within page1.jsp, i have <jsp:include page="page2.jsp" flush="true"> On the other hand, i have a servlet helper class which queries the database, then converts the ResultSet object into a JDOM Document object. My question is i want to make the transformed output of the JDOM Document and XSLT template to be a partial content of the page2.jsp page. How can i get this done properly? I have no problem of doing the transformation, but just dont know how to concatenate the output with the rest content of page2.jsp. Hope i clearly explained the question. Any advice is greatly appreciated.
    //code fragment on page2.jsp
    <td valign="top" width="788">
        <font size="3"><br>  
            <p>
           //i want put the transformed results here
           </p>
         </font>
    </td>

    this is a fragment of my testing program, which transform direct to response output stream. but i dont want put this bounch of java code within page2.jsp. do i some other way around to get it done?
    Document myDocument = createDocument();
                   TransformerFactory tFactory = TransformerFactory.newInstance();
                // Make the input sources for the XML and XSLT documents
                org.jdom.output.DOMOutputter outputter = new org.jdom.output.DOMOutputter();
                org.w3c.dom.Document domDocument = outputter.output(myDocument);
                javax.xml.transform.Source xmlSource = new javax.xml.transform.dom.DOMSource(domDocument);
                StreamSource xsltSource = new StreamSource(new FileInputStream("d:/tomcat/webapps/project/car.xsl"));
            //Make the output result for the finished document
                StreamResult xmlResult = new StreamResult(response.getOutputStream());
                //StreamResult xmlResult = new StreamResult(System.out);
            //Get a XSLT transformer
            Transformer transformer = tFactory.newTransformer(xsltSource);
            //do the transform
                transformer.transform(xmlSource, xmlResult);

  • A question about keyword tags

    Is it possible in settings... or somewhere, to set it so that when you open (PrE9's) organizer instead of starting with keyword hierarchy list - it could open on keyword cloud view? I am not so keen on the hierrarchy method...
    Thanks.
    brush

    I did some experimenting in the Elements 9 Organizer.
    1-- yes, when you close the Organizer then it does always seem to come up next time with the Thumbnail grid AND the Tags panel on the right is set to Hierarchy view. Then you must click on the icon for Cloud view.
    2-- my conclusion is that if I click on the Cloud icon after starting the Organizer, then it was staying as Cloud in the Keyword Tags panel to the right of the Thumbnails for the duration that the Organizer is open.
    3-- Note that if you use Full Screen for viewing your photos, then for the "Quick Organize" panel that drags out from the left side of the screen near the bottom, the default for Keyword Tags is Cloud. This is a different method of working which you may or may not like: however since it does set Cloud I decided to mention it.
    FYI - to get to Full Screen you can use the pull down menu for the Display icon (that is next to the House icon on the top bar of the main Organizer screen). Choose the option "View, Edit, Organize in Full Screen".  FYI - I usually select the thumbnails of the photos which I want to Organize before I go in to Full Screen.

  • Quick question about div tags

    How do you make a div tag only as wide as the content that is
    inside of it, rather than the width of the cell that surrounds
    it?

    <div style="width:200px; float:left">
    Would give you a div 200px wide and floated to the left. You
    can similarly
    float another div to the right of this div etc. When you are
    done with a row
    of divs, you would want to clear the float so that the next
    set of divs
    starts with the extreme left as the reference point. To clear
    a float you
    would use style="clear:both;" or style="clear:left;" etc.
    Please do some
    reading on all this before you start experimenting else
    you'll run into a
    multitude of issues.
    You cannot lose until you give up !!!
    "AngryCloud" <[email protected]> wrote in
    message
    news:f133f2$jk4$[email protected]..
    > How do you make a div tag only as wide as the content
    that is inside of
    > it, rather than the width of the cell that surrounds it?

  • Question about adding tags to images and music

    Hi I have an artist page online and I have read that adding meta tags to your page does absolutely nothing to help search engines these days and then someone recommended adding tags to the images on my site using aperture (which I cant afford) so can anyone explain if I can do this in iphoto or photoshop? and also can I add tags to the mp3's available on my site to better perform in search engine searches? can i do this with itunes?
    Thanks in advance

    The search engines have to be lead to your music/photo page using an appropriate URL and having a text description with as many relevant "key" words as possible.
    Also, you need as many links to this page as possible from other sites as well as your own pages.
    When I enter one of my own song titles and name into Google, all the top listed links are sites that sell digital downloads and CDs. Have a look at the way these sites list your music to see the most effective way of doing it on your own website.
    Obviously, you first have to add your URL to Google, Yahoo etc and get them to verify your sitemap.

  • Very basic questions about JSP server and plug-in.

    Hi all,
    I am wondering what are other ways to make use of the JSP script on a server running normal Apache without changing it to Tomcat. Is there a plug-in version of JSP for Apache that will enable JSP? I am looking for something like PHP plug-in, which is quite generic. They even have a php.exe that OHTTP (a great shareware Win32 web server) can call to run PHP. Is there such thing along this line with JSP on Win32 or Linux? Thanks!

    You need a jsp/servlet engine, and in effect, Tomcat is the "plug-in" you described. Tomcat has basic web server functionality built in, so it can run stand-alone, but it's most commonly used with a robust web server like Apache. You don't have to "change it" to Tomcat - you just configure Apache to forward specific urls (anything ending in *.jsp, for example) to Tomcat.

  • Question about cutom tag jars on Tomcat

    I have written a custom tag for data connection in Java and wrote a TLD to use it. My problem is a I have three applications that all use it, so I put the jar file in my CATALINA_HOME/common/lib and the tld finds the jar but the jar has a properties file it uses to get the DB name and user names. The jar can not find the properties file, I tried putting it in the common/lib/, I put it in the common/ and I also tried in the APP_DIR/WEB-INF/ and it still can not find them. Is there a place I can put the properties file that tomcat will have it available for the jar file.
    Thanks in advance

    Put the properties file inside the jar file. Then you can load it from your code using the classloader. Lets say you put the properties file in a subdirectory "props" inside the jar, you can then load it using this code:
    InputStream is = this.getClass().getClassLoader().getResourceAsStream("props/db.properties");
    Properties props = new Properties();
    props.load(is);
    is.close();Assuming you name your file "db.properties" of course.

Maybe you are looking for

  • K9N Platinum and OCZ2P8001GK

    Hi. I bought 2 OCZ PC2-6400 512MB DIMM (OCZ2P8001GK) and I am thinking of buying the MSI K9N Platinum (non-SLI) board to run with AMD Athlon X2 3800+. Will it be any compatibility problems running the system with those memory modules? [Running at sto

  • A^b = n ,How to get the value for a ?

    a^b = n ===> n = Math.pow(a,b) How to get the value for a ? dose Java have API to get the value for a ? Thanks for help~~~

  • Installing Windows 7 in Boot Camp with iso

    I have downloaded an .iso file with Windows 7 on but I can't install it in Boot Camp. I've tried several things with no luck. 1. For the first, when I start up Boot Camp assistant I can't choose to "Create a Windows 7 install disk". I only have the t

  • PL/SQL from Application Module instead of Using VO/EO - Violating Standard?

    Hi, I have seen product code which Use PL/SQL APIs for committing data (Creation of Records in Table) from Application Module. There is no BC4J (VO/EO) used in this data route. Is there any coding standard (document) which says such cases are against

  • Wireless and/or Ethernet

    I have a MacBook Pro wirelessly connected to a Time Capsule. If during a file transfer, for example during a Time Machine backup, I make an Ethernet connection between them, will the transfer continue only over wireless or will it go over Ethernet? A