Strut tag logic:greaterThan question

I'm dealing with a salesperson sales data bean. The bean contains sales goals and actuals for various criteria. If the actual is less than the goal I'd like to display it in red, if greater than, green.
The struts doc for the logic greaterThan/lessThan tags states that the value attribute must be a constant. Is there a way that I can make the value attribute another bean property? Can I use a scriptlet?
Thanks for any information you can give me.
bfrmbama

<logic:iterate id="db" name="dbForm">
<tr>
<td>
<bean:write name="db" property="name"/>
</td> <td><bean:write name="db" property="name1"/></td>
</tr>
</logic:iterate >
dbForm is my form name where i have getname,getname1 for storing two
ArrayList..
but i find error as Cannot create iterator for this collection;(
where i went wrong;(

Similar Messages

  • Passing struts-tag value to java / javascript variable in JSP

    Hello all,
    Im trying to pass the value got from the struts-tag to the java variable in the Jsp. However Im not able to get the o/p. Can u guys help me on this pls...
    <logic:notEmpty name="TreeBean" property="list">
        <logic:iterate id="Type" name="TreeBean" property="list" indexId="i">
         <br/><bean:write name="Type" />
        </logic:iterate>
    </logic:notEmpty>Here the list can be populated in the jsp page. However i want the values into jsp list. Im not able to populate the same..
    <% List jspList = null;
    %> I want the values into the jspList variable for further processing. Can u guz pls help me on this....

    Which do you want it in?
    A java variable for use in <% scriptlet code %> or a javascript variable for use on the client end?
    scriptlet:
    <jsp:useBean id="TreeBean" type="java.util.List" class="java.util.ArrayList" scope="?????" />
    Having scriptlet code on the page is considered bad coding style.
    What is it you are trying to accomplish by making the value accessible?
    What are you trying to do in java / javascript that can't be done with JSP tags?

  • Problem compling JSP with struts tags on Weblogic 8.1

    I have deployed a web application in Weblogic 8.1. However, I am facing a problem while the JSPs are getting compiled. The JSPs ahve taglib declarations referring to Struts tag library files that are present in WEB-INF folder.
    Stacktrace:
    C:\java\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver_epgonline_epgonline\jsp_servlet\_approve\__approve_home.java:209: cannot resolve symbol
    probably occurred due to an error in /approve/approve_home.jsp line 53:
    <logic:notPresent name="<%=JobBean.ID%>" scope="request">
    C:\java\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver_epgonline_epgonline\jsp_servlet\_approve\__approve_home.java:209: cannot resolve symbol
    symbol : variable EVAL_BODY_BUFFERED
    location: interface javax.servlet.jsp.tagext.BodyTag
    if (_int0 == BodyTag.EVAL_BODY_BUFFERED) { //[ /approve/approve_home.jsp; Line: 53]
    I believe other people have also faced this issue with Weblogic8.1 and struts. Any solutions???
    Thx
    KP

    KP,
    Does this code run in the development environment but not in production? How
    was this code compiled?
    - john
    "KP" <[email protected]> wrote in message
    news:405b9b56$[email protected]..
    I have deployed a web application in Weblogic 8.1. However, I am facing aproblem while the JSPs are getting compiled. The JSPs ahve taglib
    declarations referring to Struts tag library files that are present in
    WEB-INF folder.
    Stacktrace:
    C:\java\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\m
    yserver_epgonline_epgonline\jsp_servlet\_approve\__approve_home.java:209:
    cannot resolve symbol
    probably occurred due to an error in /approve/approve_home.jsp line 53:
    <logic:notPresent name="<%=JobBean.ID%>" scope="request">
    C:\java\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\m
    yserver_epgonline_epgonline\jsp_servlet\_approve\__approve_home.java:209:
    cannot resolve symbol
    symbol : variable EVAL_BODY_BUFFERED
    location: interface javax.servlet.jsp.tagext.BodyTag
    if (_int0 == BodyTag.EVAL_BODY_BUFFERED) { //[/approve/approve_home.jsp; Line: 53]
    >
    I believe other people have also faced this issue with Weblogic8.1 andstruts. Any solutions???
    >
    Thx
    KP

  • Struts tags

    Hi there
    I am new to struts. I was trying to test a logon system, and I got some problems with invoking struts tags.
    I created "pages" fold and "tags" fold under my WEB-INF fold. I copied and pasted all tlds in tags fold including struts-html.tld. In pages fold, there is a Logon.jsp, which has <%@ taglib uri="/tags/struts-html" prefix="html" %> at the top.
    However, the system gives me an error message below
    File "/tags/struts-html" not found
    If I change it to <%@ taglib uri="/tags/struts-html.tld" prefix="html" %>, the errors becomes to
    java.lang.NoSuchMethodError: javax.servlet.jsp.tagext.TageAttributeInfo.<init>(Ljava/lang/...................
    Does anyon know how to fix it?
    Cheers
    Weiming Chen

    Hi there
    I am new to struts. I was trying to test a logon
    system, and I got some problems with invoking struts
    tags.
    I created "pages" fold and "tags" fold under my
    WEB-INF fold. I copied and pasted all tlds in tags
    fold including struts-html.tld. In pages fold, there
    is a Logon.jsp, which has <%@ taglib
    uri="/tags/struts-html" prefix="html" %> at the top.
    However, the system gives me an error message below
    File "/tags/struts-html" not found
    If I change it to <%@ taglib
    uri="/tags/struts-html.tld" prefix="html" %>, the
    errors becomes to
    java.lang.NoSuchMethodError:
    javax.servlet.jsp.tagext.TageAttributeInfo.<init>(Lja
    a/lang/...................
    Does anyon know how to fix it?
    Cheers
    Weiming ChenDear Weiming Chen,
    Try this,
    <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html"%>
    <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean"%>
    <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic"%>
    ..........

  • Struts tag for request.setAttribute() in a jsp page

    Hello All
    Does anyone know struts tag that can be used for request.setAttribute() in a jsp page?
    Thanx in advance.

    Well
    <bean:define id="foo" name="newsIdAttribute" scope="request" type="java.lang.String" />is equivalent to
    <%
    (java.lang.String) foo = (java.lang.String)request.getAttribute("newsIdAttribute");
    %for setting bean properties you might have to use
    <jsp:setProperty/> or <c:set/> tags in JSP / JSTL respectively.
    Hope this might answer your question :)
    REGARDS,
    RaHuL

  • How to get parameter and add it to hyperlink using struts tag?

    Hi everyone:
    There is a.jsp pass a parameter to b.jsp.How to get the parameter in b.jsp using struts Tag?I also want to add the parameter to a hyperlink in b.jsp.For example in b.jsp <html:link forward=.....>cxxxx</html:link>.How to add the parameter(get from a.jsp) to cXXXX in b.jsp?

    Try this:
    Copy A Request Parameter - You can create a new bean containing the value of a parameter included in this request. If no parameter of the specified name was included, a request time exception will be thrown - therefore, it is common to nest the use of this tag inside a <logic:present parameter="xxx"> tag to ensure that the parameter was really included. If there is the possibility that more than one parameter of the same name was included, specify the "multiple" attribute (and the resulting value bean will be an array of String values, instead of a single String).
    <bean:parameter id="name" name="name"/>
    And then just use <html:link> with paramId. No java code at all.

  • Referencing beans as bean attributes in struts tags

    Do struts tags allow you access bean attributes when the bean itself is an attribute of another bean?
    If so, what would be the syntax?
    For instance, I have bean A that contains as an attribute another bean B. I want to test for the value of
    an attribute within B. Let's say I have bean A where A has get/set methods for B and B has get/set methods for an attribute called 'amount'. Then can I say something like:
    <logic:equal name="A" property="B.amount" value="1">
    I tried this syntax and also "B.getAmount()", but neither seems to work.
    I have also tried <logic:equal name="A.B" property="amount" value="1">
    but this doesn't work either.

    I've used that x.y syntax before in some tags, but I don't know if logic tags support it... you should be able to do this:
    <bean:define id="B" name="A" property="B" />
    <logic:equal name="B" property="amount" value="1">

  • JDeveloper editing JSP with Struts tags terribly, terribly slow!?

    I use JDeveloper 10.1.2 and I do not know the reason but it started to take 15min just to change/edit JSP containing Struts tags. RAM memory is 1GB and there is more than 0.5 GB available, but processor usage shows 100% allocated to JDeveloper!? As soon as I do even slight change in a JSP file JDeveloper starts some computations and I have no idea of what it is doing.
    What is JDeveloper computing? It seems it tries to produce some drop-down lists "helping" me to do the editing, add tags and instead I am spending days to just change one small JSP page!
    How can I stop and PREVENT JDeveloper doing ANY "help" during editing of ANY file?
    There must be an option to switch off whatever JDeveloper is doing?
    Many thanks,

    I did that but it is still very slow, it looks like Jdev is doing some intensive calculations whenever I click somewhere on JSP page with tags. Maybe this is related with my other question I posted before this one? Maybe JDev automatically searches for tag libraries it cannot find and copies them to /WEB-INF directory? (other IDEs used in same environment, like Eclipse and IntelliJ, and they do not have this problem)
    Some other strange things: struts-config.xml seems not integrated with CVS from JDev (other files like tiles-config.xml, web.xml etc. are integrated, I can right click and get CVS info on particular file, except struts-config.xml). When I want to check in/out struts-config.xml I have to do it with external tool like WinCVS etc., cannot do that from JDev!

  • Proble with Struts Taglib "logic:iterate"

    I m designing an simple application, it uses to input some data and then display them.
    For example,I want to input studentID,studentName into the database,but i want to input more than one student data each time.
    This is my FormBean souce:
    package system.form;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionMapping;
    import org.apache.struts.action.ActionErrors;
    import org.apache.struts.action.ActionMessage;
    import javax.servlet.http.HttpServletRequest;
    public class StudentForm {
        private String[] studentID;
        private String[] studentName;
        public String[] getStudentID() {
             return studentID;
        public String[] getStudentName() {
             return studentName;
        public void set(String[] field) {
             studentID = field;
        public void set(String[] field) {
             studentName = field;
    }This is my form:
    <html:form method="post" action="/add">
        StudentID: <html:text property="studentID"/>
        StudentName:<html:text property="studentName"/>
        <br/>
        StudentID: <html:text property="studentID"/>
        StudentName:<html:text property="studentName"/>
        <br/>
        <html:submit value="add"/>
    </html:form>The problem is: my StudentForm is in SESSION scope.So after i have input some data,i return to the input page, the text filed will display the data i inputed last time.
    But when i do it, i saw the data in the field are like this:
    [Ljava.lang.String;@595420
    [Ljava.lang.String;@a218a5
    [Ljava.lang.String;@2f54
    Not the data i input,I think the problem is that my attribute in the StudentForm is array string, not string. So there is any problem when display.
    What can i do to resolve it?
    Also,there is another problem.
    In my input page. I must iterate the input field like:
    StudentID: <html:text property="studentID"/>
        StudentName:<html:text property="studentName"/>
        <br/>
        StudentID: <html:text property="studentID"/>
        StudentName:<html:text property="studentName"/>
        <br/>
        ....So when i want to input 10 records each time, i must iterate the html above 10 times,and then 20 records needs iterating 20 times, it's bald and it makes the page hard to read and maintain.
    So i want to use Struts's Tag <logic:iterate> to manipulate it.
    But i don't know how to use it.
    Can anybody give me a hand? Thank u.

    First of all, the studentID and the studentName are related. If you keep them as two separate String arrays, it will be very hard to use logic:iterate to display them together.
    I would suggest that you first create a VO class which contains only studentID and studentName and have getter-setter methods for them. (This is logically good as you are modelling a student using a separate class) And, in your form, declare a studentVO[ ] and have getter-setter methods. You may need to change them and add new ones as they will have to be indexed. This can be looked up in the Struts documentation page.
    Finally in your jsp, iterate over the studentVO[ ] bean and give the respective getter property of studentID and studentName in VO with indexed = "true"....
    <logic:iterate id = "studentVO" name = "<formbean name>" property = "studentVO">
    <html:text name="studentVO" property = "studentID" indexed = "true"/>
    <html:text name="studentVO" property = "studentName" indexed = "true"/>
    etc..
    </logic:iterate>
    (Note that you may have to give the type attribute in your logic:iterate so that it may be cast into the right VO object)
    Hope this helps.

  • How to prepare Custom tag with scope as  session  like Struts tag

    Hi
    All Struts tags having the feature of Automatic Scoping.
    Automatic Scoping: Struts tags check all contexts (namely page, request, session, application) and use the first instance found. Developers do not have to explicitly "retrieve" objects from a particular scope. They may, however, specify a context.
    same as like struts tag I want to preapre 'select custom tag'.which will retrieve its previous selected value automatically and display.And one important thing is I dont want to set the selected value of custom tag in session expicitly.I mean the custom tag it self should take care to set the session vale and retrieve the sesion value and display like Struts tag . For struts select tag we wont set any selected value in session though it will retrieve the previous value and display when scope of form = session
    regards
    jagan

    Hi
    All Struts tags having the feature of Automatic Scoping.
    Automatic Scoping: Struts tags check all contexts (namely page, request, session, application) and use the first instance found. Developers do not have to explicitly "retrieve" objects from a particular scope. They may, however, specify a context.
    same as like struts tag I want to preapre 'select custom tag'.which will retrieve its previous selected value automatically and display.And one important thing is I dont want to set the selected value of custom tag in session expicitly.I mean the custom tag it self should take care to set the session vale and retrieve the sesion value and display like Struts tag . For struts select tag we wont set any selected value in session though it will retrieve the previous value and display when scope of form = session
    regards
    jagan

  • Struts tag problems in weblogic 5.1 sp12

              Hello,
              I am deploying a struts application in weblogic 5.1 sp 12. When I load any jsp
              page with a struts tag, e.g. <html:html>, it will throw exceptions as follows:
              Parsing of JSP File '/Feedback.jsp' failed:
              /Feedback.jsp(-1): Error in tag library at: 'bean': error introspecting class:
              'org.apache.struts.taglib.bean.CookieTag': weblogic.servlet.jsp.JspException:
              (line -1): Error in tag library at: 'bean': class org.apache.struts.taglib.bean.CookieTag
              doesn't implement javax.servlet.jsp.tagext.Tag
              probably occurred due to an error in /Feedback.jsp line -1:
              any comment is highly appreciated! I am following the directions posted on apache
              website about instaling struts with weblogic 5.1.
              

              Hello,
              I am deploying a struts application in weblogic 5.1 sp 12. When I load any jsp
              page with a struts tag, e.g. <html:html>, it will throw exceptions as follows:
              Parsing of JSP File '/Feedback.jsp' failed:
              /Feedback.jsp(-1): Error in tag library at: 'bean': error introspecting class:
              'org.apache.struts.taglib.bean.CookieTag': weblogic.servlet.jsp.JspException:
              (line -1): Error in tag library at: 'bean': class org.apache.struts.taglib.bean.CookieTag
              doesn't implement javax.servlet.jsp.tagext.Tag
              probably occurred due to an error in /Feedback.jsp line -1:
              any comment is highly appreciated! I am following the directions posted on apache
              website about instaling struts with weblogic 5.1.
              

  • Struts tags preferences

    is there a preference file for Struts tags such that the HTML code it generates can be customized? For example I have the following Struts tag code:
    <s:form
         action="upload" method="POST" enctype="multipart/form-data">
         <s:file name="upload" label="File" />
         <s:submit id="upload" name="submit"/>
    </s:form>and the HTML it generates automatically put everything into tables. What annoys me is that the Submit button is placed in its own row. Why?? The form looks frickin' ugly now.
    <form id="upload" name="upload" onsubmit="return true;" action="upload.action" method="POST" enctype="multipart/form-data"><table class="wwFormTable">
         <tr>
        <td class="tdLabel"><label for="upload_upload" class="label">File:</label></td>
        <td
    <input type="file" name="upload" value="upload_upload" =""/></td> </tr>
         <tr>
        <td colspan="2"><div align="right"><input type="submit" id="uploadIcon" name="submit" value="Submit" />
    </div></td>
    </tr>
    </table></form> Is there a solution to customize this? thank you

    Maybe just don't use the struts tag then?

  • LPAR - LOGICAL PARTITION QUESTION -

    Hello SDN Experts.
    LPAR (LOGICAL PARTITION QUESTION)
    Our current Production Environment is running in Distributed Installation on
    IBM System P5 570 Servers AIX ver 5.2, each node is running two Applications: SAP ERP 2005  SR1 (ABAP + JAVA)  and CSS. (Customer Service System)
    Node One
    u2022     SAP Application (Central Instance, Central Services)
    u2022     Oracle 9i Instance for CSS Application.
    Node Two.
    u2022     Oracle 10G Instance for SAP Application
    u2022     CSS Application.
    To improve performance we are planning to create a new LPAR for SAP.
    According to the IBM HW Partner LPAR is logically isolated with different HW/SW resource(CPU/Memory /Disk resource, IP/hostname/mount point)...
    Question:
    I have this two possible solutions to copy SAP instances (app + db)  to new LPAR, can I apply SCENARIO 2, which in my opinion is easier than SCENARIO 1.
    SCENARIO 1.
    In order to migrate application and database instances to the new LPAR do I need to follow the procedure explained in the guide:
    (*) System Copy for SAP Systems Based on SAP NetWeaver 2004s SR1 ABAP+Java Document version: 1.1 ‒ 08/18/2006
    SCENARIO 2.
    After create all file systems (required in AIX) to copy data from Applications and Database Instances to their respective LPARs and change the ip address and hostnames in parameter files according to the following SAP Notes:
    Note 8307 - Changing host name on R3 host
    Note 403708 - Changing an IP address
    Which is the best scenario SAP recommends in this case ?
    Thanks for your comments.

    If your system is a combined ABAP + Java instance you can´t manually change the hostname. It´s not only those places that are listed in that note but much more, partially on filesystems in .properties files, partially in the database.
    Doing that manually may work but since the process is not documented anywhere and since it depends on the applications running on top of the J2EE instance it´s not supported.
    For ABAP + Java instances you must use the "sapinst-way" to get support in case of problems.
    See note 757692 - Changing the hostname for J2EE Engine 6.40/7.0 installation
    Markus

  • Struts tag library instead of JSTL

    My developers here are not very well versed with JSTL .
    Is it advisable to use the Struts tag library instead of JSTL.

    For JSTL you need two jar files in your web-inf/lib directory.
    standard.jar
    jstl.jar
    You only mentioned standard.jar - make sure the other is there as well.
    There are also some libraries requried. I think they were included with JDK1.4, but am not entirely certain.
    Check out the requirements on this page:
    http://jakarta.apache.org/taglibs/doc/standard-1.0-doc/standard-1.0/GettingStarted.html
    Particularly those related to JAXP.
    I am think EOFException might be a trouble with parsing the c.tld file in the standard.jar
    Hope this helps,
    evnafets

  • PDK Struts tags

    When trying to use the PDK Struts tags in a portlet, I receive the following error message when the portlet has been deployed to a 10g portal:
    [ServletException in:/WEB-INF/jsp/tiles/portal/index.jsp] action'
    Even with debug mode enabled on the server, that's the only detail I get. My config is as follows:
    IN SERVER.XML
    <taglib>
    <taglib-uri>/WEB-INF/tld/pdk-struts-html.tld</taglib-uri> <taglib-location>/WEB-INF/tld/pdk-struts-html.tld</taglib-location>
    </taglib>
    IN THE TAGLIB INCLUDE
    <%@ taglib uri='/WEB-INF/tld/pdk-struts-html.tld' prefix='pdk' %>
    IN THE JSP:
    <pdk:link page="/servlet/letterView">Link text</pdk:link>
    VERIFIED:
    - The portlet works without the tag included.
    - It works using the standard Struts html:link tag, but of course generates the resulting page in it's own screen, outside of the portal container
    - The TLD is indeed in the location listed in the URI
    - The following two JARs are included in the LIB directory: pdkjava.jar, pdkstruts.jar
    - I removed all attributes from the tag and received a more detailed message (Cannot create rewrite URL: java.net.MalformedURLException: You must specify exactly one of "forward", "href", or "page"') so it seems like everything that needs to be in place is indeed in place -- it seems like I'm just misusing the tag.
    Any help would be appreciated. Thanks!

    The problem was an old copy of the struts.jar file, which was missing the calculateUrl() method called by the Oracle tag. With a new struts.jar file, all was good.

Maybe you are looking for

  • In Lr 3.6 how can I search for filenames ending with a # character ?

    The text search seems to treat the # character in some mysterious way so as to not select the files that have it in their name. I cannot find any explanation for this in the documentation. Is there some other character(s) that I have to put beside th

  • Embedding video in iWeb

    Hi I want to add a video clip to my website but don't want to depend on other people's PCs having Quicktime installed for them to be able to play it. Can anyone recommend a way to do this? Thanks Mark

  • Queries related to refurbishment process

    While settling my order I get the issue account type M is not defined for document type SA.How to silve this? I am not able to display my costs for labour and my plan cost for material is not being displayed.I am missing out some settings realted to

  • Lookup Type For Status Field

    Hello! Please I need a direction to confirm that it is not recommended to add a lookup_code on the table FND_LOOKUP_VALUES, where the lookup_type is 'CODE_STATUS'. I also need to confirm that this lookup_type is really the one available for most of t

  • Exporting 3D image in Photoshop CS5 to After Effects CS5

    Hi there, Is there anything special I need to do when saving a PSD file with a 3D layer in it?  I've done this with CS4 and it's worked flawlessly--upon upgrading to CS5, I can't seem to figure out how to Render for Final Output (I've got Ray Trace F