Regarding dispatch action in struts

how to create dispatch action uring button in struts.

Have a hidden attribute named "method" in the Form and hardcode it with the method name which you need to post to...
Rest is all same like regular Action...
Thanks and regards,
Pazhanikanthan. P

Similar Messages

  • Dispatch action in struts portlet

    Hi ,
    I am tryin g to call a Action which extends dispatchaction with two parameters in the query string . The version is (pdk 10.1.2.0.2)
    The values are appended in the query string but the error message in log seems to be the "actionCmd" calue is not passed to invoke the action.
    <jsp:useBean id="params" scope="session" class="java.util.HashMap"/>
    <c:set target="${params}" property="actionCmd" value="seminarDetails"/>
    <c:set target="${params}" property="Menu" value="customer"/>
    <pdk-struts-html:link action="/seminarDetails" name="params" ></pdk-struts-html:link>
    ERROR: AbstractResourceRenderer.renderBody - Resource
    "/seminarDetails.mcs;jsessionid=0ad16e5530d74f3fe75da106493cbb4dd7fbc0bb634d.e34RahmKa3mRay0Lc3aKbhiLbxaKe6fznA5Pp7ftolbGmkTy?Menu=customer&'amp;actionCmd=seminarDetails"
    returned HTTP Status: 400. Error message: Request[seminarDetails] does not contain handler parameter named actionCmd. Content returned
    follows....
    What am i doing wrong?
    Thanks
    Prem

    Still I am having the same issue. Any clues?

  • How to call another action from Struts dispatch action?

    Hi all,
    there is a method in dispatch action that needs data from another chained action. How should other action determine which method in dispatch action will receive response and how should these data be returned from called action? Called action does not have associated form bean
    thanks,

    Not sure, why are there then "chained actions" is struts practice? Struts allows action without form bean to be configured and the action is a class?

  • Dispatch Action

    Hi how to use DispatchAction in struts

    Hi,
    Whenever working with dispatch action, while specifying its button name or link name specify an attribute called "property", give some logical name for this attribute and in struts-config.xml, the same attribute with logical name should be used. so when ever u send multiple requests with in a same page , it gets processed, do not forget to implement ur methods with same execute() signature.

  • In Web Logic Server Due to HTML file tag the action of struts is not called

    Hi All
    I have a problem as under:-
    There is a HTML page which contains several fields including a file input tag of HTML and i write enctype = "multipart/form-data" in the form tag
    I am calling a struts Action from this form, then it is not reaching to that action of struts.
    If I remove this file tag and enctype = "multipart/form-data" then it reaches to the struts action.
    I am facing this problem in Weblogic server 8.1 but i can easily deploy this same code on Tomcat 5.0
    Please help me out from this problem..
    Thanks...
    Nitin Saxena

    My installation has a DefaultWebApp directory under mydomain/applications,
              try moving everything down there. (I'm on 6.1 but I think 6.0 is the same)
              Eliot Stock
              eliot [ at ] carbonfive [ dot ] com
              http://carbonfive.com
              "Ram" <[email protected]> wrote in message
              news:3bc71641$[email protected]..
              >
              > Hi,
              >
              > I am trying to deploy a simple servlet in WebLogic Server.
              > I have done the following steps.
              >
              > 1) Compiled the MyWorld.Java Servlet Successfully in c:test\ Directory..
              >
              > 2) Created WEB-INF/Classes Directory in the home Directory of
              WebApplication Directory..
              > C:\bea\wlserver6.0\config\mydomain\applications\
              > 3) Copied the Class file into the WebApplication Directory i.e
              >
              > C:\bea\wlserver6.0\config\mydomain\applications\WEB-INF/Classes
              >
              > 4) Executed in the Browser using following URL:
              > http://127.0.0.1:7001/MyWorld
              >
              > But, I am getting this error:
              >
              > Error 404--Not Found
              >
              > Please let me know if the above procedure is wrong, then what are the
              exact steps
              > involved in Deploying a servlet in WebLogic Server.
              >
              > Thanks,
              > Ram.
              >
              

  • What is a global Action in Struts?

    What is a global Action in Struts?
    if any body have any idea about it then plz tell me ab this...
    Thanx

    well some one ask me this question in an Interview?
    what is the difference between Global Action anc Global Forward?
    nither i heard ab Global Action ...nor i use it...so i told him a do not have any info ab it...

  • Struts input forward using dispatch action

    I have a insert jsp and another update jsp but one action with the dispatch concept named daction.In case of errors i forward using input forward(), but in config file i have can specify only one path in
    <action input ="/insert.jsp"/>
    but in case for the update error to pass to update.jsp how to handle...........

    request.getRequestDispatcher("reqresAction.action").forward(request, response);It's right.
    But I believe you forgot about a tag like <dispatcher>FORWARD</dispatcher> in your <filter-mapping>(web.xml).
    I use a rediration from servlet to action and it works fine.

  • Passing value from JSP to Action in Struts

    Hi,
    I am populating JSP page with rows retrieved from the database and
    represented as a List of Beans in forEach loop:
    <c:forEach var="list" items="${OperationsForm.OperationsList}">
    <c:choose>
    <c:when test="${list.isCompleted =='Y'}" >
    <td width="100">Completed</td>
    <td width="100"> </td>
    </c:when>
    <c:otherwise>
    <td width="100">Pending</td>
    <td width="100"><input type="image" onclick="
    rowId=value; form.action='action.do?command=notify'"
    value="${list.OperationId}" />
    </td>
    </c:otherwise>
    </c:choose>
    </tr>
    </c:forEach>
    Have hidden field: html:hidden property="rowId" value="-1"/>
    User is clicking the button corresponding to one of the rows
    and I need to pass the value of that rowId to the Action class, so it does
    something in the database [action completed]
    Now how do I pass it , is that the right way of doing it with calling
    request.getSession().getAttribute(rowId) in the Action class ?
    As of now I am getting Javascript error "Object doesn't support this
    property or method", complaining about rowId=value;
    Using Struts 1.3
    Please help !
    TIA,
    Oleg.

    So what you are saying is that I should add rowId here:
    <input type="image" onclick="form.action='action.do?command=notify&rowId='
    ${list.OperationId}"/> , correct ?
    I am not sure that it will work, especially with Struts tag.
    I will probably try something like:
    <html:submit onclick="form.action='action.do?command=notify'" value="${list.OperationId}">
    I am relatively new to Struts, so now sure what will work or not and how to do it better. How do I catch the submitted value in the Action in either of these 2 cases, via action.getSession().getProperty("rowId") /
    action.getSession().getProperty("submit") ?
    I would probably do it as a URL rather than changing the action of the form.I will have to create a new action anyway to process that row [which is sending user e-mail regarding that row data/event].
    Is the id the only thing you have to pass in?
    Or do you need other values from the screen?Selected rowId is probably the only thing I care about, can access values from the Form in Action.
    Thank you,
    Oleg.

  • Query regarding Declarative exceptions in struts

    Hi all,
    I am using decalartive exceptions in struts,
    My struts-config.xml is as follows -
    <action
    path="/tryexception"
    <exception
    type="hansen.playground.MyException1"
    key ="errors.exception1"
    handler="hansen.playground.MyHandler"
    path="/error.jsp"/>
    </action>
    Currently i am displaying the error message in my error.jsp page by getting the value from the session.
    The code is as follows -
    <%@ page language="java" %>
    <%@ page import="java.util.*" %>
    <%@ page import="java.io.*" %>
    <%@ page import="org.apache.struts.*" %>
    <%
    Enumeration paramNames = request.getAttributeNames();
    while (paramNames.hasMoreElements()) {
    String name = (String) paramNames.nextElement();
         if (name.equals("errorMessage")){
              Object values = request.getAttribute(name);
              out.println("<br> " + name + ":" + values);
    %>
    This works fine and the error message is diplayed.
    My question is there any other way to display the error message in the jsp page without getting it from the session.
    Any suggestions will be appreciated
    Thanks,

    You could simply POST the data as opposed to using GET. Though it doesn't encode/ encrypt the data, but simply adds the parameters into the body of the request. If someone were to look at your requests, they'd be able to see this data.
    As for actually hiding it through encryption, you could get JavaScript libraries to do this on form submit but I doubt you'd need that much security. You could also try base64 encoding for a simpler approach.
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    (Yes I know it's on JavaRanch but I think it applies everywhere)
    ----------------------------------------------------------------

  • Regarding Connection Pooling in Struts

    Hi All,
    I m using Struts for my web application. Now I want to use the Connection Pooling for my applicaiton.
    I m using JBoss, and Oracle 10gXE.
    My question are :
    1. Do I need to use Oracle Specific Connection Pooling or commons DBCP & Pool.
    2. Do I need to JNDI to bind my data source using mydatasource.xml in deploy folder of JBoss or
    define the datasource in struts-config.xml of my application.
    Which will be the efficient way?
    Presently I m defining my datasource in struts-config.xml. like :
    <data-sources>
           <data-source type="org.apache.commons.dbcp.BasicDataSource" key="msgds">
              <set-property property="description" value="OracleXE Data Source" />
              <set-property property="driverClassName" value="oracle.jdbc.OracleDriver" />
              <set-property property="url" value="jdbc:oracle:thin:@192.168.1.8:1521:XE" />
              <set-property property="minCount" value="2" />
              <set-property property="maxCount" value="50" />
              <set-property property="maxWait" value="5000" />
              <set-property property="username" value="ashish" />
              <set-property property="password" value="ashish" />
              <set-property property="autoCommit" value="true" />
              <set-property property="readOnly" value="false" />          
         </data-source>
    </data-sources>  
    3. How can i change it to an mydatasource.xml for JNDI. If is it like this,what is the error:
         <datasources>
           <local-tx-datasource>
             <jndi-name>msgds</jndi-name>
             <connection-url>jdbc:oracle:thin:@192.168.1.8:1521/XE</connection-url>
             <driver-class>oracle.jdbc.OracleDriver</driver-class>   
             <user-name>ashish</user-name>
              <password>ashish</password>
             <min-pool-size>5</min-pool-size>
             <max-pool-size>100</max-pool-size> 
           </local-tx-datasource>
         </datasources>Please if somebody have idea of it, plz help. If U have code for this plz send it to me.
    If u don't want to publish you can send it to my email id: [email protected].

    Just make sure all the JARS are in the classpath. BTW I use Iplanet but does that matter much ? Configure the Struts-config file for the datasource by adding the below tag text.
    <data-sources>
         <data-source type="org.apache.commons.dbcp.BasicDataSource" key="DBSTR">
              <set-property property="description" value="OracleXE Data Source" />
              <set-property property="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
              <set-property property="url" value="jdbc:oracle:thin:@155.136.118.169:1521:DBSID" />
              <set-property property="minCount" value="2" />
              <set-property property="maxCount" value="10" />
              <set-property property="maxWait" value="10000" />
              <set-property property="username" value="USER" />
              <set-property property="password" value="PASSWORD" />
              <set-property property="autoCommit" value="false" />
              <set-property property="readOnly" value="false" />          
         </data-source>
    and then access from your action or servlet by executing the below java code.
    dataSource = getDataSource(request,"DBSTR");
    conn = dataSource.getConnection();
    stmt = conn.createStatement();
    rs = stmt.executeQuery("select object_name from user_objects");
    while ( rs.next() ) {
    tmp = tmp + ": " + rs.getString("object_name");
    Piece of cake.

  • BUG? Data Action on Struts changing to Data page when i reload Jdev????

    Hi All,
    i'm using jdev 10.1.2, adf bc's, struts, jsp's.
    I have a data action on my struts page which is bound to a method in the app module. I created a class for this data action which overrides the initialMethodParameters() method and gets the arguments for the method in the app module.
    it all works perfectly fine, until i come into work the next day, load up JDev and the data action has now turned into a data page. if i dbl click on it i get the create page dialog, instead of the data action class. obviously when i try run this data action, i get cannot display this page error.
    I'm assuming/hoping that this is a bug. can anyone shed any light??
    Thanks in advance,
    Liz

    Hi,
    did you open this in the same version of JDeveloper 10.1.2? I remember that there was a change in Struts between JDeveloper versions
    Frank

  • Servlet and Actions - Apache Struts !

    Hi,
    i defined an ActionServlet in the web.xml and some "Actions" in the struts-config.xml.
    If all the requests are managed by the servlet defined in the web.xml, in case i had a lot of requests would it be better defined more ActionServlet in the web.xml which refers to different struts-config.xml ?
    I think that having more servlet is much better to manage the load of the entire application.
    Any suggestions ?
    Cheers.
    Stefano

    No need creating more than one ActionServlet : Servlets are Threads so each request made by a client is handled by a different Thread!

  • Regarding database access in Struts

    Hi All,
    My problem-
    I am inserting a value in database(MS ACCESS) using struts frame work.for the first time when i am executing the program the value is inserted but then again when i executed that program no insertion happens but it gives no error or exception. can u say what may be the problem for it?

    Are you using validation framework in struts. I think your application properties file is missing

  • Regarding file upload in struts

    how can i save file in give location in struts.when i am using in <forward> tag it is opening in the given path that is file name but i want to save the file in the given location

    Hi Ravindranath,
    I tried it again. It worked for me. Check your GUI_UPLOAD parameters.
    Here is my code.
    data: begin of record occurs 0,
    * data element: MATNR
            MATNR_001(018),
    *other fields
          end of record.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = 'D:datatestnew.txt'
       HAS_FIELD_SEPARATOR           = 'X'
      TABLES
        DATA_TAB                      = record
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_READ_ERROR               = 2
       NO_BATCH                      = 3
       GUI_REFUSE_FILETRANSFER       = 4
       INVALID_TYPE                  = 5
       NO_AUTHORITY                  = 6
       UNKNOWN_ERROR                 = 7
       BAD_DATA_FORMAT               = 8
       HEADER_NOT_ALLOWED            = 9
       SEPARATOR_NOT_ALLOWED         = 10
       HEADER_TOO_LONG               = 11
       UNKNOWN_DP_ERROR              = 12
       ACCESS_DENIED                 = 13
       DP_OUT_OF_MEMORY              = 14
       DISK_FULL                     = 15
       DP_TIMEOUT                    = 16
       OTHERS                        = 17

  • Regarding google map with struts

    Hi,
    Iam developing small application for connecting to google map by using struts and hibernate,Am taking two parameters country and location by using these two parameters how can i connect to google map?

    What does a typical "location" look like? Is it an address? A town name? And I can assume country is a 2-digit ISO code for a country?
    You could try something as basic as:
    URL url = new URL("http://maps.google.com/maps?q=" + location + ",+" + country);
    and see if that works.

Maybe you are looking for

  • Invoking a web service via proxy

    Hi, I have requirement to invoke a web service protected by basic http authentication. I have generated a jax-ws proxy, the proxy makes a local copy of the wsdl. And I use the following code to invoke it: lDAPUserAdminService = new LDAPUserAdminServi

  • Audio tracks are lost after importing from iMovie...

    After importing my movie from iMovie I lost my audio tracks. What is the problem ?

  • IPhoto books- Delete text boxes?

    For several pages in an iPhoto book I am making, I do not want any text or descriptions. However, there are empty text boxes whose outlines are still showing up. I don't want the pages to print with the text box outlines. There is nothing typed in th

  • Alternative option to updating the services file on the local computer

    Hi, Our project needs to add updates to the file C:\windows\system32\drivers\etc\services in order to allow excel reports to work from the SAP enterprise portal. The client will need to apply this change in the services file to all the desktop comput

  • Itunes help needed

    I redeemed a $50 itunes a month or more  ago and i cant seem to find out my balance number because i brought two songs. But i was cleaning my room out and i threw away my ituens gift cards because i had all ready redeemed them. HELP ME PLEASE