How to perform logical comparison using struts

Hi all, I know this is probably not the best forum for a question regarding struts, but am sure most developers here are familiar with it.
how do you implement this using struts logic present or logic no present tags ?
if ((a != null ) && (b != null))
     // perform operation
else
     // perform altername operation
I am familiar with the stuts logic tags but not sure about the nesting levels to perform this type of operation.
Cheers

<logic:present name="XXXXForm" property="a">
     <logic:present name="XXXXForm" property="b">
          // perform operation
     </logic:present>
</logic:present>
<logic:notPresent name="XXXXForm" property="a">
     <logic:notPresent name="XXXXForm" property="b">
          // perform altername operation
     </logic:notPresent>
</logic:notPresent>
/code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • How to display dynamic images using Struts

    I am storing the image name in bean. I want to use the <html:img> tag to display my images. How can i do that using struts.
    Something or sort..
    <html:img src=bean:write name="pageEntry" property="pageImg"/>
    Thank You

    * In your web.xml file, add the struts-html-el.tld definition from the struts\contrib\struts-el\lib directory
    * Add this tag library to your JSP page; something like:
    <%@ taglib uri="WEB-INF/struts-html-el.tld" prefix="html-el" %>* Refer to the following example:
    <html-el:img src="${pageEntry.pagePic}" />* This assumes that pageEntry is a Bean, and pagePic is a bean variable accessed by the getPagePic() method.

  • How to perform system copy using standard sap method (sapinst)

    Hi guys
    pls tel how to perform system copy using standard sap method (sapinst) and to perform enterprise portal RESTORSTION.
    thanks
    kamal

    Hi Kamal,
    I have done a system copy of the production portal to a sandpit system before. The system copy export import method works very well, and is easy. For my portal, the whole procedure took me less than 6 hours.
    1. Go to this page: System Copy and Migration
    2. See the videos "Demo: How to Perform a System Copy Export" and "Demo: How to Perform a System Copy Import".
    This should give you the basic idea.
    I did a systemcopy using sapinst. If I remember right, this is the steps I performed:
    1. On target host, Installed a new Central services.
    2. On source host: Ran sapinst system copy export for Central Instance and Database instance. This created two export files (depending on your database size).
    3. Used the export files created in previous step to run the import step in target host.
    4. Some post processing steps, like configuring sso, creating systems in system landscapes, configuring WD JCos etc.
    Let me know if you need more help.
    Cheers
    Rishi

  • How to create web site using STRUTS frame work

    Hi,
    I know how to create web pages using JSP & Servlets.But now i have to create Matrimonial web site using STRUTS frame work.Plz any one guide for me...
    Thank U....

    Struts is not to be confused with JSF.
    Start at their own homepage over there at apache.org.
    Good luck.

  • How to perform merge operation using Data services designer?

    I am new here and new to Data Services Desinger as well.
    And currently, I want to do a merge operation using query transform or table comparison transform. But sadly, neither one of them is giving me what I want.
    So, wonder if you could help clarify if either one of them could achieve MERGE operation between and source and target tables?
    if positive, then how?
    PS:
    by MERGE, i mean, if data exists in target table, then only do update, else, do insert. same with the standard MERGE operation of oracle.
    If you need any more info, let me know!
    Thanks in advance.

    You can do this.
    You don't need the Tabe_Comparison transform actually.
    Just query the data you need and output the flow from your query to your target table.
    Then, you'll have to check the "Auto correct load" option: this will insert new lines and updates old ones. One checked, you can ckeck the "Auto correct load" checkbox.
    By default, BODS will know a line already exists based uppon the primary key columns of your target table. If you want to change the columns used to determine if a line should be inserted or updated, use the "Use input key" checkbox (and define some PK column in your query).
    Hope this helps
    Guillaume

  • How to perform Auto Save using Enhancement Id.

    Hi,
    I am working on an enhancement object in which i have to perform Auto Save functionality,when particular enhancement ID is active.
    To check activity status of the enhancement ID, function module 'Z_CC_CHECK_ENH_ACTIVE'  is used.
    When the enhancement id is active everything should be Auto Save.
    As in current functionality SAVE button is provided but now it needs Auto Save.
    Please suggest....
    Regards.
    Amit

    Hi,
    firstly there are two threads for the same issue from youself(excluding this one) which is a waste of others time so kindly refrain from doing so and use one thread.
    OWB: how can automatic updation  perform in staging database using OWB
    OWB: how to use insert/update table operator for target table
    secondly, with regards to the options , here are some options:
    1. Use trigger for update.
    2. Use materialized view(refresh on commit)
    3. Use oracle advance queing mechanism (OAQ) for queing the recent inserted/updated records.
    Kindly close other threads and maintain just one thread.
    Regards
    Message was edited by: Rado
    user647181

  • Logical Comparisons Using Numerical Values

    Hello:
    I am trying to create an if statement that tests when two variables equal zero. My problem is that I'm trying to use a logical & both variables are numeric, not boolean. Is there another way to do this? My code is below:
    if (released.getX() = 0) & (released.getY() = 0)
    Thanks!

    More precicely with && if the first expression is not true then the second expresion is not evaluated, however if the first expresion is true then the second part must be evaluated to determine if it is true too. Therefore if you have two conditions to check for and you expect one to be false more often then not, then by placing it first in the expresion it could help to reduce overall execution time.
    Secondly you may not always want to use &&. For instance if the expresions on each side of the & invoke a method that does some work before returning a true or false and your code relys on the added work that the function(s) perform then using the && could result in unexpected results.

  • How to Perform Loose Routing using Proxy?

    Dear all,
    It seems that proxyTo() changes the Request-URI of the SIP message. How can I proxyTo() the next hop without changing the Request-URI?
    Proxy p;
    p.proxyTo(nextHop);

    you could push a route using the following SipServlet API on the SipServletRequest:
    public void pushRoute(SipURI uri)
    If the sipURI has a lr parameter, WLSS will perform loose routing automatically.
    This will add a Route header to the req with the value you have provided and send the req to that hop.
    cheers,
    Mihir

  • How to upload the files using struts

    Hi all
    My requierment is to upload the files from the client machine and save it on the server, the file size must not increase more than 250 MB and to validate that we cannot do validation on the client machine so we have to validate it on the server side. below is my code kindly go through it if there is any problem in Bussiness Logic
    1>Upload.jsp
    2>UploadForm.java
    3>UploadAction.java
    *1>Upload.jsp*
    <%@ page language="java"%>
    <%@ page import="java.io.*"%>
    <%@ taglib uri="/WEB-INF/struts-bean" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html" prefix="html" %>
    <html>
    <body bgcolor="white">
    <form name="uploadForm" action="TestApplication/upload" method="post" enctype="multipart/form-data">
    <table>
    <tr>
    <td align="center" colspan="2">
    <font size="4">Please Enter the Following Details</font>
    </tr>
    <tr>
    <td align="left" colspan="2">
    <font color="red"></font>
    </tr>
    <tr>
    <td align="right">
    File Name
    </td>
    <td align="left">
    <input type="file"  name="theFile">
    </td>
    </tr>
    <tr>
    <td align="center" colspan="2">
    <input type="submit" value="UPLOAD">
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>*2>UploadForm.java*
    package com.MyPack.Datamatics;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.upload.FormFile;
    public class UploadForm extends ActionForm
         private static final long serialVersionUID = 1L;
    private FormFile theFile;
       public UploadForm(){}
       * @return Returns the theFile.
      public FormFile getThefile() {
        return theFile;
       * @param theFile The FormFile to set.
      public void setThefile(FormFile theFile) {
        this.theFile = theFile;
    } *3>UploadAction.java*
    package com.MyPack.Datamatics;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    import org.apache.struts.upload.FormFile;
    public class UploadAction extends Action
      public ActionForward execute(
        ActionMapping am,
        ActionForm af,
        HttpServletRequest req,
        HttpServletResponse res) throws Exception{
         UploadForm myForm = (UploadForm)af;
            // Process the FormFile
            FormFile myFile = myForm.getThefile();
            String contentType = myFile.getContentType();
            String fileName    = myFile.getFileName();
              int fileSize       = myFile.getFileSize();
              String data="";
              try{
            java.io.InputStream fileData  = myFile.getInputStream();
             String path="E:/store";
              File f = new File(path);
              java.io.OutputStream outputStream = new FileOutputStream(f+"/"+fileName);
              int temp = 0;
              byte[] buffer = new byte[8192];
              temp = fileData.read(buffer, 0, 8192);
              while ((temp) != -1) {
              outputStream.write(buffer, 0, temp);
                   outputStream.close();
                   data = "file has beeb written to E:/store" + fileName;
                   fileData.close();
              catch (FileNotFoundException fnf)
              { System.out.println("Cannot Found the file");
               System.out.println(data);
              System.out.println("contentType: " + contentType);
             System.out.println("File Name: " + fileName);
             System.out.println("File Size: " + fileSize);
          return am.findForward("success");
    }Thanks in Advance

    [help link 1|http://www.roseindia.net/struts/strutsfileuploadandsave.shtml]
    [help link 2|http://www.roseindia.net/struts/strutsfileupload.shtml]

  • How to perform converstaion implementation using JAX-WS

    Dears;
    I have two products which comunicate by using web services, Application 'A' sends to Application 'B', the current implementaion is that this web method accepts three parameter: Username, password, and the data payload as a third parameter.
    The data is sent every 4-5 hours by invoking this method 100-120 times and then after antoher 4-5 hours it sends the updataed data again. My Q is that hwo I can modify this design to make Application 'A' sends the credentials data user name and password (the first two parameters) only at the begining of the sumiting data and then after confimratin it starts send the data again (100-120 data items), instead of sending username and password for each invocation for each single data item.
    for example, how to make the communication statefull or if you have any idea pleas contribute !
    Thanks for you

    The location API is part of the J2ME and it is dependent on the mobile device if the API is available or not. If you want to see the code for JSR-179 just download the Sun Java Wireless Tookit.
    kris

  • How To add dynamic field using struts?

    Hi All,
    I new to the struts. I wanted to add dynamic form field .

    Why do so many people ask struts questions here? It's an Apache project and it has a mailing list. Why not go directly to the source? [http://struts.apache.org/]
    Kaj

  • Melodyne plugin - how to configure logic for using it?

    Currently, to use Melodyne to pitch-and-time modify an audio track, I send the output of a mono audio track to my audio interface, then bring it back in to a melodyne plug-in track where melodyne can record and do its magic. Is there a way of doing this internally, so the audio interface is not involved?
    Thanks

    keystrike wrote:
    Thank you. Just to be sure what is supposed to happen, does the audio get written over by new values?
    The Melodyne Plugin actually "records" new audio filesfor that section that you "Transfer" and when playing back the audio signal on that track just get re-routed to that Melodyne audio fle. You can set the location and you should keep an eye on those audio file. They are part of your Project assets and needed for your Project to play.
    The original files are not touched and still there. You can bypass the Melodyne files anytime.
    Make sure to read the manual and understand the concept and mechanisms. Otherwise, you could end up with broken links and lots of lost work. Also keep in mind that some features like solo and mute behave differently due to the "audio file routing" in the background.
    Once you are on top those "housekeeping" things, you can dive into this amazing tool.
    Hope that helps
    Edgar Rothermich
    http://DingDingMusic.com/Manuals
    'I may receive some form of compensation, financial or otherwise, from my recommendation or link.'

  • How to call other method using struts

    Hi,
    in my TestAction.java,
    i have 2 method, one is execute(...) and another is changeABC(...)
    in jsp,
    when i onchange, i call a javascript
    function onSwitch()
    document.forms[0].action.value = "changeABC";
    document.forms[0].submit();
    <html:form action="/test.do">
    </html:form>
    test.do will call TestAction.java and TestActionForm.java.
    y when i submit, it keep calling the execute method??
    How i suppose to do to enable it call changeABC method??
    pls advice.. thanks

    hi
    i am sending u one plz reply as soon as possible

  • Urgent help needed---File upload using struts

    can anyone helpme out on how to perform FileUpload operation using struts
    deepak

    Hi,
    You should use<html:file> tag for uploading file through struts. And make sure that in form bean u need to manipulate this property with FormFile type. provide getter and setter in form bean for this one and manipulate it in your action class.
    let me know if u have any further issue..
    Tushar

  • SetProperty using struts

    How can we achieve this using struts?
    <jsp:useBean id="aaa" class="mypackage.Department"> <jsp:setProperty name="aaa" property="name" value="jsmith" /> <jsp:setProperty name="aaa" property="phoneNumber" value="555-5555" /></jsp:useBean>

    Below is the code of what I am doing.
    <bean:define id="offsetBean" name="coursePageForm" property="index" type="java.lang.Integer"/>
    <logic:iterate id="MapEntry" name="pageMap" length="1" indexId="india01">
    <bean:size id="mapSize" name="pageMap"/>
    <logic:iterate id="pageEntry" name="MapEntry" length="1" offset="offsetBean" indexId="india02">
    <bean:size id="pageSize" name="MapEntry"/>
    <td align="left" width="25%" >
    <bean:write name="pageEntry" property="pageText"/>
    </td>
    <TD align=right vAlign=top width=185>
    <html-el:img src="${pageEntry.pagePic}" />
    </TD>
    </logic:iterate>
    </logic:iterate>
    My site enables users to take online courses. Every course has a course Id and based on that course id, every course has multiple sections with section ids. Each section has multiple pages, with Page Id's.
    When a user clicks on a course I get all the sections and pages related to that section from the database. Each section is stored as one entry in an ArrayList and since each section has multiple pages that are also stored as ArrayList inside this ArrayList. So I have an ArrayList of section containing ArrayList of pages.
    I have one page to display all the contents. I loop through the ArrayList the way it�s shown above. Every time the user clicks next I increment the inner Loop's "offset" attribute. The problem starts when all the pages of a section are done and now we need to move to the next section. For that I want to increment the "offset" attribute of outer loop. I don't know of an easy way of doing this.
    We can communicate over the email also.
    [email protected]

Maybe you are looking for