Struts- two actions with same path in struts config

hai
I am having html:select tag with two options (View And Download) in a form.My form signature is like <html:form action="select">.I mapped two options(View,Download) with same action path.When i click view it doesn't forwards(remains idle) and no error is shown.But i click download it forwards to the appropriate page.If iam having two tags with same action path the second is only working.This problem doesn't comes when iam having one tag alone.
My code is here:
-----------Select.jsp----------------
<html:form action="Select">
<html:select property="id">
<html:option value="view">View</html:option>
<html:option value="download">Download</html:option>
</html:select>
</html:form>
----------------Struts-config.xml------------
<form-beans>
<form-bean name="viewForm" type="ViewForm"/>
<form-bean name="download" type="DownloadForm"/>
</form-beans>
<action-mappings>
<action path="/Select"
name="viewForm"
type="ViewAction"
input="/Select.jsp">
<forward name="success" path="/Success.jsp"/>
</action>
<action path="/Select"
name="downloadForm"
type="DownloadAction"
input="/Select.jsp">
<forward name="success" path="/Welcome.jsp"/>
</action>
</action-mappings>
Can i have action tag with same paths like this.If not please provide me a solution

I have created two success pages.
I have created two findForward in my ActionClasspublic ActionForward execute(ActionMapping mapping,...............)
if(a==view)
return mapping.findForward("success");
else
return mapping.findForward("success1");
----------------Struts-config.xml------------
<form-beans>
<form-bean name="viewdownloadForm" type="ViewdownloadForm"/>
</form-beans>
<action-mappings>
<action path="/Select"
name="viewdownloadForm"
type="ViewdownloadAction"
input="/Select.jsp">
<forward name="success" path="/Success.jsp"/>
<forward name="success1" path="/Success1.jsp"/>
</action>

Similar Messages

  • Two methods with same name but different return type?

    Can I have two methods with same name but different return type in Java? I used to do this in C++ (method overloading or function overloading)
    Here is my code:
    import java.io.*;
    public class Test{
    public static void main(String ar[]){
    try{          
    //I give an invalid file name to throw IO error.
    File file = new File("c:/invalid file name becasue of spaces");
    FileWriter writer = new FileWriter(file ,true);
    writer.write("Test");
    writer.close();     
    } catch (IOException IOe){
         System.out.println("Failure");
    //call first method - displays stack trace on screen
         showerr(NPe);
    //call second method - returns stack trace as string
            String msg = showerr(NPe);
            System.out.println(msg);
    } // end of main
    public static void showerr(Exception e){
         StringWriter sw = new StringWriter();
         PrintWriter pw = new PrintWriter(sw);
         e.printStackTrace(pw);
         try{
         pw.close();
         sw.close();
         catch (IOException IOe){
         IOe.printStackTrace();     
         String stackTrace = sw.toString();
         System.out.println("Null Ptr\n" +  stackTrace );
    }//end of first showerr
    public static String showerr(Exception e){
         StringWriter sw = new StringWriter();
         PrintWriter pw = new PrintWriter(sw);
         e.printStackTrace(pw);
         try{
         pw.close();
         sw.close();
         catch (IOException IOe){
         IOe.printStackTrace();     
         return sw.toString();
    }//end of second showerr
    } // end of class
    [\code]

    Overloading is when you have multiple methods that have the same name and the same return type but take different parameters. See example
    public class Overloader {
         public String buildError(Exception e){
              java.util.Date now = new java.util.Date() ;
              java.text.DateFormat format = java.text.DateFormat.getInstance() ;
              StringBuffer buffer = new StringBuffer() ;
              buffer.append(format.format(now))
                   .append( " : " )
                   .append( e.getClass().getName() )
                   .append( " : " )
                   .append( e.getMessage() ) ;
              return buffer.toString() ;
         public String buildError(String msg){
              java.util.Date now = new java.util.Date() ;
              java.text.DateFormat format = java.text.DateFormat.getInstance() ;
              StringBuffer buffer = new StringBuffer() ;
              buffer.append(format.format(now))
                   .append( " : " )
                   .append( msg ) ;
              return buffer.toString() ;
         public String buildErrors(int errCount){
              java.util.Date now = new java.util.Date() ;
              java.text.DateFormat format = java.text.DateFormat.getInstance() ;
              StringBuffer buffer = new StringBuffer() ;
              buffer.append(format.format(now))
                   .append( " : " )
                   .append( "There have been " )
                   .append( errCount )
                   .append( " errors encountered.")  ;
              return buffer.toString() ;
    }Make sense ???
    Regards,

  • Two actions on same day

    hi,
    We have requirement where we need to run the two actions on same day
    Hiring actions
    Change in pay action
    In hiring action basic pay has to come as mention in pay scale group then they want to run one more actions called change in pay on same day where they would maintain basic pay
    My doubt is that will we able run two actions on same day if yes,
    I have actived IT0302 addition action and T77S0 Table as  ADMIN              EVSUP  1
    Please let me know what the other settings I have to do 
    I am getting below error when I run two actions on same day

    You can excute multiple actions for an employee on same date in PA40
    For Example:
      An Employee of a company , got Hired and Change in Pay on the Same date.
    You need to execute  RPUEVSUP program  for Activation of Additional Actions  and
    In T77S0 table: below values should be maintained
    Group name Semantic abbr.    Value
    ADMIN           EVSUP                1
    In T529A table:below value should be maintained
          Field                         Value
          Action Type              A3 (Hiring)
          Update IT0000           X
          Update IT0302           X
          Field                         Value
          Action Type              A9 (Change in Pay)
          Update IT0000           X
          Update IT0302           X
    I hope this will resolve your issue

  • Two Switches with same MAC+Priority running STP

    Hi
    what will happen if two switch with same MAC-ADDRESS and same STP priority will run STP , how will elect to the root bridge ???? how the STP process will handle this situation?
    thanx

    Well, first off, no two switches (or switchports) will have the same MAC (if they do, you're buying switches from the wrong, very bad place).
    Every port of the switch will have (at least) one MAC of it's own.
    Given the same priority for all switches/bridges on the LAN, the lowest switch/bridge MAC on the LAN will win as the root.
    VLANS take on the MAC of the administrative interface ("CPU"): i.e., xxxx.xxxx.5000, the first port (i.e., fa0/1) is xxxx.xxxx.5001, the second (fa0/2) is xxx.xxxx.5002, and so on
    If you do a "show interface", the MAC / bia is displayed in the second line.
    Good Luck
    Scott

  • Two idocs with same idoc number in idx5

    We are using an idoc to file scenario where idocs are bundled using bpm and posted to ftp. here the issue is we are getting two idocs with same idoc number in idx5. due to which the file in ftp is getting overwritten.
    Could anyone suggest me what to do in this regard.

    Hi,
    >>>check your sender system is sending same IDoc twice ?
    if you send the same IDOC twice they both get different numbers as IDOC number is taken from the IDOC num range
    unless you're able to send the same IDOC twice with the same IDOC num somehow
    Regards,
    Michal Krawczyk

  • Can we perform two actions with one button with two clicks one after other?

    Sir,
    can we perform two actions with one button with two clicks one after other?
    I want that when I click an Add Button first time it add data to the database and when I click again this button it clear the form data to empty fields.
    Regards
    Tanvir

    In code it should be easy.
    The following code adds a button called butman with a text "ADD".
    It then registers a listener that will be called if the button is clicked.
    This listener then calls the runAddData method if you clicked on butman while it contained the "ADD" text and it will call the runClearData method otherwise.
    Therefore it will swap the button's functionality between ADD and CLEAR on every click.
    final Button butman = new Button("ADD");
    butman.setOnAction(new EventHandler<ActionEvent>() {
              @Override
              public void handle(ActionEvent t) {
                        if (butman.getText().equals("ADD")) {
                                  butman.setText("CLEAR");
                                  runAddData();
                        } else {
                                  butman.setText("ADD");
                                  runClearData();
                        } // END IF-THEN
              }});I hope this is what you wanted.
    Some extra food for thought.
    You might want to run the ADD and CLEAR methods in their own threads so that it can run in the back ground, without slowing down your user interface.
    I also like to rather reuse one button for multiple functionality in stead of making an application with hundreds of nodes only used rarely with masses of code to show and hide them if needed.

  • Two account with same UPN in Active Directory

    Is it possible to have two accounts with same UPN in AD? 
    I'm using Windows Server 2012 R2

    To expand on what Mr X said. Active Directory allows you to assign just about anything to the userPrincipalName attribute, as long as the value is unique. The value of this attribute is generally referred to as the UPN. But you could assign values with no
    "@" symbol, for example, or more than one "@" symbol. Also, Active Directory does not require that any value be assigned. It is an optional attribute.
    If no value is assigned to the userPrincipalName attribute, then the user can use a "default" UPN, which is <sAMAccountName>@<DNS domain name>, where <sAMAccountName> is the "pre-Windows 2000 logon" name of the user
    (the value of the sAMAccountName attribute), and <DNS domain name> is the DNS name of the domain.
    If a user has a value assigned to userPrincipalName that does not match this "default" form, then they can logon with either UPN, as long as no one else has either value assigned to their userPrincipalName attribute. You will note that Active
    Directory enforces uniqueness in the domain on sAMAccountName values.
    If in domain "domain.com" a user has a sAMAccountName of "jsmith" but userPrincipalName "[email protected]", then another user can have userPrincipalName of "[email protected]" (as long as no one else
    has that value assigned to userPrincipalName). They can each logon with their assigned values for userPrincipalName. But the first user can no longer also logon with their "default" value, based on their sAMAccountName, because it is now
    used by someone else. But if you attempt to assign a value to userPrincipalName that is also assigned to another user, you get an error.
    Bottom line, only one person can logon with any given UPN.
    Richard Mueller - MVP Directory Services

  • Two records with same  key (Infocube)

    Hi,
    I was trying to do, in a update rule, an "IF" condition with two key figures.
    IF Kf1 > Kf2. result = Kf1 else result = Kf2.
    But the data in the source (datamart Infocube to infocube) have tow records with the same characteristics combination (the same keys)and different amount in the keyfigures, then the result of my "if" condition is not the expected because I understood in the infocube only exists one characteristics combination. :S
    I was seeing those records in the manage transaction of the infocube.
    Some reason for this?
    Thanks and regards
    Victoria Leó

    This can happen with parallel loads.  Two rows with same set of Char values but in different packets of the same Request, being loaded at the same time.
    It really shouldn't be an issue - your update rule will make the KF change as desired.  Your queries aggregate KFs based characteristic values, not Dim IDs, so you'll get the totals you expect.
    Here's some more info:
    There is an RSRV Test that lets you check a dimension for a cube to see if multiple DIM IDs exist for the same combination of Chars - <b>Multiple Entries in Dimensions of a (Basis) InfoCube</b>
    Output looks like:
    12:02:24 o'clock on 08/25/2006: Start test run for user PIZZAMAN:)
    Dimension ZFM_C521: DIMID 61,215 and 61,214 have same characteristic values
    Dimension ZFM_C521: DIMID 61,880 and 61,879 have same characteristic values
    Dimension ZFM_C521: DIMID 61,366 and 61,365 have same characteristic values
    Dimension ZFM_C521: DIMID 61,368 and 61,367 have same characteristic values
    12:02:24 on 08/25/2006: Test run for user PIZZAMAN:) completed
    You can run the Correct Error option to have it update fact rows to use one of the DimIDs if you want, but unless you have lots of them, I even wouldn't bother.
    Here's the description of the test:
    <u>Description</u>
    This elementary test recognizes whether there are several lines that have different DIMIDs(dimension table key), but have the same SIDs for the selected dimension table for the InfoCube specified. (This can occur by using parallel loading jobs). This has nothing to do with an inconsistency. However, unnecessary storage space is occupied in the database.
    <u>Repairs</u>
    Since the different DIMIDs with the same SIDs are normally used in the fact tables, they cannot simply be deleted. Therefore, all of the different DIMIDS in the fact tables are replaced by one DIMID that is randomly selected from the equivalent ones. Before a change can be made to the database, the consent of the user is requested.
    DIMIDs that have become unnecessary are deleted in the connection. In doing so, not only are the DIMDs deleted that were released in the first part of the repair, but so are all of those that are no longer used in the fact tables (including aggregates). The consent of the user is again requested before this change is made.

  • Unable to monitor two databases with same name on two different hosts

    I have got two databases with same name on two different hosts. I added one database to the list of monitored databases. Now If I try to add the other one , I get the message that the database is already being managed.
    Can't we monitor two databases with same name on two different hosts?

    you can... while saving the target,give a different name.. for eg target-2

  • How to separate two contact with same name

    Hi, anyone knows how to separate two contacts with same name in Contacts?  Actually they are two persons from two gmail contacts with same name but different contact numbers, different emails....etc, but Contacts assume they are same person and merge them as one!

    FG,
    In Lion, you have the File > Duplicate option. You will then have two copies of your document open, and the one on top will have the temporary filename "OriginalFileName copy", and your next responsibility is to File > Save (or Command-S) and rename the duplicate. At this point, you edit the copy's name, to perhaps ...copy 1, or whatever you wish. The document you had open when you initiated the File > Duplicate will still be there on your screen, waiting for you to Close it or continue editing.
    Jerry

  • HT5622 Good day!! I was having two Iphones with same icloud id, later i deleted 1 id from one device, and made 2nd id for this device but same time my old id is stored on other device and i can not change it with another id, can any1 guide me on this issu

    Good day!! I was having two Iphones with same icloud id, later i deleted 1 id from one device, and made 2nd id for this device but same time my old id is stored on other device and i can not change it with another id, can any1 guide me on this issue.

    Log in to icloud.com on a web browser and remove the device from "Find My iPhone"

  • HT4910 Have two phones with same apple id as I got one for my hubbie .he tried to back up his numbers in I cloud . Our contacts have now merged and neither can delete from our phone without it coming off the other . Any ideas how we can stop this

    Have two iPhones with the same id as I got hubbie one in week and when I got it they asked for email address so I gave the one we use, so when my husband started phone up he just put my password in. When he tried to back his numbers on iCloud they all appeared on my phone and now I can't delete his numbers without them deleting on his phone as well . Any help would be appreciated.

    You'll have to migrate one of the phones to a different account, then delete the other person's data from each account (you can continue to share the same Apple ID for purchasing from the iTunes and app stores). 
    Decide which iPhone will be keeping the current iCloud account.  On the one that will be changing accounts, if you have any photos in photo stream that are not in your camera roll or backed up somewhere else save these to your camera roll by opening the photo stream album in the thumbnail view, tapping Edit, then tap all the photos you want to save, tap Share and tap Save to Camera Roll. 
    Once this is done, go to Settings>iCloud, scroll to the bottom and tap Delete Account.  (This will only delete the account from this phone, not from iCloud.  The phone that will be keeping the account will not be effected by this.)  When prompted about what to do with the iCloud data, be sure to select Keep On My iPhone.  Next, set up a new iCloud account using a different Apple ID (if you don't have one, tap Get a Free Apple ID at the bottom).  Then turn iCloud data syncing for contacts, etc. back to On, and when prompted about merging with iCloud, choose Merge.  This will upload the data to the new account.
    Finally, go to icloud.com on your computer and sign into each iCloud account separately and manually delete the data you don't from each account.

  • Can two iPhones with same name sync with iTunes?

    I've just got a new iPhone 4 and immediately synced it with iTunes, transferring all the data from my old 3Gs including the phone name. This means that I now have two iPhones with the same name(3Gs and 4). What are my chances of keeping my 3Gs as a back-up phone that's still able to sync with my iPhone account or will I have to change to phone's name and install apps from scratch? I'd really appreciate any advice from the experts on this.

    You need to rename one of them. I would suggest that you backup and sync each device after the renaming.

  • Two instance with same port number in one machine.

    How can I config one machine(one IP) to listen to two different URLs with same port? (http://www.abc.com & http://www.xyz.com)??

    What you are looking for is a feature called virtual servers. Lots of information in Chapter 13 of the admin guide.
    The key is that there is only one server instance. (One available port pretty much implies one server instance.) But the virtual server feature allows you to specifiy different "virtual" servers based on the URL characteristics. (such as domain name)

  • Regarding joining of two tables with same feilds

    hello gurus
    i am new to abap programming. i have to extract data from two tables ie coss and cosp tables . one table has 180 records and another table has 500 records i want to extract these two table records into internal table(680 records) and then i have to populate it to flatfile through gui download. can any one give me use code to work on it.these two tables has same set of feilds.

    Hi,
    First you should verify if you want to get all the data from both tables regardless if its the same record. If it is, then you can follow this logic:
    select * from coss into table it_coss_cosp. "step 1
    select * from cosp appending table it_coss_cosp. "step 2
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                  =
        filename                      = data.txt
      FILETYPE                      = 'ASC'
      APPEND                        = ' '
      WRITE_FIELD_SEPARATOR         = ' '
      HEADER                        = '00'
      TRUNC_TRAILING_BLANKS         = ' '
      WRITE_LF                      = 'X'
      COL_SELECT                    = ' '
      COL_SELECT_MASK               = ' '
      DAT_MODE                      = ' '
    IMPORTING
      FILELENGTH                    =
      tables
        data_tab                      = it_coss_cosp
    EXCEPTIONS
      FILE_WRITE_ERROR              = 1
      NO_BATCH                      = 2
      GUI_REFUSE_FILETRANSFER       = 3
      INVALID_TYPE                  = 4
      NO_AUTHORITY                  = 5
      UNKNOWN_ERROR                 = 6
      HEADER_NOT_ALLOWED            = 7
      SEPARATOR_NOT_ALLOWED         = 8
      FILESIZE_NOT_ALLOWED          = 9
      HEADER_TOO_LONG               = 10
      DP_ERROR_CREATE               = 11
      DP_ERROR_SEND                 = 12
      DP_ERROR_WRITE                = 13
      UNKNOWN_DP_ERROR              = 14
      ACCESS_DENIED                 = 15
      DP_OUT_OF_MEMORY              = 16
      DISK_FULL                     = 17
      DP_TIMEOUT                    = 18
      FILE_NOT_FOUND                = 19
      DATAPROVIDER_EXCEPTION        = 20
      CONTROL_FLUSH_ERROR           = 21
      OTHERS                        = 22
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    But if you plan to get those record which exists in both tables then use a join condition for your select statement.
    Hope this helps...
    P.S. Please award points for useful answers.

Maybe you are looking for

  • How do I get my calendar to sync to my computer?

    I just updated the new operating system and not only did I lose my calendar on my computer, but everything doubled in my calendar on my iphone. My notes also disappeared, but I retrieved them via mail time machine!

  • Mac Pro 3,1 (early 2008) RAID card hangs at startup

    Hello, I have a Mac Pro 2.8Ghz Quad Core (early 2008) with 10GB RAM and 512MB VRAM. I have noticed that the Mac Pro RAID card hangs at startup for RAID volumes.  It seems to start okay with a single boot drive (have used both WD Raptor 150GB 10K and

  • How to get full package path?

    Hi all. My program consists of 2 files: 1.) run.exe 2.) classes.zip The second (.zip) file contains java classes. How can I gain a full path to any package in this .zip file? I tried MyClass.class.getPackage().getName() but it returned only somethig

  • 10.2.0.3 Patch for solaris SPARC

    Hi All, We have 10.2.0.1 database running on Solaris Sparc.We are planning to upgrade to 10.2.0.3 directly instead of upgrading to 10.2.0.2 Do we have the patch 10.2.0.3 ready to dowload from the metalink.. If so please give me the patch number.. Tha

  • Krusader - audacious: no drag and drop

    Hello, since a few days I'm using krusader as my favorite filemanager on my XFCE4 desktop. The overwhelming majority of my used software is GTK-based, but krusader is really hard to beat Now I have tried to insert some MP3 files from krusader to auda