NoSuchMethodException in Struts using DispatchAction

Hi,
I have wriiten a sample code using the DispatchAction Class(Subclass name is UserDispatchAction)
It has 3 methods funct_save() ,funct_remove(), funct_delete() however whenever i give a call the funct_remove it gets invoked but the rest two doesn't. Can any body help me to sort out this problem. The following is the code for UserDispatchAction Class
package StrutsApp;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.actions.DispatchAction;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForward;
import java.io.IOException;
import javax.servlet.ServletException;
public class UserDispatchAction extends DispatchAction
     public UserDispatchAction(){}
     public ActionForward funct_save(ActionMapping mapping, ActionForm form,HttpServletRequest req,HttpServletRequest res) throws IOException,ServletException
          return mapping.findForward("save");
     public ActionForward funct_remove(ActionMapping mapping,ActionForm form,HttpServletRequest req, HttpServletResponse res ) throws IOException, ServletException
          return mapping.findForward("remove");
     public ActionForward funct_delete(ActionMapping mapping, ActionForm form,HttpServletRequest req,HttpServletRequest res) throws IOException,ServletException
          return mapping.findForward("delete");
}The following is the struts-config.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
<form-beans>
     <form-bean name="lookupform" type="StrutsApp.LookUpForm" />
     <form-bean name="tmpForm" type="StrutsApp.tmpForm" />
</form-beans>
<global-forwards>
     <forward name="home" path="/home.do" />
</global-forwards>
<action-mappings>
     <action path="/Lookup" name="lookupform" type="StrutsApp.LookUpAction">
          <forward name="success" path="/success.jsp" />
          <forward name="failed" path="/index.jsp" />
     </action>     
     <action path="/home" forward="/success.jsp" />
     <action path="/Edit"
          type="StrutsApp.UserDispatchAction"
          input="/index.jsp"
          parameter="trial"
          name="tmpForm"
          scope="request"
          validate="true">
          <forward name="remove" path="/remove.jsp" />
          <forward name="save" path="/save.jsp" />
     </action>     
</action-mappings>
</struts-config>The following is the JSP that invokes the ActionServlet
<%@ page language="Java"%>
<%@ taglib uri="StrutsTagLib" prefix="Strut" %>
<html>
     <body>
          <Strut:form method="post" action="/Edit.do">          
               <Strut:select property="trial" size="3">
                    <Strut:option value="funct_save">Save</Strut:option>
                    <Strut:option value="funct_remove">Remove</Strut:option>
                    <Strut:option value="funct_delete">Delete</Strut:option>
               </Strut:select>
               <Strut:submit/><Strut:cancel/>
          </Strut:form>
     </body>
</html>
Following is the web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
<web-app>
<servlet>
     <servlet-name>action</servlet-name>
     <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
     <init-param>
          <param-name>config</param-name>
          <param-value>/WEB-INF/struts-config.xml</param-value>
     </init-param>     
     <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
     <servlet-name>action</servlet-name>
     <url-pattern>*.do</url-pattern>
</servlet-mapping>
<taglib>
     <taglib-uri>StrutsTagLib</taglib-uri>
     <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
</web-app>
Regards
Clefies R Dsouza

Duplicate post:
problem on struts using jdeveloper 10.1.2
user583549,
I see you got an answer from Shay in the other post.
Good Luck,
Avi.

Similar Messages

  • Error occured while using DispatchAction Class

    I have a jsp file which has three submit buttons, with same name.
    If i click one of those buttons, it should execute a corresponding method from a class that extends the DispatchAction class.
    But when i click it throws method not found.
    The exact errors are
    error 1-->
    57d5900b DispatchActio E org.apache.struts.actions.DispatchAction Action[dispatchtest] does not contain method named execute1
    error 2-->
    57d5900b DispatchActio E org.apache.struts.actions.DispatchAction TRAS0014I: The following exception was logged java.lang.NoSuchMethodException: DispachActionTestClass.execute1(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
    wat could be possibly the mistake.

    This shuold be the first check:
    You shoud be having three different methods for three different actions in the class which extends dispatchAction.
    Something like this:
    Submit1 -- ActionMapping1 -- DispatchActionClass --> Execute1()
    Submit2 -- ActionMapping2 -- DispatchActionClass --> Execute2()
    Submit3 -- ActionMapping3 -- DispatchActionClass --> Execute3()
    Let me know if this does not help

  • Problem in struts using JDeveloper10.1.2

    hi
    Iam completly new to jdeveloper
    Iam using jdev 10.1.2 for my simple struts application
    I have
    action class -- LoginAction
    form bean -- login (using DynaActionForm)
    login.jsp to enter username
    success.jsp for welcom msg
    failure.jsp --- in this i use one submit btn when i press this it will go to login.jsp for relogin
    <form action="/login.jsp">....
    the problem is
    In LoginAction
    String password=(String)((DynaActionForm)form).get("password");
    // String pwd =request.getParameter("username");
    if(password.equalsIgnoreCase("oracle"))
    return mapping.findForward("success");
    else
    return mapping.findForward("failure");
    iam import all the class for the respective reff variables.
    But it will indicate err underline(blue) under text which are in bold saying msgs as
    --method get(java.lang.string) not found in org.apache.struts.action.DynaActionform
    the samething for remaining two showing on ActionMapping
    plese tell me where is the problem
    running on Embedded OC4J SERVER
    error message is
    http://hostname:8988/hello_struts1-ViewController-context-root/login.do
    07/07/19 17:12:31 Oracle Application Server Containers for J2EE 10g (10.1.2.0.2) initialized
    Jul 19, 2007 5:12:32 PM org.apache.struts.util.PropertyMessageResources <init>
    INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
    Jul 19, 2007 5:12:32 PM org.apache.struts.util.PropertyMessageResources <init>
    INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true
    Jul 19, 2007 5:12:32 PM org.apache.struts.util.PropertyMessageResources <init>
    INFO: Initializing, config='view.ApplicationResources', returnNull=true
    Jul 19, 2007 5:12:32 PM org.apache.struts.action.RequestProcessor processException
    WARNING: Unhandled Exception thrown: class java.lang.NullPointerException
    thanks

    Duplicate post:
    problem on struts using jdeveloper 10.1.2
    user583549,
    I see you got an answer from Shay in the other post.
    Good Luck,
    Avi.

  • Passing values to action form in struts using html:link tag in struts

    hi
    As we can post values to action form bean in struts using a <html:text> tag in side a form.
    Can the same be achieved by using a html:link attribute.
    If not then how can this be achieved (i.e. posting a form on click of a link and populating action form bean property for the same).
    thanx in advance.

    Crosspost:
    http://forum.java.sun.com/thread.jspa?threadID=5244035&tstart=0

  • How to embedded css in Struts using JBuilder 8

    Hi everyone,
    I have a serious problem in my GUI. Currently i am doin a web portal using struts,Enterprise JavaBean(EJB).
    The softwares i am using are Jbuilder 8 and Dreamweaver MX.
    The interface of my portal is coded in html with css involved.The problem is that once i converted my html coding into struts format using JBuilder 8, the css cannot be read in the struts.(For example, my font size,color,border is the what i have defined in css)
    I have try to covert the html coding into 3.0 Browser compatible using dreamweaver MX. Although it is able to display some of the things that is specified in the CSS,
    but some tags are still lost.
    I will like to know if there is any method,steps or tag that i should take note in my coding so that i can embedded my CSS into my struts using JBuilder 8 without affecting my form color,aligments,size type,etc...
    Regards,
    Jong Hann

    Hi bidris2003,
    i have try the 2 different set of coding.The result is still the same. It doesn't read into the css thing. I have create a folder called css in WebPortal folder. The rest of my jsp pages are in WebPortal folder.
    Example:(1) my jsp page contain in side the WebPortal folder.
    C:\Documents and Settings\u\Desktop\GamePortal(with css)\WebPortal
    (2) My css contain in css folder
    C:\Documents and Settings\u\Desktop\GamePortal(with css\WebPortal\css
    Example code 1:
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <html:html locale="true">
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link rel="stylesheet" href="layout.css" type="text/css">
    <html:base/>
    </head>
    <body bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="0" rightmargin="0">
    <table width="100%" border="0" cellspacing="0" height="49" cellpadding="0">
    <tr>
    <td rowspan="2" width="224" height="49" align="left" background="Images/headerbg2.jpg"><html:img width="224" height="49" src="Images/header.jpg"/></td>
    <td height="27" background="Images/headerbg1.jpg">�</td>
    <td width="250" height="27" background="Images/headerbg1.jpg" styleClass="headertext" valign="bottom">
         <html:link href="lostpassword.jsp" target="main">Lost
    password</html:link> :: <html:link href="signup.jsp" target="main" style="text-decoration:none;">Join</html:link></td>
    <td width="9" height="49" rowspan="2" align="right">
    <div align="right"><html:img width="9" height="49" src="Images/header2.jpg"/></div></td>
    </tr>
    <html:form action="/loginAction">
    <tr>
    <td height="22" background="Images/headerbg2.jpg">�</td>
    <td width="250" height="22" background="Images/headerbg2.jpg" valign="middle">
         <div align="right" styleClass="formtext" style="color:#FFFFFF"> Nick:
    <html:text property="nick" styleClass="input"/>
    Password:
    <html:password property="password" styleClass="input"/>
    <html:submit value="Go" property="Submit" styleClass="submit"/>
         </div>
    </td>
    </tr>
    </html:form>
    </table>
    </body>
    </html:html>
    Example code 2:
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <html:html locale="true">
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <html:base/>
    <LINK rel="stylesheet" type="text/css"
    ref="<html:rewrite page='/css/layout.css'/>">
    </head>
    <body bgcolor="#FFFFFF" text="#000000" topmargin="0" leftmargin="0" rightmargin="0">
    <table width="100%" border="0" cellspacing="0" height="49" cellpadding="0">
    <tr>
    <td rowspan="2" width="224" height="49" align="left" background="Images/headerbg2.jpg"><html:img width="224" height="49" src="Images/header.jpg"/></td>
    <td height="27" background="Images/headerbg1.jpg">�</td>
    <td width="250" height="27" background="Images/headerbg1.jpg" class="headertext" valign="bottom">
         <html:link href="lostpassword.jsp" target="main">Lost
    password</html:link> :: <html:link href="signup.jsp" target="main" style="text-decoration:none;">Join</html:link></td>
    <td width="9" height="49" rowspan="2" align="right">
    <div align="right"><html:img width="9" height="49" src="Images/header2.jpg"/></div></td>
    </tr>
    <html:form action="/loginAction">
    <tr>
    <td height="22" background="Images/headerbg2.jpg">�</td>
    <td width="250" height="22" background="Images/headerbg2.jpg" valign="middle">
         <div align="right" class="formtext" style="color:#FFFFFF"> Nick:
    <html:text property="nick" styleClass="input"/>
    Password:
    <html:password property="password" styleClass="input"/>
    <html:submit value="Go" property="Submit" styleClass="submit"/>
         </div>
    </td>
    </tr>
    </html:form>
    </table>
    </body>
    </html:html>
    CSS code inside the CSS folder:
    font { font-family: Verdana, Arial, Helvetica, san-serif; font-size:9px;}
    body {
                   background-color: #FFFFFF;
                   text-align: left;
                   font-family: Verdana, Arial, Helvetica, san-serif;
                   font-size:9px; font-weight:normal;
                   padding:0;
                   scrollbar-face-color:#FFFFFF;
                   scrollbar-shadow-color:#AAAAAA;
                   scrollbar-highlight-color:#AAAAAA;
                   scrollbar-3dlight-color:#e5e4e4;
                   scrollbar-track-color:white;
                   scrollbar-arrow-color:#7f7f7f;
    A { text-decoration: none;
         font-family:verdana, arial, helvetica, sans-serif;
         color:#5B5B5B;}
    A:hover { color:#939393;}
    A:active { color:#939393;}
    A:link {color:#5B5B5B;}
    A:vlink {color:#000000;}
    .box {
                   border-right: 1px solid #7F7F7F;
                   border-top: 1px solid #7F7F7F;
                   border-left: 1px solid #7F7F7F;
                   border-bottom: 1px solid #7F7F7F;
                   text-align:left;
                   font-family: Verdana, Arial, Helvetica, san-serif;
                   font-size:10px; font-weight:normal;
                   color: #666666;}
    .boxdashed {
                   border-right: 1px dashed #7F7F7F;
                   border-top: 1px dashed #7F7F7F;
                   border-left: 1px dashed #7F7F7F;
                   border-bottom: 1px dashed #7F7F7F;
                   text-align:left;
                   font-family: Verdana, Arial, Helvetica, san-serif;
                   font-size:10px; font-weight:normal;
                   color: #666666;}
    .description {
                   text-align:left;
                   font-family: Verdana, Arial, Helvetica, san-serif;
                   font-size:9px; font-weight:normal;
                   color: #666666;}
    .details {
                   text-align:right;
                   font-family: Verdana, Arial, Helvetica, san-serif;
                   font-size:11px; font-weight:900; vertical-align:bottom;
                   color: #666666;}
    .formtext {
                   font-family: Verdana, Arial, Helvetica, san-serif;
                   font-size:8px; font-weight:900;
    .forum {
                   font-family: Verdana, Arial, Helvetica, san-serif;
                   font-size:10px; font-color:#5B5B5B;
    .forumtext {
                   background-color:#FFFFFF;
                   font-family: Verdana, Arial, Helvetica, san-serif;
                   font-size:12px;vertical-align:top; padding:0;
                   A { text-decoration: none;
                        font-family:verdana, arial, helvetica, sans-serif;
                        A:hover { color:#939393;}
                        A:active { color:#939393;}
                        A:link {color:#5B5B5B; text-decoration:none;}
                        A:vlink {color:#000000; text-decoration:none;}
    .forumtext2 {
                   background-color:#EEEEEE;
                   font-family: Verdana, Arial, Helvetica, san-serif;
                   font-size:10px; vertical-align:middle; padding:0;
    .forumheader {
                   font-family: Verdana, Arial, Helvetica, san-serif;
                   font-size:10px; font-weight:900; color:white;
                   height:20px; text-align: center;
    .forumheader2 {
                   font-family: Verdana, Arial, Helvetica, san-serif;
                   font-size:10px; font-weight:normal; color:white;
                   height:20px; text-align: center;
    .headertext {
                   text-align:right;
                   font-family: Verdana, Arial, Helvetica, san-serif;
                   font-size:9px; font-weight: bold;
                   color: #FF0099;
                   text-decoration: none
    .headertext2 {
                   text-align:left;
                   font-family: Verdana, Arial, Helvetica, san-serif;
                   font-size:10px; font-weight: bold;
                   color: #5B5B5B;
                   text-decoration: none
    .input {
                   border: 1px solid #5B5B5B;
                   width: 53px;
                   height: 12px;
                   color: #FF0099;
                   font-family: Verdana, Arial, Helvetica, sans-serif;
                   font-size: 9px;
                   text-align: left; line-height: 11px;
                   padding: 0px;
    .input2 {
                   border: 1px solid #FFFFFF;
                   border-bottom: 1px solid #7F7F7F;
                   border-right: 1px solid #7F7F7F;
                   border-top: 1px solid #7F7F7F;
                   border-left: 1px solid #7F7F7F;
                   width: 270px;
                   height: 18px;
                   background-color: #FFFFFF;
                   color: #7F7F7F;
                   font-family: Verdana, Arial, Helvetica, sans-serif;
                   font-size: 9px;
                   text-align: left;
                   padding: 0px;
                   overflow:auto;
    .submit {
                   border: 1px solid #FFFFFF;
                   border-bottom: 1px solid #7F7F7F;
                   border-right: 1px solid #7F7F7F;
                   border-top: 0px;
                   border-left: 0px;
                   width: 25px;
                   height: 15px;
                   background-color: #FFFFFF;
                   color: #7F7F7F;
                   font-family: Verdana, Arial, Helvetica, sans-serif;
                   font-size: 9px;
                   text-align: center;
                   padding: 0px;
    .updates {
                   text-align:left; border:1px solid #939393;
                   font-family: Verdana, Arial, Helvetica, san-serif;
                   font-size:10px; font-weight:normal;
                   color: #666666;
                   padding: 10px;}

  • Struts using DAO Design Pattern ..?Please give an example..... URGENT......

    Dear all,
    I have to develop an application in Struts by using DAO design pattern ..........
    Please give an example on Struts using DAO...................
    Thank you
    Please

    I'm glad you asked. It means Read The Flaming Manual. That'd be the struts manual by the way.

  • Struts using DAO Design Pattern Tutorail

    Can anybody give me a link for the Struts using DAO Design Pattern tutorial
    sample tutorial

    http://javaboutique.internet.com/tutorials/ApacheDAOs/
    Found by using google: strust dao pattern tutorial
    There are more good links using that search...

  • Any good site for learning struts using weblogic

    Hi all,
    Please tell me any good website for learning struts using weblogic. I mean how to creat page and deploy , run it .....
    Thanks in advance

    Hi,
    here is the link for RMI tutorial.
    http://java.sun.com/docs/books/tutorial/rmi/index.html

  • Multiple configuration files in one application in struts using jDeveloper

    I am using Jdeveloper 9.0.3 using this i tried to create two struts-config.xml file with different names and configured them in the web.xml files( struts 1.1 feature)
    as
    <init-param>
                   <param-name>config</param-name>
                   <param-value>/WEB-INF/struts-config.xml, /WEB-INF/struts-config-reg.xml</param-value>
              </init-param>
    but i am getting parsing error for this. Please tell me how it can be done in Jdeveloper

    I have been trying to do something similar, but I keep receiving the following exception:
    java.lang.NoSuchFieldError: appConfig
    at oracle.jbo.html.struts11.BC4JRequestProcessor.processContent(BC4JRequestProcessor.java:148)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:233)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
         at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    My web.xml looks like:
    <servlet>
    <servlet-name>bc4jaction</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
    <param-name>mapping</param-name>
    <param-value>oracle.jbo.html.struts11.BC4JActionMapping</param-value>
    </init-param>
    <init-param>
    <param-name>BC4JDefinition</param-name>
    <param-value>Struts</param-value>
    </init-param>
    <!--<init-param>-->
    <!-- <param-name>config</param-name>-->
    <!-- <param-value>/WEB-INF/struts-config-documentservices.xml</param-value>-->
    <!--</init-param>-->
    <init-param>
    <param-name>config</param-name>
    <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <init-param>
    <param-name>config/documentservices</param-name>
    <param-value>/WEB-INF/struts-config-documentservices.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>

  • Client side validation in struts using validation framework

    Hi ,
    am new to struts.....
    I want to validate a simple login page using struts validation framework...
    For that i created,
    login.jsp ( contains html:errors and html:javascript and onsubmit)
    LoginForm extends ValidatorForm
    LoginAction
    resource bundles
    validation.xml ( required, minlength and maxlength rules for both fields)
    struts-config.xml ( configured action mapping and form beans)
    whats my problem is....
    i will get error messages through server side validation...
    i cant able to get the error messages using javascript i.e alert messages.
    i seen the page resource in that all javascript functins are inserted.
    on seeing the javascript error console... it shows
    formName has no properties...............
    exactly at this line
    oRequired = eval('new ' + formName.value + '_required()'); //function validateRequired(form)

    Thanks for your valuable reply.....
    Ya of course what you said was correct....
    I got error messages while submitting the form without any value....
    error messages are displayed using the <html:errors/> tag (server side validation ).
    But it fails to show the alert messages for those errors ( client side validation).
    i inserted the <html:javascript formName="form bean name" /> tag in the bottom of my login jsp.....
    on seeing the error console, it shows formName has no properties.
    Could anybody help me to sort out this problem........

  • Java.lang.NoSuchMethodException encountered when using jar file

    Hi Friends
    I am getting this peculiar exception for some time now and not able to figure out why i get it.
    I searched the net but seem to not find any proper solution.
    Here is what i am trying to do. I am using Eclipse(Latest version) and jdk 1.6.
    I have a Java project in my workspace which was previously using Java code to perform DAO look up.
    Now i have got an executable .jar file which has this DAO look up code bundled in it and i just need to include it in my project ClassPath. I have done this now and my code compiles properly. Even Eclipse is able to recognize this code.
    When i try to run the code i am getting this java.lang.NoSuchMethodException: DAOClass.getValue(java.lang.string)L
    The getValue() is present in the DAOClass in the jar file but still i am getting this exception.
    I am not able to figure out what the issue is here.
    Can you please provide your suggestions about this issue. is there something i am missing out.
    Thanks
    vikeng21

    802944 wrote:
    Hi Friends
    I am getting this peculiar exception for some time now and not able to figure out why i get it.
    I searched the net but seem to not find any proper solution.
    Here is what i am trying to do. I am using Eclipse(Latest version) and jdk 1.6.
    I have a Java project in my workspace which was previously using Java code to perform DAO look up.
    Now i have got an executable .jar file which has this DAO look up code bundled in it and i just need to include it in my project ClassPath. Is the DAO code a jar, which you are attempting to put into another jar? Then there are very specific steps that you must take, outside of the code, to accomplish that.
    If the DAO code is not a jar then the following possibilities exist
    - You are not putting the code in the executable jar.
    - You are putting it in the executable jar incorrectly due to a path problem.

  • Struts - using html:image for link

    I would like to use an image for a link but I am not sure how to do this. Right now I'm using the <html:link> tag and using the action mapping. Can this be done using the <html:image> tag?
    Here's an example of what I'm currently doing.
    <html:link action="/homePage"><bean:message key="General.button.HomePage"/></html:link>I'm new at java and struts and could definitely use a little help.
    Thanks!
    bfrmbama

    yeah, <html:image> is a form submit button... in HTML, it's this:
    <input type="image" name="thename" src="thesrc" value="thevalue" />
    <html:link> has onmouseover and onmouseout attributes... so you just put the mouseover script stuff there.

  • BC4J with Struts using EditAction's create method.

    Hi,
    I am using BC4J with struts and using the EditAction and UpdateAction classes provided by BC4J.
    When i want to create a new row in the database the documentation asks me to call EditAction's create() method and then UpdateAction's execute() method to do it. But even when i just call UpdateAction's execute() method I am able to create a new row. So WHY should I call EditAction's create() method ?????

    EditAction's create() method is something you would call in the action before rendering the empty form for the user to fill in.
    It creates a row, and then marks the row as having STATUS_INITIALIZED using the Row.setNewRowState(Row.STATUS_INITIALIZED) call.
    By setting the row to STATUS_INITIALIZED, this makes BC4J "forget" that it's a new row that needs to be inserted. In effect, it makes that new row a throwaway row used only for the purpose of rendering the blank form. An important reason you would want to do things this way is to pickup entity-level default values in the attributes of the new row.
    For example, in the toy store demo, why is it that when you register as a new user the "Country" poplist defaults to "United States" ? (it's not the first entry in the list).
    The answer is that, since the EditAction (or in this case my custom subclass of that) creates the blank row, the fact that the "toystore.model.businessobjects.Account" entity object declares that its Country attribute has a default value of "US" makes the blank row created in the "toystore.model.dataaccess.Accounts" view object have a default value of "US", and that default value in the blank row causes the <jbo:InputSelect> tag that renders the poplist to mark the corresponding "United States" option in the list as currently selected (as it's the display string associated in the poplist with the value "US").

  • Problem on struts using jdeveloper 10.1.2

    hi
    Iam completly new to jdeveloper
    Iam using jdev 10.1.2 for my simple struts application
    I have
    action class -- LoginAction
    form bean -- login (using DynaActionForm)
    login.jsp to enter username
    success.jsp for welcom msg
    failure.jsp --- in this i use one submit btn when i press this it will go to login.jsp for relogin
    <form action="/login.jsp">....
    the problem is
    In LoginAction
    String password=(String)((DynaActionForm)form).get("password");
    // String pwd =request.getParameter("username");
    if(password.equalsIgnoreCase("oracle"))
    return mapping.findForward("success");
    else
    return mapping.findForward("failure");
    iam import all the class for the respective reff variables.
    But it will indicate err underline(blue) under text which are in bold saying msgs as
    --method get(java.lang.string) not found in org.apache.struts.action.DynaActionform
    the samething for remaining two showing on ActionMapping
    plese tell me where is the problem
    running on Embedded OC4J SERVER
    error message is
    http://hostname:8988/hello_struts1-ViewController-context-root/login.do
    07/07/19 17:12:31 Oracle Application Server Containers for J2EE 10g (10.1.2.0.2) initialized
    Jul 19, 2007 5:12:32 PM org.apache.struts.util.PropertyMessageResources <init>
    INFO: Initializing, config='org.apache.struts.util.LocalStrings', returnNull=true
    Jul 19, 2007 5:12:32 PM org.apache.struts.util.PropertyMessageResources <init>
    INFO: Initializing, config='org.apache.struts.action.ActionResources', returnNull=true
    Jul 19, 2007 5:12:32 PM org.apache.struts.util.PropertyMessageResources <init>
    INFO: Initializing, config='view.ApplicationResources', returnNull=true
    Jul 19, 2007 5:12:32 PM org.apache.struts.action.RequestProcessor processException
    WARNING: Unhandled Exception thrown: class java.lang.NullPointerException
    thanks

    Well if you are just starting with JDeveloper - why are you starting with an old version?
    You should start with 10.1.3 it has hundreds of new features over 10.1.2.
    I created a struts action in 10.1.3 copied your code into it and compiled without any problems.

  • [Struts] Use or re-define processRoles

    Hello forum,
    in my struts web application i need differentiate accesso to determinate actions.
    For example, only the user type A can invoke "addItem" action.
    In Struts APi, i've found the method processRoles for RequestProcess class.
    I don't know how use it.
    Can you to do an example please?
    Thanks, bye.

    yes, you are right, struts controller passes it to UIX controller to handle the events.
    you may return a Page object as the result of the EventResult. Then struts will try to find a forward with the same name as the Page and follow it.
    In 10gProduction we do things a little differently:
    if there is an event=foo on the request URL:
    1. struts controller will try to find and execute an onFoo method on the matching DataAction/DataPage subclass.
    2. if there is no onFoo method, struts will try to execute an action binding (on the UIModel for the DataAction) with the name foo.
    3. if steps 1 or 2 fail to do anything, then struts will ask UIX controller to handle the event.
    after the event is handled:
    4. if the UIX event handler returns an EventResult with a Page as the result, struts will try to find a forward that matches the Page name.
    5. otherwise, struts will try to find a forward with the name foo
    6. if both steps 4 and 5 fail to find a forward, then no navigation will take place, and struts will render the same DataAction/DataPage again.

Maybe you are looking for

  • How to find the exact word in a long text?

    Hi, Scenario: I have long text containing the system status of the equipment. Issue: I need to find the exact word from the list of the statuses. I have tried to use the FIND keyword but it does not work for all the cases. Example:           FIND 'RE

  • Imovie hd low quality when export in "full quality"

    Hi i made one hour of a movie with Imovie hd. When i exported to "full quality" is not equal to the original! I imported photos from iphoto, all in hi definition and i inserted audio track and Ken b. effects. I have to view this movie on the screen d

  • IWeb is actually making my pictures bigger - can I make it stop?

    I am taking a 100kb jpeg, then saving for web in Photoshop and exporting as either a 20kb jpeg, png or gif. I've tried all 3 file types and they all have the same result. When I bring them into iWeb, use at original size, no stroke, no shadow, no ref

  • Prompt values is invalid.

    Hi, In Xcelsius when I preview a report, getting an error like "Promt values is invalid" I have SP2 installed and earlier i dont have this problem. How tor resolve this issue? Thanks in advance

  • How do i sync my ipad to my new computer without losing all the apps on the ipad

    how do i sync my ipad to my new computer without losing all my apps that are on the ipad