Jstl: ExpressionEvaluator.evaluate  versus  Expression.evaluate

Hi,
Reading the jstl API, I noticed the method ExpressionEvaluator.evaluate().
On the other hand, ExpressionEvaluator also returns an Expression, which has its own evaluation method: Expression.evaluate().
Isn't this redundant ? Which method would be used on which occasion ?
Also, I was wondering: do I understand correctly, that one could override the ExpressionEvaluator ? So if I write my own evaluator, I could make it so that "${2+2}" evaluates to, say, "5" ?
Thanks very much.

Hi,
Reading the jstl API, I noticed the method ExpressionEvaluator.evaluate().
On the other hand, ExpressionEvaluator also returns an Expression, which has its own evaluation method: Expression.evaluate().
Isn't this redundant ? Which method would be used on which occasion ?
Also, I was wondering: do I understand correctly, that one could override the ExpressionEvaluator ? So if I write my own evaluator, I could make it so that "${2+2}" evaluates to, say, "5" ?
Thanks very much.

Similar Messages

  • Extreme versus Express for computer connection and network extension

    I somehow posted this message in the Windows section, so let me try again:
    I have an older Mac Pro that I have moved to a location that does not have a convenient wired connection to our home network. We do have one Airport Extreme box on the system, so I was thinking that I could kill two birds with one stone and purchase a second box to not only give the Mac Pro a wireless connection, but also to extend the network.
    Will either the Airport Extreme or the Airport Express work equally well for this purpose? Does the Extreme offer some advantage in this situation?

    Yes either the AirPort Extreme base station (AEBS) or AirPort Express (AX) will do the job. In this situation neither offers an advantage.

  • Parsing EL expression in custom tag 10.1.3.4

    Hello all,
    I have a custom tag that extends CoreOutputTextTag. This tag needs to resolve the El expression passed in from the value attribute and perform an operation with it. Since I this tag needs to work with adf 10.1.3.4, the jsp level is 1.2 and does not support container parsing of EL expression directly in the page ($).
    I have tried a couple approaches but both of them result in just the same EL expression I pass in being returned to me. Anyone have an idea of the proper way to resolve an EL expression within a custom tag?
    Thanks in advance,
    - Joe
    public class CoreOutputTextTag extends oracle.adfinternal.view.faces.taglib.core.output.CoreOutputTextTag {
        private String groupId;
        private String groupCode;
        private String value;
        public void setValue(String value) {
            this.value = value;
            super.setValue(value);
        public int doStartTag() throws JspException {
            super.doStartTag();
            UIComponent uiComponent = this.getComponentInstance();
            if (uiComponent instanceof CoreOutputText) {
                CoreOutputText coreOutputTextComponent =
                    (CoreOutputText)uiComponent;
                if (coreOutputTextComponent.getValue() == null) {
                    String codeValue =
                        (String)ExpressionEvaluatorManager.evaluate("value", value,
                                                                    java.lang.String.class,
                                                                    this,
                                                                    pageContext); // the page context
                    try {
                        ExpressionEvaluator expressionEvaluator =
                            pageContext.getExpressionEvaluator();
                        codeValue =
                                (String)expressionEvaluator.evaluate(value, java.lang.String.class,
                                                                     pageContext.getVariableResolver(),
                                                                     null);
                    } catch (ELException elex) {
                    SystemSettingRow row =
                        SystemSettings.getSystemSettings(groupId, groupCode, null,
                                                         value);
                    if (row != null)
                        coreOutputTextComponent.setValue(row.getShortDesc());
            return TagSupport.SKIP_BODY;
        public void setGroupId(String groupId) {
            this.groupId = groupId;
        public String getGroupId() {
            return groupId;
        public void setGroupCode(String groupCode) {
            this.groupCode = groupCode;
        public String getGroupCode() {
            return groupCode;
    <tag>
      <name>coreOutputText</name>
      <tag-class>od.adf.ics.ui.taglib.CoreOutputTextTag</tag-class>
      <body-content>empty</body-content>
      <attribute>
       <name>groupId</name>
       <required>true</required>
      </attribute>
      <attribute>
       <name>groupCode</name>
       <required>true</required>
      </attribute>
      <attribute>
       <name>id</name>
       <rtexprvalue>false</rtexprvalue>
      </attribute>
      <attribute>
       <name>truncateAt</name>
       <rtexprvalue>false</rtexprvalue>
      </attribute>
      <attribute>
       <name>description</name>
       <rtexprvalue>false</rtexprvalue>
      </attribute>
      <attribute>
       <name>escape</name>
       <rtexprvalue>false</rtexprvalue>
      </attribute>
      <attribute>
       <name>shortDesc</name>
       <rtexprvalue>false</rtexprvalue>
      </attribute>
      <attribute>
       <name>partialTriggers</name>
       <rtexprvalue>false</rtexprvalue>
      </attribute>
      <attribute>
       <name>onclick</name>
       <rtexprvalue>false</rtexprvalue>
      </attribute>
      <attribute>
       <name>ondblclick</name>
       <rtexprvalue>false</rtexprvalue>
      </attribute>
      <attribute>
       <name>onmousedown</name>
       <rtexprvalue>false</rtexprvalue>
      </attribute>
      <attribute>
       <name>onmouseup</name>
       <rtexprvalue>false</rtexprvalue>
      </attribute>
      <attribute>
       <name>onmouseover</name>
       <rtexprvalue>false</rtexprvalue>
      </attribute>
      <attribute>
       <name>onmousemove</name>
       <rtexprvalue>false</rtexprvalue>
      </attribute>
      <attribute>
       <name>onmouseout</name>
       <rtexprvalue>false</rtexprvalue>
      </attribute>
      <attribute>
       <name>onkeypress</name>
       <rtexprvalue>false</rtexprvalue>
      </attribute>
      <attribute>
       <name>onkeydown</name>
       <rtexprvalue>false</rtexprvalue>
      </attribute>
      <attribute>
       <name>onkeyup</name>
       <rtexprvalue>false</rtexprvalue>
      </attribute>
      <attribute>
       <name>styleClass</name>
       <rtexprvalue>false</rtexprvalue>
      </attribute>
      <attribute>
       <name>inlineStyle</name>
       <rtexprvalue>false</rtexprvalue>
      </attribute>
      <attribute>
       <name>value</name>
       <rtexprvalue>true</rtexprvalue>
      </attribute>
      <attribute>
       <name>converter</name>
       <rtexprvalue>false</rtexprvalue>
      </attribute>
      <attribute>
       <name>rendered</name>
       <rtexprvalue>false</rtexprvalue>
      </attribute>
      <attribute>
       <name>binding</name>
       <rtexprvalue>false</rtexprvalue>
      </attribute>
      <attribute>
       <name>attributeChangeListener</name>
       <rtexprvalue>false</rtexprvalue>
      </attribute>
    </tag>

    I also would like to know how to accomplish this. I have a similar requirement and need to set the "disable" attribute on a commandbutton and requires an el statement that calls a methodAction defined on the pageDef.
    I followed the great instructions over on this thread:
    ADF FACES:Creating custom component on top of adf
    on how to create custom adf tags for JDeveloper 10.1.3.4.
    many thanks!
    Wes
    Edited by: Wes Fang on Sep 16, 2010 5:39 AM

  • Calling a method with parameters in jstl?

    i need to call a method with a series of String parameters what am i doing wrong?
    the java
        public ArrayList getEmployeeSkills(String ename, String snmae, String yearsexp)the jstl
        <jsp:useBean id="empskill" class="com.Database.EmployeeSkill"/>
        <c:forEach var="emp" items="${empskill.EmployeeSkills(null, null, null)}">
        </c:forEach>

    this works:
         <jsp:useBean id="empskill" class="com.Database.EmployeeSkill" scope="page">
             <jsp:setProperty name="empskill" property="ename" value="Helen Smith"/>
             <jsp:setProperty name="empskill" property="sname" value="Java"/>
         </jsp:useBean>but this part isnt:
         <c:forEach var="empskill" items="${empskill.EmployeeSkillsReport}">
         </c:forEach>ive removed the get part from the method as i have done before from the java class it is calling:
    public ArrayList getEmployeeSkillsReport()
    but it produces:
    org.apache.jasper.JasperException: Exception in JSP: /main.jsp:146
    143:      </jsp:useBean>
    144:      
    145:
    146:      <c:forEach var="empskill" items="${empskill.EmployeeSkillsReport}">
    147:      </c:forEach>
    148:                          
    149:    
    Stacktrace:
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:506)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    javax.servlet.ServletException: An error occurred while evaluating custom action attribute "items" with value "${empskill.EmployeeSkillsReport}": Unable to find a value for "EmployeeSkillsReport" in object of class "com.Database.EmployeeSkill" using operator "." (null)
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:843)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:776)
         org.apache.jsp.main_jsp._jspService(main_jsp.java:244)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    javax.servlet.jsp.JspException: An error occurred while evaluating custom action attribute "items" with value "${empskill.EmployeeSkillsReport}": Unable to find a value for "EmployeeSkillsReport" in object of class "com.Database.EmployeeSkill" using operator "." (null)
         org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:109)
         org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:129)
         org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager.evaluate(ExpressionEvaluatorManager.java:75)
         org.apache.taglibs.standard.tag.el.core.ForEachTag.evaluateExpressions(ForEachTag.java:155)
         org.apache.taglibs.standard.tag.el.core.ForEachTag.doStartTag(ForEachTag.java:66)
         org.apache.jsp.main_jsp._jspx_meth_c_forEach_3(main_jsp.java:590)
         org.apache.jsp.main_jsp._jspService(main_jsp.java:232)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

  • JSTL forEach

    I am trying to iterate over a Vector of objects. The object is a simple bean with getters and setters called headlinesValue.java. Some attributes are headline, deck, and lead. In my JSP page I want to display some of these attributes. I have a Vector called headlinesLists which contains a number of headlinesValue objects. I tried this:
    <c:forEach items="headlinesLists" var="headlinesValue">
    <a class="digest-headline" href="foo.html"><c:out value="${headlinesValue.headline}" /></a>
    <c:out value="${headlinesValue.deck}" />
    <c:out value="${headlinesValue.lead}" />
    IN LOOP
    </c:forEach>
    but I get a JSP exception:
    javax.servlet.jsp.JspException: An error occurred while evaluating custom action attribute "value" with value "${headlinesValue.headline}": Unable to find a value for "headline" in object of class "java.lang.String" using operator "." (null)
         at org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:146)
    please advise.
    Thank you in advance.
    -Ben

    Check the spelling, capitalization, etc...
    Check to see if your vector named headlinesLists is in a scope that is reachable. That is, if you used scriptlets to create the Vector, did you set it to an attribute in pageContext, request, session, or servletContext?
    Where is the Vector created? Did you set the scope wide enough? Do you have two objects with the same name, one empty used after/in a smaller scope then the filled one?
    Did you put any values in the Vector?
    These are the questions I would ask myself to try and troubleshoot. If you are unsure of the answers, then post the code were you make the Vector.

  • Strnage error with JSTL 1.0

    Hi all,
    I've just started exploring the use of JSTL 1.0 tag libraries in my application and everything has been cool so far... up till I encountered this strange error.
    What I did was this:
    1) create 2 ArrayLists in a HTTP Servlet and put them onto the request context as as follows
    ArrayList ListofForumsForWhichUserIsASecretariatContact = forumDAO.selectAllForumsBySecretariatContact(userID);
    ArrayList upcomingMeetings = meetingDAO.selectUpcomingMeetingsByForumID(Integer.parseInt(currentForumID));
                    pageContext.setAttribute("ListofForumsForWhichUserIsASecretariatContact", ListofForumsForWhichUserIsASecretariatContact, PageContext.REQUEST_SCOPE);
                    pageContext.setAttribute("upcomingMeetings", upcomingMeetings, PageContext.REQUEST_SCOPE);As you can see, the ArrayList are actually populated by DAOs
    2) On my JSP page, I tried to iterate through both lists and display their data. The first one came out ok, but the second one gave me this nasty looking error:
    javax.servlet.jsp.JspException: An error occurred while evaluating custom
    action attribute "value" with value "${upcomingMeeting.name}": Unable to find a
    value for "name" in object of class "java.lang.String" using operator "." (null) at org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:109) at
    org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:129) at
    org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager.evaluate(ExpressionEvaluatorManager.java:75) at
    org.apache.taglibs.standard.tag.el.core.ExpressionUtil.evalNotNull
    (ExpressionUtil.java:48) at org.apache.taglibs.standard.tag.el.core.OutTag.evaluateExpressions
    (OutTag.java:99) at org.apache.taglibs.standard.tag.el.core.OutTag.doStartTag
    (OutTag.java:57) at org.apache.jsp.manageMeetings_jsp._jspx_meth_c_out_5(manageMeetings_jsp.java:523) at
    org.apache.jsp.manageMeetings_jsp._jspService
    (manageMeetings_jsp.java:209) at
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92) at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:809) at
    org.apache.jasper.servlet.JspServletWrapper.service
    (JspServletWrapper.java:162) at
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240) at
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187) at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:809) at
    org.apache.catalina.core.ApplicationDispatcher.invoke
    (ApplicationDispatcher.java:627) at
    org.apache.catalina.core.ApplicationDispatcher.doForward
    (ApplicationDispatcher.java:382) at
    org.apache.catalina.core.ApplicationDispatcher.forward
    (ApplicationDispatcher.java:306) at
    myworkplace.meetingManager.controller.MeetingServlet.doGet
    (MeetingServlet.java:141) at javax.servlet.http.HttpServlet.service
    (HttpServlet.java:696) at javax.servlet.http.HttpServlet.service
    (HttpServlet.java:809) at
    org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
    (ApplicationFilterChain.java:200) at
    org.apache.catalina.core.ApplicationFilterChain.doFilter
    (ApplicationFilterChain.java:146) at
    org.apache.catalina.core.StandardWrapperValve.invoke
    (StandardWrapperValve.java:209) at
    ... 3) I've tried to check if the servlet has passed the 2 ArrayLists to the JSP correctly using the following scriplet, with the necessary imports, of course
    <%
    ArrayList upcomingMeetings = (ArrayList) pageContext.getAttribute("upcomingMeetings", PageContext.REQUEST_SCOPE);
    Iterator iter = upcomingMeetings.iterator();
    while (iter.hasNext()) {
        MeetingVO meeting = (MeetingVO) iter.next();
        out.println("ID=" + meeting.getID() + ", name=" + meeting.getName());
    %>This displayed the results I was looking for, i.e. the IDs and Names of the "meetings" in the ArrayList. So it seems that my servlet is passing the object correctly to the JSP, but JSTL doesn't seem to be casting properly here :-(
    I don't understand why one ArrayList would work, while another fails??
    Anyone ever encountered this anomaly before? Appreciate any help, as this is for a urgent project due soon :-(
    Thanks in advance!

    Ah yes, that's it!
    Thanks for the tip!
    Lesson learnt: take a break after every few hours of programming. Otherwise, even the most glaring of all errors laughs at you in the face ;-)

  • JSTL Problem howto

    I am new in jdeveloper and jstl.
    I made jsp page using struts which shows me the table and datas from it.
    Data is presented by
    <c:out value="${Row.something}"></c:out> whic is typical for table presentation. But when i want to compute and show value by using two or more values i get error.
    I tried
    <c:out value="${Row.something-Row.somethingelse}"></c:out>
    but error.
    But
    <c:out value="${Row.something}-{Row.somethingelse}"></c:out>
    shows just expresion whic i don't need. I want value of thees two. How can i get this?

    I tried in 10g using Emp table <c:out value="${Row.Deptno-Row.Empno}"></c:out> and got this error:
    javax.servlet.jsp.JspException: An error occurred while evaluating custom action attribute "value" with value "${Row.Deptno-Row.Empno}": Attempt to coerce a value of type "oracle.jbo.domain.Number" to type "java.lang.Long" (null)
         at org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:146)
         at org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:166)
         at org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager.evaluate(ExpressionEvaluatorManager.java:109)
         at org.apache.taglibs.standard.tag.el.core.ExpressionUtil.evalNotNull(ExpressionUtil.java:85)
         at org.apache.taglibs.standard.tag.el.core.OutTag.evaluateExpressions(OutTag.java:137)
         at org.apache.taglibs.standard.tag.el.core.OutTag.doStartTag(OutTag.java:95)
         at untitled16.jspService(untitled16.jsp:67)
         [untitled16.jsp]
         at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:139)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:348)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
         at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:356)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:614)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:220)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.GetParametersRequestDispatcher.forward(GetParametersRequestDispatcher.java:257)
         at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
         at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1485)
         at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:509)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
         at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:356)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:148)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:148)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:610)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:784)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
         at java.lang.Thread.run(Thread.java:536)

  • How do you parse a varable to a int in JSTL

    the hiddenfield input field is set like:
    int add = 1;
                 session.setAttribute( "ADD", add ); %>
    <input type="text" name="hiddenField" value="<% session.getAttribute( "ADD" ); %>" />i have a JSTL varable:
    <c:set var="rows" value="${param.hiddenField}"/>the error indicates the value isnt a number
    org.apache.jasper.JasperException: An exception occurred processing JSP page /Updates/skills.jsp at line 356
    353:    <input type="hidden" name="empid" value="<c:out value="${empid}"/>">
    354:    
    355:    <c:set var="rows" value="${param.hiddenField}"/>
    356:    <c:forEach var="item" begin="1" end="${rows}">
    357:          <br> </br>
    358:         <table>
    359:              <tr>
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:555)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:414)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    root cause
    javax.servlet.ServletException: javax.servlet.jsp.JspException: An error occurred while evaluating custom action attribute "end" with value "${rows}": An exception occured trying to convert String "NaN" to type "java.lang.Integer" (null)
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:855)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:784)
         org.apache.jsp.Updates.skills_jsp._jspService(skills_jsp.java:554)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:390)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    root cause
    javax.servlet.jsp.JspException: An error occurred while evaluating custom action attribute "end" with value "${rows}": An exception occured trying to convert String "NaN" to type "java.lang.Integer" (null)
         org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:109)
         org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:129)
         org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager.evaluate(ExpressionEvaluatorManager.java:75)
         org.apache.taglibs.standard.tag.el.core.ForEachTag.evaluateExpressions(ForEachTag.java:137)
         org.apache.taglibs.standard.tag.el.core.ForEachTag.doStartTag(ForEachTag.java:66)
         org.apache.jsp.Updates.skills_jsp._jspx_meth_c_005fforEach_005f3(skills_jsp.java:1539)
         org.apache.jsp.Updates.skills_jsp._jspService(skills_jsp.java:527)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:390)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)how can i make it one?

    String sQuantity = request.getParameter("quantity");
    int quantity = Integer.parseInt(sQuantity );

  • Using JSTL to iterate

    hi
    i have a Value Object which consists of a vector as one of its attribute.
    This vector in turns consists of another Value Object called ParamVO.
    This ParamVO consists of ParamName and ParamValue.
    I would like to iterate this vector using JSTL.
    However I am unable to display the values in ParamVO.
    My codes look like this:
    <c:forEach items="<%=myVector%>" var="$ParamVO">
    <tr>
    <td><c:out value="${ParamVO.ParamName}"/></td>
    </tr>
    </c:forEach>
    pls advice. Thanks !

    Hi duffymo
    thanks for your reply. I have tried out your codes, however I get this error instead.
    javax.servlet.jsp.JspException: An error occurred while evaluating custom action attribute "value" with value "${ParamVO.ParamName}": Unable to find a value for "ParamName" in object of class "java.lang.String" using operator "." (null)
         at org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:146)
         at org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:166)
         at org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager.evaluate(ExpressionEvaluatorManager.java:112)
         at org.apache.taglibs.standard.tag.el.core.ExpressionUtil.evalNotNull(ExpressionUtil.java:85)
         at org.apache.taglibs.standard.tag.el.core.OutTag.evaluateExpressions(OutTag.java:137)
         at org.apache.taglibs.standard.tag.el.core.OutTag.doStartTag(OutTag.java:95)
         at jsp_servlet._omp._evs._assigncv.__displaycapacity._jspService(__displaycapacity.java:552)
         at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:431)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at weblogic.servlet.internal.RequestDispatcherImpl$ForwardAction.run(RequestDispatcherImpl.java:342)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:97)
         at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:246)
         at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1058)
         at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:451)
         at org.apache.struts.action.RequestProcessor.processActionForward(RequestProcessor.java:401)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1420)
         at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:502)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6291)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:97)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3575)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2573)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)

  • No EL support in JSTL tags?

    I plan to use both JSTL and JSP 2.0 EL in my JSPs. I tried to use an if-tag, with an expression in the test attribute like this:
    <c:if test="${!empty sessionScope.userdata}"><h2><mywaf:include name="userinfo"/></h2></c:if>
    The JSTL specs show examples like this, i.e. using JSTL and EL together, which is a natural thing as JSTL actually introduced EL. So why does Tomcat give me an error when I access the page:
    org.apache.jasper.JasperException: /jsp/en_EN/template.jsp(14,0) According to TLD or attribute directive in tag file, attribute test does not accept any expressions
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:83)
         org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:402)
         org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:186)
    I looked into the JSTL core tag tld, and indeed, for every single attribute they specify
    <rtexprvalue>false</rtexprvalue>
    indicating that this is a "runtime attribute".
    So what am I doing wrong here?

    Okay, I found it:
    For reasons not totally obvious there are two versions of each JSTL taglib supplied, one "EL", one "RT":
    Excerpt from http://java.sun.com/webservices/docs/1.0/tutorial/doc/JSTL4.html
    Twin Libraries
    The JSTL tag libraries come in two versions which differ only in the way they support the use of runtime expressions for attribute values.
    In the JSTL-RT tag library, expressions are specified in the page's scripting language. This is exactly how things currently work in current tag libraries.
    In the JSTL-EL tag library, expressions are specified in the JSTL expression language. An expression is a String literal in the syntax of the EL.
    When using the EL tag library you cannot pass a scripting language expression for the value of an attribute. This rule makes it possible to validate the syntax of an expression at translation time.
    Well, this confuses me... perhaps I have simply trouble understanding the words....
    RT allows me to use the "page's scripting language" (this has to be JSP EL, since there is no other (server sided) scripting language).
    EL specifies expressions in EL (which, what wonder, is EXACTLY the same as before?!)
    The last part explicitely says, that you cannot pass EL as parameter for JSTL tags using the EL version, but I still do not understand the fundamental difference between EL and RT. Why can't the syntax of an expression be evaluated at translation time when using RT? I mean, in both cases the expression is in the page and won't change anymore.
    <scratches head>
    I'm confused.

  • Jsp 2.0 Expression Language Performance

    Hi,
              We're using EL throughout our application JSPs and Tags (${x} expressions), and we've discovered that for each dynamic expression used, the weblogic implementation creates a new ExpressionEvaluator object, a new Parser object, performs the parsing at runtime and returns the needed value. This leads to an enourmous amount of unneeded objects which multiply our needed heap for a given activity by several times. We did not measure the CPU impact of the runtime parsing, but my guess is that it will be a significant one.
              The weblogic implementation uses javelin.jsp.* classes for the ExpressionEvaluator (it is hard coded in the generated java classes that JspC creates). This implementation does not have any kind of caching for expressions that have already been parsed, and create a new ExpressionEvaluator for each expression even though the requirement is that ExpressionEvaluators need to be thread-safe (as written in the javax.servlet.jsp.el documentation).
              As we see it, this implementation is not suitable for performance oriented servers. Our garbage collection times will not be tolerable with this kind of implementation and the maximum load on the system will be degraded by several hundred percents.
              So I have several questions:
              1. Is it possible to tell the JspC compiler to use a different expression evaluator ?
              2. Do u have support for an EL API that is more suitable for performance oriented behavior ?
              3. Why don't the Jsp compiler use the official JspContext.getExpressionEvaluator() method ?
              4. As I understand, the method in (3) is container oriented - so which kind of expression evaluator does this method return when used in Weblogic ? Is it the javelin implementation ?
              I would really appreciate your help in this matter, as u this is a very urgent one.
              Thanks a lot

    This issue has been addressed by CR261427 by caching the expression parse trees and reusing them when the same expression text appears elsewhere in the code.
    Please contact support to get a patch for this issue.

  • URL rewriting using JSTL

              We are trying to use URL rewriting using JSTL. We have some problems facing URL
              rewriting. The issues we have are
              (1) We use absolute URLs
              (2)Some times we have situations based on certain input field validations
              we use
              javascript to perform URL rewriting based on the input by the user.
              Have anyone done URL rewriting using JSTL (absolute URL versus relative URLS)
              Regds
              Guna
              

    Hi
    Kalpesh Chhatrala,
    If this issue still not resolved, please consider to post in WCF forum.
    Here is the link
    https://social.msdn.microsoft.com/Forums/en-US/home?forum=wcf
    Now i will move your thread to Off-topic forum. If you have any other issues about C#, please feel free to post in this forum. Thanks for your understanding.
    Thanks
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Panel list reordering

    Noticed in CS4 that a minor but handy feature seems to have vanished. In CS3, if you had, for example, a number of colour swatches (or paragraph styles etc) down your palette, you were able to apple-select and drag them to a new position all at once (usually upwards). It now seems you can only do one at a time which might seem trivial but I seem to do this fairly often. Rather tedious and now I often don't bother, which then means scrolling through palette lists each time I need a swatch or para style etc.
    Any thoughts much appreciated - or should I get a life!  :-)

    For me it does not work at all ! I've tried a lot of modifications but
    without any success. The only thing I get is a big stack trace
    (One of the bigger I've ever seen !)
    The top is :
    org.apache.jasper.JasperException: ModelReference expression '{0}' is illegal in this context.
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
    Near the middle there is :
    Caused by: java.lang.ExceptionInInitializerError
    at org.apache.taglibs.standard.jstl_el.jstl.ArraySuffix.evaluate(ArraySuffix.java:361)
    And at the bottom :
    Caused by: java.util.MissingResourceException: Can't find bundle for base name org.apache.taglibs.standard.jstl_el.jstl.Resources, locale en_US
    at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:804)
    at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:773)
    I'm in session scope.
    However the result_set demo works for me. I've tried to
    compare carefully the differences between my own demo and result_set but I didn't find any clue. I've noticed that the panel_data modelReference is the bean id in result_set demo while in the tutorial it is given as a type
    (CustomerBean) I've tried both.

  • Panel_list examples

    Hello,
    Does anyone have a more concrete example of html_basic:panel_list usage? I have looked at the example in the JSF tutorial and it has the following with the panel_list tag:
    <h:panel_data id="tblData" var="customer" modelReference="CustomerBean">
    the CustomerBean reference suggests that this is a single customer. Is it actually a Collection or Iterator or some other type of container? I would like to loop across a container and have tried having the following:
    modelReference="DataBean.dataItems"
    where dataItems is a List but this doesn't seem to work.
    Can anyone help?

    For me it does not work at all ! I've tried a lot of modifications but
    without any success. The only thing I get is a big stack trace
    (One of the bigger I've ever seen !)
    The top is :
    org.apache.jasper.JasperException: ModelReference expression '{0}' is illegal in this context.
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
    Near the middle there is :
    Caused by: java.lang.ExceptionInInitializerError
    at org.apache.taglibs.standard.jstl_el.jstl.ArraySuffix.evaluate(ArraySuffix.java:361)
    And at the bottom :
    Caused by: java.util.MissingResourceException: Can't find bundle for base name org.apache.taglibs.standard.jstl_el.jstl.Resources, locale en_US
    at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:804)
    at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:773)
    I'm in session scope.
    However the result_set demo works for me. I've tried to
    compare carefully the differences between my own demo and result_set but I didn't find any clue. I've noticed that the panel_data modelReference is the bean id in result_set demo while in the tutorial it is given as a type
    (CustomerBean) I've tried both.

  • Error when dynamically creating and binding view object

    Hi,
    I'm using JDeveloper 10.1.2.1.0 (1913) to create a JSP - Struts - ADF BC application.
    I'm trying to create a lov page that is based on a viewobject whose query (and bindings) are set at runtime (like Steve Muench shows in one of his undocumented ADF samples).
    In the prepareModel() I do the following:
    -unbindRowsetIteratorFromDynamicQueryIteratorBinding(...)
    -changeDynamicViewObjectQuery(...)
    -recreateRangeBindingForDynamicQuery(...)
    -removeControlBinding(...)
    -addDynamicRangeBinding(...)
    So I remove the existing binding, change the query of the viewobejct and recreate the bindings.
    I have got most of the code running except for 1 issue:
    1. The first time I call my Lov I get the a stacktrace (included at the end of this post). If I close the window and click the Lov button again it is working fine.
    Can someone help me out with this one???
    Here is the stacktrace I am getting:
    javax.servlet.jsp.JspException: An error occurred while evaluating custom action attribute "value" with value "${bindings.OpmerkingenLookupIterator.rangeStart}": An error occurred while getting property "rangeStart" from an instance of class oracle.jbo.uicli.binding.JUIteratorBinding (java.lang.NullPointerException)
         at org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:146)
         at org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:166)
         at org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager.evaluate(ExpressionEvaluatorManager.java:112)
         at org.apache.taglibs.standard.tag.el.core.ExpressionUtil.evalNotNull(ExpressionUtil.java:85)
         at org.apache.taglibs.standard.tag.el.core.SetTag.evaluateExpressions(SetTag.java:147)
         at org.apache.taglibs.standard.tag.el.core.SetTag.doStartTag(SetTag.java:95)
         at web2d_inf._page._referentie._LovOpmerkingenLookup._jspService(_LovOpmerkingenLookup.java:131)
         [SRC:/WEB-INF/page/referentie/LovOpmerkingenLookup.jsp:28]
         at com.orionserver[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:349)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:220)
         at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
         at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)
         at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
         at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:320)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
         at oracle.jheadstart.controller.strutsadf.JhsRequestProcessor.process(JhsRequestProcessor.java:385)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         at oracle.jheadstart.controller.strutsadf.JhsActionServlet.process(JhsActionServlet.java:130)
         at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
         at oracle.jheadstart.controller.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:176)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:239)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:600)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:534)

    Here is some more info:
    I can reproduce the problem using the code Steve Muench supplies in his undocumented ADF samples.
    If you add the following line to the jsp in the example code(browseResultsOfDynamicVO.jsp):
    <c:set var="rangeStart" scope="request" value="${bindings.DynamicViewObjectIterator.rangeStart}"/>You will get the behaviour I am facing.
    The first time in your session you enter a valid query and submit it you get a stacktrace. By refreshing the page it works.
    It looks like that when recreating the bindings at runtime something more is fone that isn't done at design time. So the first time the statement fails but once the bindings have been recreated at runtime it suddenly works....
    The main question is: what is it that is done at runtime and is missing at design time?

Maybe you are looking for