Jstl if doubt?

I have a variable which comes from my properties file
<fmt:message var="maxNumber" key="maxNumber"/>And I have another variable${k}I am trying to comapre tehse two variables as below;
<c:if test="${k <'maxNumber' }">
Hello WOrld
</c:if>But there seems to be a problem in the if statement. can anyone see the problem. Thanks

<c:if test="${k <'maxNumber' }">Here, you're trying to compare k with "maxNumber", a string literal so it obviously fails. You should remove the single quotes around 'maxNumber'
P.S. I know very little of EL and JSTL as of right now so I may be wrong.

Similar Messages

  • Doubt on JSTL?

    Please anyone giveme the sample code for how to use JSTL to connect database and fetch the data?
    Thanx.

    in JSTL pratical guide for JSP programmers by Sue Spielman
    <sql:setDataSource var="datasource"
    driver="org.gjt.mm.mysql.driver"
    url="jdbc:mysql://localhost/db"
    user="guest"
    password="guest" />
    <sql:query datasource="${datasource}...
    <html>
    <head>
    <title>
    Display Results
    </title>
    </head>
    <body>
    <c:catch var="sqlError">
    <sql:query var="bookList" dataSource="${datasource}">
         SELECT * FROM books WHERE title LIKE 'J%' ORDER BY author
    </sql:query>
    </c:catch>
    <c:if test="${not empty sqlError}" >
    Make sure you have already run the databaseinit.jsp file
    </c:if>
    <h2>Listing all books that start with a 'J', ordered by author</h2>
    <br>
    <table>
    <th>Title</th>
    <th>Author</th>
    <c:forEach var="book" items="${bookList.rows}">
         <tr>
              <td><c:out value="${book.title}" /></td>
              <td><c:out value="${book.author}" /></td>
         </tr>
    </c:forEach>
    </table>
    </table>
    <h2>Show using choose/when/otherwise conditional to display results</h2>
    <table>
    <tr><th>Title</th></tr>
    <c:forEach var="book" varStatus="current" items="${bookList.rows}">
    <tr>
    <c:choose>
         <c:when test="${current.first}" >
              <td><font color="#0000FF"><c:out value="${book.title}"/></font></td>
         </c:when>
         <c:when test="${current.count % 2 == 1 }" >
              <td><font color="#FF0000"><c:out value="${book.title}"/></font></td>
         </c:when>
         <c:otherwise>
              <td><c:out value="${book.title}"/></td>
         </c:otherwise>
    </c:choose>
    </tr>
    </c:forEach>
    </table>
    </body>
    </html>

  • JSTL doubt

    I have a table with columns "name , href , class". Is this right to use them in the jsp file?
    <c:forEach var="row" items="${users.rows}">     
    <td width="36"><a href="${row.href" class="${row.class"><c:out value="${row.name}"/></a></td>
    </c:forEach>
    in this <c:out value="${row.name}"/> which is outside the <td> tag works fine. inside tag how to access the value? anything wrong in my code?

    your syntax seems to be right....may be try this: square brackets...
    <a href="${row['href'" class="${row['class']">

  • Usage of JSTL

    Hi all,
    I am using JSTL SQL tags for populating some form elements in my JSP. It is noted that it should not be used SQL tags for performance or some thing else. I found that its very easy way to populating the elements. My doubt is why dont I have to use SQL tags. Please anybody clearify my doubt.
    thanks in advance
    Prasad

    Using the SQL tags is not a good idea for several reasons.
    Number one among them in my book is the fact that you are linking your display (JSP) with how your data is stored. If you change databases - you have to change the JSP. If you change table formats - you have to change your JSP. If you change to storage in XML files, or some other storage system - you have to change your JSP.
    But, if you move your data access into a Java Bean, and that Java Bean handles the SQL then, when you change how the data is stored, the bean may change but the JSP remains the same, no edits.
    Additional benefits of moving SQL out of the JSP and into JavaBeans include the ability to test your data access system on a normal java system - no JSP server required, which makes development, testing, and re-structuring quicker.
    Another one is that the SQL tags can complicate the JSP and make it much more complex than it needs to be when using other JSTL, EL, and Java Beans.

  • Newbie question: JSP x JSTL (Will JSTL kill JSP?)

    Hi,
    I'm newbie in java development and know I'm learning about jsp and jstl.
    I'm reading some articles about jstl, but my doubt remains...
    Was jstl create to kill jsp in apresentation layer?
    Please, if possible, show me an example that I really need use jsp instead of jstl?
    What kind of things can't I do with jstl?
    Thanks a lot

    Ranieri wrote:
    I'm sorry, my question wasn't very clear.
    When I said JSP, I wanted say Scriptlet...
    My central point is that Scriptlet is very confortable for me at the moment...
    So, I don't see a motive to change:
    <% if (1 == 2) }....
    to
    <c:if test="1 eq 2">...Lots of motive to change.
    Now... you can say that jstl is more easy, Or you can say that JSTL is easier.
    but if a big number of people start to use it, it will increase and will turn another programming language...It sounds like you think this is a new thing. JSTL has been around for a very long time. 2001 vintage. It's already here, dude.
    Besides, it's not a programming language per se. There will be other tag libraries, but those are custom. JSTL as written hasn't changed in years. The standard won't expand.
    So, why create another programming language if we have Scriptlet to do the same?Like I said before, scriptlets were the mistake. They're unreadable, ugly, and encourage putting logic in JSPs. Very bad, indeed.
    %

  • JSP / HTML doubt ...

    Hi every one!
    My doubt may seem to be a waste doubt, but its a doubt,so..,
    Can we use JSP tags(like <%,<%=) in a servlet program.
    And can we use a JSP tag in between or inside a html tag as.,
    <a href=my.html name=<%=val%> >Hi</a> ,,where val is a string object holding some string say Hi.Can we use like this?
    Plz guide me! Thnkz in advance...

    Yes, like Yogesh mentioned it is possible to include a JSP expression
    <%=someVariable%> inside the value attribute of an HTML tag.
    However, there is a new and improved way of doing this. In case you are using the latest versions of everything - JSP 2.0 , Servlet 2.4 etc
    instead of using a JSP expression like this <%=someVariable%> , now you can do it in a much simpler syntax with EL like this ${someVariable}If you install JSTL 1.1 and configure it , there are much simpler and better ways to do things with JSPs now.
    For example this JSP scriptlet :
    <%
    for (int i=0; i < 10; i++){
        out.println(i);
    %>could be written in JSTL inside a JSP as
    <c:forEach begin="1" end="10" var="index" step="1">
        ${index} <br/>
    </c:forEach>The above is just a small example and doesn't show all the benefits of JSTL, but when the application grows large if one uses just JSP scriptlets and expressions the code becomes unmanageable.
    With JSTL the code looks much cleaner , simpler as it encapsulates all business logic to the business layer.
    If you are new to JSPs then you can get familiar with scriptlets and expressions, but I encourage you to make use of the benefits of JSTL after you become familiar with the basics of JSPs.
    Message was edited by:
    appy77

  • Where to download JSTL library exactly?

    I am really confused. JSTL 1.0/1.1 can be downloaded from Apache website, while JSTL 1.2 is only downloadable from jstl.java.net???

    gimbal2 wrote:
    JSTL is an API. What you can download from the Apache website is an implementation of that API. Apparently they don't offer JSTL 1.2 as a separate download, but it is part of Apache Tomcat 7 for example. Much like the page you link to is the implementation that is delivered as part of Glassfish.I still doubt about Tomcat 7 has JSTL jar files, as I am looking at the server lib folder, there is no jstl-xxx.jar files, but it has el-xxx.jar files. In addition, when I create a new project in Eclipse for serlvet 3.0 with Tomcat 7 as server runtime, I still have to import jstl-xxx.jar files from outside. What could be missing?
    This is no different from for example the servlet-api and the jsp-api. You don't download implementations for those APIs either, they are part of the servlet container / application server.That's true. I known it already.

  • JSTL tags where executing?

    Hello,
    I just started using JSTL tags and I would like to know where they are executed, is it at the browser of the user or at the server? The reason I am asking is that I need to know, if the user do not have Java platform install, he will still have the fuctionality of JSTL tags?
    I cannot find this information in any documentation so any help would be great.

    good issue.
    i also have some doubt about JSTL.
    when use write
    <form:form name="myForm" command name="Email">
    <table>
       <tr>
            <td>
                     <c:out value="${Email.fromId}"/>
            </td>
       </tr>
    </table>
    </form:form>see if fromId is private member of Email class then also we able use it in the JSP page. according to Java concept we can use private variable with the class scope only.
    so how come we are able to use that one in JSP page.
    Thanks,
    -Ravi.

  • If statement in jstl

    I am new to jstl and I wrote the code for editing the information and i want the visible checkbox is checked if in the database it is visible or not checked in the checkbox if it is invisible but not working help me guys
    <div>
    <span class="label">Visible:</span>
    <input type="checkbox" name="visible"
    <c:if test="${ad.visible}">value="checked" </c:if>>
    </div>

    http://www.w3schools.com/tags/tag_input.asp
      <input type="checkbox" name="visible"
        <c:if test="${ad.visible}">checked="checked" </c:if>>

  • Doubt in fbl1n transaction

    hi i have a doubt....
    in fbl1n transaction, there are open items and cleared items.
    in it the cleared items  for certain document types such as invoice etc is not present in the open item table (bsik)
    however the cleared items for document types such as general  voucher its present in the open items table (bsik)
    is this possible as all cleared item entries shld b present in the open item table with an indicator set for cleared or not...
    plz exlain!

    Hi
    There are 2 tables(open and Closed Items)  in FI for Account Payables and Account Receivables and GL accounts
    1.Account payables: BSIK is Open Items and BSAK is Closed items
    2.Account Receivables; BSID and BSAD for OPEN and closed items
    3/GL accounts :  BSIS and BSAS  for Open and Closed Items
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Doubt in creation of a new object

    Hi All,
                 I have one doubt in creation of a new object.If a new object is to be created and it is not a subtype
    of any existing object, then what should we enter in the Program field for creating the object?
    I hope I am clear with my question.
    Thanks in Advance,
    Saket.

    Hi Saket,
    Following will be required for created a custom business object.
    1. Object Type - ZTEST (Internal Techincal Key)
    2. Object Name - ZTESTNAME (Technical Key Name)
    3. Name - TEST (Name of BO, it is used while selecting the object type)
    4. Description - (Short Description of BO)
    5. Program - ZTESTPROGRAM (ABAP program in which the methods of the object type are implemented)
    6. Application - A or B.. etc (Area to which your BO is related)
    Please remember that you can learn these basic things by giving F1 help on those fields and in HELP.SAP.COM.
    Regards,
    Gautham Paspala

  • Doubt in sender mail adapter

    Hi Everyone,
    Can we read and validate the attachment of the mail.If so how to do it.
    Thanks in advance,
    Sakthi

    Hi Sakthi,
       Please refere the below links:
      http://help.sap.com/saphelp_nw2004s/helpdata/en/ad/bf93409c663228e10000000a1550b0/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/0d/52b240ac052817e10000000a1550b0/frameset.htm
    Let me know if you have any doubts regarding this.
    Thanks,
    sekhar.

  • Hw can i get arabic support in oracleAS using jstl: showing '?????' symbols

    Hello All,
    I am using OracleAS for portal deployment and portlets UI constructed by using jstl.
    i have used spring portlet jstl for the jsp pages.
    when i am trying to change the language, it is showing '?????' symbols.
    I have used correct unicode. i tested in pluto portal server. when i deployed in oracleAS,
    for english not a problem. for arabic it is showing as '????'.
    i have used this code to get arabic in pluto. same code i used. i am getting error.
    <c:set target="${pageContext.response}" property="characterEncoding" value="UTF-8" />
    <fmt:setLocale value="ar" />
    <fmt:requestEncoding value="UTF-8" />
    i know it is not setting charector encoding.
    i tried some other too like:
    <head>
    <META http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    </head>
    and
    <%@ page pageEncoding="UTF-8" %>
    No improvement. please help me out of this.
    how can i get arabic support in oracle AS by using jstl?
    Thanks,
    Arun

    Only Apple Account Security could help at this point. You can try calling Apple Support in Canada - you'll have to find one of the several ways, such as Skype, to call an 800 number from outside of the relevant country - and ask for Account Security and see if they can help. Or you can find a friend who speaks Chinese and ask them to help you talk to Apple Support in China. There are really no other options that I know of.
    Note, by the way, that these are user-to-user support forums. You aren't speaking with Apple when you post here.
    Regards.

  • PI' RFC  Connection pool  doubt.

    Hi PI exports:
    i have a doubt about  pi' RFC  Connection pool ,pi RFC receive channel can set the conn pool size ,but when start the rfc receiver channel ,is there always only one Connection  pool ,or there is only one Connection  pool  instance?
      thinks
    Edited by: kevin liang on Oct 19, 2009 6:45 AM

    Hi,
      Connection poolins size means how many number of connection you want to make open to send data to ECC, We can define maximum number of connection in Receiver RFC Adapter,Go to additional parameters section and define Max Number of connection give the number there,thats it.Internally it works as Connection poolin mechanism.
    Regards,
    Raj

  • Small Doubt Regarding SY-MANDT

    Hi All,
         SELECT changenr FROM cdhdr CLIENT SPECIFIED INTO CORRESPONDING FIELDS OF TABLE it_cdhdr
                                             WHERE mandant = syst-mandt
                                             AND   objectclas = 'MATERIAL'
                                             AND   objectid   = wa_matl-matnr
                                             AND   tcode      = 'MM02'.
         I have written the select stament as shown above.
         In this i have a doubt like adding a field sy-mandt  in the where condition will increase the Efficiency of program or not.
    regards,
    raghu.

    Hi..
    No doubt the efficency would be affected but from business point of view there will many  things that need to be checked as in:
    If you are viewing data from CDHDR and CDPOS which is client specific then you are not viewing complete data.
    These tables give us and document changes made to a particular object in SAP but if anything is cross client like company code(lets assume) then changes to it wont be visible in all the clients..
    so there can be some key information you can miss out while working on some of the objects.
    else in this case its good to make query cross client.
    regards
    vishal

Maybe you are looking for

  • Win 8.1, Retina MBP, external display, stupid scaling

    I've got a Retina MacBook Pro (Late 2013) with a 2880x1800 display, also connected to an external 1920x1080 display, dual-booted into Windows 8.1 with the latest Boot Camp drivers and the most recent nVidia drivers. In Windows, when I go into the Dis

  • I have purchased the Adobe Creative Suite 6 Design & Web Premium but will not allow me to register?

    I have purchased the Adobe Creative Suite 6 Design & web Premium & it will not allow me to register the software --- I'm having to use the trial version --- will you please help me in updating --- the products that I have paid lots of money for? And

  • Can I update my macbook pro late 2011 to use bluetooth 4.0

    I got  a late 2011 Mac book pro currently running on Mac OS 10.9.5. I wish to update to Yosmite only if I have continuity and Handoff features are supported. Please do provide me with series of steps to update the Late Mac book pro to support the Han

  • UPDATE field in internal table?

    Hi, I have an internal table with XXXXXXXX records. I have to UPDATE 1 field with the same value. Is there a faster way?     LOOP AT lt_order_adm_h INTO wa_order_adm_h.       wa_order_adm_h-process_type = 'Z002'.       MODIFY lt_order_adm_h FROM wa_o

  • Number formatt for flat file

    hi for 0amount field i am getting data in excel like                 -535.905.031.022.492                -111.801.379.067.257                433.124.355.469.709 -0.405316272683086 -0.378415176841429 -0.404278225058806 this allignmnet will be fine or