Struts submit buuton

Hi all
I am using a html:form
in that i want to keep my own login image
if i use html:submit it is keeping ordinary submit button
please help me

html:submit and ordinary submit button has similar functions if you want the button to be costumized try to use type="img". it has also similar functionality as an ordinary submit button.

Similar Messages

  • Struts submit button focus

    Hello
    I have following prob:
    a form with three buttons
    a submit (normal html-button)
    a cancel (struts html:cancel button)
    and a reset (struts html:reset button)
    since I need javascript to run before submitting
    and after the result of the javascript function deciding if submiting or not I used a submit html-button (I cannot stop the struts html:submit button from submitting even if a put a javascript onClick after the javascript function comes the submition (is there a way to stop it?)).
    For the other two buttons the struts html tags.
    Now if the user press enter (regardless where the focus is in the form) the cancel action is being activated (the form cancelled)
    if I use javascript to put the focus on submit, as soon as the user click on a text field (or any other form component) the "button group focus" moves to the cancel button!
    (regardless where was the focus is in the form)
    How can I get the "enter key focus" staying on submit?
    I already tried the struts <html:form ... focus="submitButton"> and it works at page-load-time BUT as soon as the user click on a text field (or any other form component) the "button group focus" moves to the cancel button ! ! !
    Is there a kind of "enter key" focus which works independent from the fields focus?
    Thanks!

    The regular way to cancel a javascript action is to return false from the onclick event.
    I don't see any reason it wouldn't work with html:submit
    ie
    function checkSubmit(){
      if ( checkIsOk){
        return true;
      alert("You got it wrong moron!");
      return false;
    <input type="submit" onclick="return checkSubmit()">

  • 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.

  • J2EE MVC模式JSF与Struts的异同

    J2EE MVC模式JSF与Struts的异同
    Struts和JSF/Tapestry都属于表现层框架,这两种分属不同性质的框架,后者是一种事件驱动型的组件模型,而Struts只是单纯的MVC模式框架,老外总是急吼吼说事件驱动型就比MVC模式框架好,何以见得,我们下面进行详细分析比较一下到底是怎么回事?
      首先事件是指从客户端页面(浏览器)由用户操作触发的事件,Struts使用Action来接受浏览器表单提交的事件,这里使用了Command模式,每个继承Action的子类都必须实现一个方法execute。
      在struts中,实际是一个表单Form对应一个Action类(或DispatchAction),换一句话说:在Struts中实际是一个表单只能对应一个事件,struts这种事件方式称为application event,application event和component event相比是一种粗粒度的事件。
      struts重要的表单对象ActionForm是一种对象,它代表了一种应用,这个对象中至少包含几个字段,这些字段是Jsp页面表单中的input字段,因为一个表单对应一个事件,所以,当我们需要将事件粒度细化到表单中这些字段时,也就是说,一个字段对应一个事件时,单纯使用Struts就不太可能,当然通过结合JavaScript也是可以转弯实现的。
      而这种情况使用JSF就可以方便实现,
    <h:inputText id="userId" value="#{login.userId}">
      <f:valueChangeListener type="logindemo.UserLoginChanged" />
    </h:inputText>
      #{login.userId}表示从名为login的JavaBean的getUserId获得的结果,这个功能使用struts也可以实现,name="login" property="userId"
      关键是第二行,这里表示如果userId的值改变并且确定提交后,将触发调用类UserLoginChanged的processValueChanged(...)方法。
      JSF可以为组件提供两种事件:Value Changed和 Action. 前者我们已经在上节见识过用处,后者就相当于struts中表单提交Action机制,它的JSF写法如下:
    <h:commandButton id="login" commandName="login">
      <f:actionListener type=”logindemo.LoginActionListener” />
    </h:commandButton>
      从代码可以看出,这两种事件是通过Listerner这样观察者模式贴在具体组件字段上的,而Struts此类事件是原始的一种表单提交Submit触发机制。如果说前者比较语言化(编程语言习惯做法类似Swing编程);后者是属于WEB化,因为它是来自Html表单,如果你起步是从Perl/PHP开始,反而容易接受Struts这种风格。
      基本配置
      Struts和JSF都是一种框架,JSF必须需要两种包JSF核心包、JSTL包(标签库),此外,JSF还将使用到Apache项目的一些commons包,这些Apache包只要部署在你的服务器中既可。
      JSF包下载地址:http://java.sun.com/j2ee/javaserverfaces/download.html选择其中Reference Implementation。
      JSTL包下载在http://jakarta.apache.org/site/downloads/downloads_taglibs-standard.cgi
      所以,从JSF的驱动包组成看,其开源基因也占据很大的比重,JSF是一个SUN伙伴们工业标准和开源之间的一个混血儿。
      上述两个地址下载的jar合并在一起就是JSF所需要的全部驱动包了。与Struts的驱动包一样,这些驱动包必须位于Web项目的WEB-INF/lib,和Struts一样的是也必须在web.xml中有如下配置:
    <web-app>
      <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
      </servlet>
      <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.faces</url-pattern>
      </servlet-mapping>
    </web-app>
      这里和Struts的web.xml配置何其相似,简直一模一样。
      正如Struts的struts-config.xml一样,JSF也有类似的faces-config.xml配置文件:
    <faces-config>
      <navigation-rule>
        <from-view-id>/index.jsp</from-view-id>
        <navigation-case>
          <from-outcome>login</from-outcome>
          <to-view-id>/welcome.jsp</to-view-id>
        </navigation-case>
      </navigation-rule>
      <managed-bean>
        <managed-bean-name>user</managed-bean-name>
        <managed-bean-class>com.corejsf.UserBean</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
      </managed-bean>
    </faces-config>
      在Struts-config.xml中有ActionForm Action以及Jsp之间的流程关系,在faces-config.xml中,也有这样的流程,我们具体解释一下Navigation:
      在index.jsp中有一个事件:
    <h:commandButton label="Login" action="login" />
      action的值必须匹配form-outcome值,上述Navigation配置表示:如果在index.jsp中有一个login事件,那么事件触发后下一个页面将是welcome.jsp
      JSF有一个独立的事件发生和页面导航的流程安排,这个思路比struts要非常清晰。
      managed-bean类似Struts的ActionForm,正如可以在struts-config.xml中定义ActionForm的scope一样,这里也定义了managed-bean的scope为session。
      但是如果你只以为JSF的managed-bean就这点功能就错了,JSF融入了新的Ioc模式/依赖性注射等技术。
    Ioc模式
      对于Userbean这样一个managed-bean,其代码如下:
    public class UserBean {
      private String name;
      private String password;
      // PROPERTY: name
      public String getName() { return name; }
      public void setName(String newValue) { name = newValue; }
      // PROPERTY: password
      public String getPassword() { return password; }
      public void setPassword(String newValue) { password = newValue; }
    <managed-bean>
      <managed-bean-name>user</managed-bean-name>
      <managed-bean-class>com.corejsf.UserBean</managed-bean-class>
      <managed-bean-scope>session</managed-bean-scope>
      <managed-property>
        <property-name>name</property-name>
        <value>me</value>
      </managed-property>
      <managed-property>
        <property-name>password</property-name>
        <value>secret</value>
      </managed-property>
    </managed-bean>
      faces-config.xml这段配置其实是将"me"赋值给name,将secret赋值给password,这是采取Ioc模式中的Setter注射方式。
      Backing Beans
      对于一个web form,我们可以使用一个bean包含其涉及的所有组件,这个bean就称为Backing Bean, Backing Bean的优点是:一个单个类可以封装相关一系列功能的数据和逻辑。
      说白了,就是一个Javabean里包含其他Javabean,互相调用,属于Facade模式或Adapter模式。
      对于一个Backing Beans来说,其中包含了几个managed-bean,managed-bean一定是有scope的,那么这其中的几个managed-beans如何配置它们的scope呢?
    <managed-bean>
      <managed-property>
        <property-name>visit</property-name>
        <value>#{sessionScope.visit}</value>
      </managed-property>
      这里配置了一个Backing Beans中有一个setVisit方法,将这个visit赋值为session中的visit,这样以后在程序中我们只管访问visit对象,从中获取我们希望的数据(如用户登陆注册信息),而visit是保存在session还是application或request只需要配置既可。
      UI界面
      JSF和Struts一样,除了JavaBeans类之外,还有页面表现元素,都是是使用标签完成的,Struts也提供了struts-faces.tld标签库向JSF过渡。
      使用Struts标签库编程复杂页面时,一个最大问题是会大量使用logic标签,这个logic如同if语句,一旦写起来,搞的JSP页面象俄罗斯方块一样,但是使用JSF标签就简洁优美:
    <jia:navigatorItem name="inbox" label="InBox"
      icon="/images/inbox.gif"
      action="inbox"
      disabled="#{!authenticationBean.inboxAuthorized}"/>
      如果authenticationBean中inboxAuthorized返回是假,那么这一行标签就不用显示,多干净利索!
      先写到这里,我会继续对JSF深入比较下去,如果研究过Jdon框架的人,可能会发现,Jdon框架的jdonframework.xml中service配置和managed-bean一样都使用了依赖注射,看来对Javabean的依赖注射已经迅速地成为一种新技术象征,如果你还不了解Ioc模式,赶紧补课。

    JSF在很大程度上类似Struts,而不是类似Tapestry,可以说是一种Struts 2.0,都是采取标签库+组件的形式,只是JSF的组件概念没有象Struts那样必须继承ActionForm的限制;JSF在事件粒度上要细腻,不象Struts那样,一个表单一个事件,JSF可以细化到表单中的每个字段上。
      JSF只有在组件和事件机制这个概念上类似Tapestry,但是不似Tapestry那样是一个完全组件的框架,所以,如果你做一个对页面要求灵活度相当高的系统,选用Tapestry是第一考虑。
      Struts/JSF则适合在一般的数据页面录入的系统中,对于Struts和JSF的选用,我目前个人观点是:如果你是一个新的系统,可以直接从JSF开始;如果你已经使用Struts,不必转换,如果需要切换,可以将JSF和Tapestry一起考虑。
      另外,JSF/Tapestry不只是支持Html,也支持多种客户端语言如WML或XUI等。
      这三者之间关系:如果说Struts是左派;那Tapestry则是右派;而JSF则是中间派,中庸主义是SUN联盟的一贯策略。

  • Script to  submit XML via Live cycle designer

    H
    I am using sumit button to submit the XML in Live cycle designer . here i am speecified in the dropdown submit as XML .
    and the presubmit the following code used to specify the URL .
       this.resolveNode("#event").submit.target
    Like same as above i want to specify the sumit as XML also using script .Please provide some idea
    1.to sumit the XML to the particuler URL without using submit buuton or
    2. Provide some scrpits to submit the XML using  submit button
    the reason for above need is to add/remove some tags from submit XML before submitting 

    Is any script availble like below to submit as XML ?
    this.resolveNode("#event").submit.target = mailto:URL (Used to submit pass submit URL dyanmically ). I need the code to submit as XML .
    Thanks in Advance

  • To handle Exception in CO and AM from navigation to Next option

    Hi..
    I have built one OA page..
    I have used follwing code throw new OAException("PER","<Message_Name>",null,OAException.INFORMATION,null);
    It gives error as
    Information - Unexpected Error. Contact System Administrator
    and allows user to go ahead.
    But this error doesnt stop from navigatin.Its just like FYI.
    Can I use throw new OAAttrValException(OAException.TYP_ENTITY_OBJECT,
    getEntityDef().getName(), // EO name
    getPrimaryKey(), // EO PK
    "OverTimeType", // Attribute Name
    ReturnValue1, // Attribute value
    "PER", // Message product short name
    "Message_Name"); // Message name
    But getEntityDef().getName(), getPrimaryKey() cannot be used from co.
    I want to stop user from navigatiing till it changes the value to resolve the error.
    Same happens when I throw error from AM.
    I want that when user enter date, and it is invalid, then immeditaely he should get an error and he should not be ablt to move on next tab until it enters correct and valid date..
    Plesae let me know if anyone has done same
    Thansk in advance,
    Nisha

    Hi..
    Thanks for help.
    For some cases I am validating at attribute level so am throwing error at EO level. But at EO level also, say I have 5 fields, in which first field is date. I have put one validation in EO if eneterd date is after sysdate then I ma throwing error as
    if (startDate > sysdate)
    throw new OAAttrValException(OAException.TYP_ENTITY_OBJECT,
    getEntityDef().getName(), // EO name
    getPrimaryKey(), // EO PK
    "TripFrom", // Attribute Name
    value, // Attribute value
    "PER", // Message product short name
    "HG_HR_OT_MSG_15"); // Message name
    } where startDate is entered date.
    Here If I enter invalid date then it doesnt throw erroe immediately, it allows me to enter details in other fields and when I click on submit buuton, which stores data in database , it throws error.
    Is there any way by which I can throw erro immediatley after entering invalid value and it doesn not allow me to go on next filed till i enter correct value in first field.

  • Combine text and image as submit in Struts

    Hi,
    I would like to make a submit with a little button AND text, like
    "here is image" Research
    I'm forced to use Struts, so that the html tag <a href> is not usable.
    Can anybody help me?

    You can allways use the
       <html:link action="myAction"/>
       </html:link> Or if you don't have the requirement that your pages have to work even with JavaScript disabled you can allways do the following:
       <a href="#" onclick="javascript:forms['myForm'].submit(); return false;">
       </a>

  • JSF Struts Integration Action lost on submit

    Hi All
    I've been tearing my hair out with this one for half a day. I am producing a web app using struts and jsf in conjunction. I have succesfully used the integration library on several pages, so I know the framework is in place. However for the following page I can produce valuechange events and process them on a javascript submit, and perform a quick return render, but when I press the submit button, the action is not forwarded through to struts action.
    The jsp page :
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
    <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
    <%@ taglib prefix="s" uri="http://struts.apache.org/tags-faces" %>
    <f:view>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <s:html>
    <head>
    <s:base/>
    <title>selectplot.jsp</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    </head>
    <body>
    <s:form action="/redirectSelectSite">
    <table border="0">
    <tr>
    <td>Site Code</td>
    <td><h:selectOneMenu id="siteSelect" value="#{SelectPlotForm.sitecode}" valueChangeListener="#{SelectPlotForm.processSiteChange}" onchange="this.form.submit();">
    <f:selectItems id="siteSelectItem" value="#{SelectPlotForm.sites}" />
    </h:selectOneMenu>
    </td>
    </tr>
    <tr>
    <td>Plot Number</td>
    <td><h:selectOneMenu id="plotSelect" value="#{SelectPlotForm.plotno}" >
    <f:selectItems id="plotSelectItem" value="#{SelectPlotForm.plots}" />
    </h:selectOneMenu>
    </td>
    </tr>
    <tr>
    <td colspan="2" align="center"><h:commandButton id="submit" type="SUBMIT" value="Continue"/></td>
    </tr>
    </table>
    <s:errors/>
    </s:form>
    </body>
    </s:html>
    </f:view>Backing Bean:
    public class SelectPlotForm extends ActionForm {
    // Omitted unwanted detail.
    * @param event
    * @throws AbortProcessingException
    public void processSiteChange(ValueChangeEvent event)
    throws AbortProcessingException {
    if (null != event.getNewValue()) {
    sitecode = ((String)event.getNewValue());
    // Get the list of plots for the new sitecode.
    this.setPlots(ChoicesInterface.getPlotsList(sitecode));
    // Do a quick render response
    FacesContext.getCurrentInstance().renderResponse();
    }struts-config.xml extract
    <action attribute="SelectPlotForm" name="SelectPlotForm" path="/redirectSelectSite" scope="session"
    type="com.millwood.struts.action.RedirectSelectPlot"
    validate="false" input="/selectPlot.faces" >
    <forward name="success" path="/printchoices.faces" />
    </action>and finally the struts action file :
    package com.millwood.struts.action;
    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.config.ForwardConfig;
    import com.millwood.Choices.Web.SelectPlotForm;
    * Redirects the user of the selectPlot page to the appropriate action.
    * @author James Salt
    * @since 0.1
    public class RedirectSelectPlot extends Action {
    public ActionForward execute(
    ActionMapping mapping,
    ActionForm form,
    HttpServletRequest request,
    HttpServletResponse response) {
    SelectPlotForm scf = (SelectPlotForm) form;
    // Construct the foward entity on the fly.
    ForwardConfig fc = new ForwardConfig();
    fc.setName("result");
    fc.setPath(scf.getActionurl()+ ".do?plotno=" + scf.getPlotno() + "&sitecode="+ scf.getSitecode());
    mapping.addForwardConfig(fc);
    return (mapping.findForward("result"));
    }Sorry about the massive posting but I thought it better to provide all the information relevant as currently I am at a bit of a loss.
    I have placed debug points at all the accessible parts of code, but non are triggered, so it must be being bounced in the ActionListener either in Struts or Faces before it tries to get the action.
    Any help would be really, really appreciated.
    Yours thankfully,
    james salt

    Change you action from:
    <s:form action="/redirectSelectSite">
    To:
    <s:form action="/redirectSelectSite.do">
    So that your request gets processed by the Srtuts Controller. Assuming you have *.do mapped to your struts controller in web.xml.

  • Unable Submit Form Value to Action when running struts-portlet in OracleAS

    Hi,I have develop a portlet using struts & pdk, after that deploy it by OC4J and register the
    provider at Oracle Application Server 10g 10.1.2.2.
    However the formbean value is unable passing to action after clicking submit button,this problem
    doesn't comeout when i run my code as stand alone application.
    here is my application code:
    1. Action Class:
    public class ZoneAction
      extends DispatchAction
      public ActionForward display(ActionMapping mapping, ActionForm form,
                                   HttpServletRequest request,
                                   HttpServletResponse response)
        throws IOException, ServletException
        ZoneHibernate zh = new ZoneHibernate();
        List list = zh.retrieveAllZone();
        ZoneForms zf = new ZoneForms();
        ZoneForm blankForm = new ZoneForm();
        list.add(blankForm);
        zf.setZoneForms(list);
        request.setAttribute("zoneForms", zf);
        return mapping.findForward("success");
    2.Provider.xml:
    <provider class="oracle.portal.provider.v2.DefaultProviderDefinition">
       <session>true</session>
       <passAllUrlParams>true</passAllUrlParams>
       <portlet class="oracle.portal.provider.v2.DefaultPortletDefinition">
          <id>1</id>
          <name>irmsPortlet</name>
          <title>iRMS Portlet</title>
          <description></description>
          <timeout>40</timeout>
          <showEditToPublic>false</showEditToPublic>
          <hasAbout>false</hasAbout>
          <showEdit>false</showEdit>
          <hasHelp>false</hasHelp>
          <showEditDefault>false</showEditDefault>
          <showDetails>false</showDetails>
          <renderer class="oracle.portal.provider.v2.render.RenderManager">
             <renderContainer>true</renderContainer>
             <renderCustomize>true</renderCustomize>
             <autoRedirect>true</autoRedirect>
             <contentType>text/html</contentType>
             <showPage class="oracle.portal.provider.v2.render.http.StrutsRenderer">
             <defaultAction>/jsp/zone_maintenance.jsp</defaultAction>
             </showPage>
          </renderer>
       </portlet>
    </provider>
    3. Action Mapping in struts-cofig.xml:
      <action-mappings>
        <action path="/ZoneMaintenance"
                type="my.com.irms.action.ZoneAction"
                name="zoneForms"
                scope="request"
                parameter="action"
                input="/jsp/zone_maintenance.jsp">
          <forward name="success" path="/jsp/zone_maintenance.jsp"/>
        </action>
      </action-mappings>
    4.jsp:
    <pdk-html:form action="/ZoneMaintenance.do">
    -div id="action"-<pdk-html:hidden name="zoneForms" property="action"/>-/div-
    <logic:notEmpty name="zoneForms" property="zoneForms">
    <table border="1">
    <thead>
                <tr>
                    <th><bean:message key="zone.zone"/></th>
                    <th><bean:message key="zone.disc"/></th>
               </tr>
    </thead>
    <tbody>
    <logic:iterate id="zone" name="zoneForms" property="zoneForms" indexId="i">
                <tr id="tr${i}">   
                    <td>
                      <pdk-html:hidden name="zoneForms"
                                      property="zoneForms[${i}].rowStatus" value=""/>
                      <pdk-html:hidden name="zoneForms" property="zoneForms[${i}].id"/>
                      <input type="checkbox" onclick="update()">
                    </td>
                    <td><pdk-html:text name="zoneForms"
                                           property="zoneForms[${i}].zone" size="10"       
                                           onchange="rowDataChanged('tb1',${i})"/></td>
                    <td><pdk-html:text name="zoneForms"
                                           property="zoneForms[${i}].disc" size="30" 
                                           onchange="rowDataChanged('tb1',${i})"/></td>
                </tr>
    </logic:iterate>
    </tbody>
    </table>
    <input type="button" value="Submit" onclick="submitForm('save')"/>
    </logic:notEmpty>
    <input type="button" value="Display" onclick="submitForm('display')"/>
    </pdk-html:form>
    5.javascript for submitForm():
      function submitForm(param)
            document.getElementById("action")
           .getElementsByTagName("input")[0].value = param;
            document.forms[0].submit();
    6.web.xml
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <web-app>
      <description>Empty web.xml file for Web Application</description>
      <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>
        <description>Extended Portal
                     SOAP  Server</description>
        <servlet-name>SOAPServlet</servlet-name>
        <servlet-class>
               oracle.webdb.provider.v2.adapter.SOAPServlet
        </servlet-class>
        <init-param>
          <param-name>resourceServletMapping</param-name>
          <param-value>/pdkresource</param-value>
        </init-param>
      </servlet>
      <servlet>
        <description>Image resource server</description>
        <servlet-name>ResourceServlet</servlet-name>
        <servlet-class>
             oracle.webdb.provider.v2.adapter.ResourceServlet
        </servlet-class>
      </servlet>
      <servlet-mapping>
        <servlet-name>action</servlet-name>
        <url-pattern>*.do</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
        <servlet-name>SOAPServlet</servlet-name>
        <url-pattern>/providers</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
        <servlet-name>SOAPServlet</servlet-name>
        <url-pattern>/providers/*</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
        <servlet-name>ResourceServlet</servlet-name>
        <url-pattern>/pdkresource/*</url-pattern>
      </servlet-mapping>
      <session-config>
        <session-timeout>35</session-timeout>
      </session-config>
      <mime-mapping>
        <extension>html</extension>
        <mime-type>text/html</mime-type>
      </mime-mapping>
      <mime-mapping>
        <extension>txt</extension>
        <mime-type>text/plain</mime-type>
      </mime-mapping>
    </web-app>
    Can anyone help me? thanks.

    It is probably easier to do with with a standard tag than the <html:button> tag, as it means you can nest the
    <input type="button" name="more" value="more" onclick="setID(<bean:write name="bloodbankList" property="id"/>)"/>or maybe like this:
    <bean:define id="bbId" name="bloodbankList" property="id"/>
    <html:button property="More" value="More" style="color: #00007D; text-transform: uppercase; letter-spacing: 2pt; background-color: #6B719C; border: 2 solid #00007D"   onclick="<%= "setID(" + id + ");" %>" />Cheers,
    evnafets

  • Submit Button in a Struts Form

    Hallo,
    in a fom I have 2 submit buttons the Value of the first is "new" and the secound is "Edit"
    who can one get in the Action class whicht button has klick the user
    <html:form action="/SubmitUserSelection">
    <table width=100% cellpadding=0 cellspacing=0 border=0>
    <tr height="30">
         <td width="95"><html:submit property="submit" value="New"/></td>
         <td width="95"><html:submit property="submit" value="Edit"/></td>
    <tr>
    </table>
    public ActionForward execute(ActionMapping mapping,
    ActionForm form,
    HttpServletRequest request,
    HttpServletResponse response) throws Exception {
    thanks

    http://struts.apache.org/userGuide/building_controller.html#action_form_classes
    make sure you add a field and setter getter for your submit button

  • Error in Struts Application, Form Submit

    I've developed a simple struts application which allows user to key in inputs thru a form(registration.jsp), submit n display e inputs keyed in in another page(details.jsp).
    i'd succesfully integrate e pdk-struts application to portal, but wen i click on 'Submit', my action r not performed, not directed to my details.jsp, neither do it shows any error.
    However, one thing i realised is tat wen integrated to portal, e codes for my action r changed:
    registration.jsp
    <html:form action="/register" focus="name">
    after integrated wit Portal, it was translated to:
    <form name="registerForm" method="post" action="http://smeagel:7778/portal/page">
    <INPUT TYPE="hidden" name="_pageid" value="6,3,6_22" />
    <INPUT TYPE="hidden" name="_dad" value="portal" />
    <INPUT TYPE="hidden" name="_schema" value="PORTAL" />
    <INPUT TYPE="hidden" name="_piref6_108279_6_3_22.strutsAction" value="register.do" />
    After Submit button was clicked, i was directed to a new URL, http://smeagel:7778/portal/page
    Any solutions??

    provider.xml
    <?xml version = '1.0' encoding = 'UTF-8' standalone='yes'?>
    <?providerDefinition version="3.1"?>
    <provider class="oracle.portal.provider.v2.DefaultProviderDefinition">
    <session>true</session>
    <passAllUrlParams>true</passAllUrlParams>
    <portlet class="oracle.portal.provider.v2.DefaultPortletDefinition">
    <id>1</id>
    <name>MyPortlet</name>
    <title>- Registration Form -</title>
    <description>My Portlet Description</description>
    <timeout>40</timeout>
    <showEditToPublic>false</showEditToPublic>
    <hasAbout>false</hasAbout>
    <showEdit>false</showEdit>
    <hasHelp>false</hasHelp>
    <showEditDefault>false</showEditDefault>
    <showDetails>false</showDetails>
    <inputParameter class="oracle.portal.provider.v2.DefaultParameterDefinition">
    <name>MyParam</name>
    <displayName>My Portlet Parameter</displayName>
    </inputParameter>
    <renderer class="oracle.portal.provider.v2.render.RenderManager">
    <renderContainer>true</renderContainer>
    <renderCustomize>true</renderCustomize>
    <autoRedirect>true</autoRedirect>
    <contentType>text/html</contentType>
    <showPage>/registration.jsp</showPage>
    <showPage class="oracle.portal.provider.v2.render.http.StrutsRenderer">/register.do</showPage>
    </renderer>
    </portlet>
    </provider>
    I'd saw some example, which using <defaultAction>, however, wen i put in <defaultAction>/register.do</defaultAction>
    i'll have error in my Provider Test Page. Validation Unsuccessful.
    Error: Class oracle.portal.provider.v2.render.http.StrutsRenderer has no set or add method for tag "defaultAction"
    Is <defaultAction> a necessary tag? Is tat e reason y my application isnt running?

  • Problem commit w/intermedia adf struts uix & 1 step submit/commit to user

    JDev 9051, ADF, Struts, ix & Intermedia
    Problem:
    Inserting intermedia data type (ORDSYS.ORDIMAGE) AND wanting the "commit to happen behind the scenes" so the user does not have to press submit and then commit.
    I am having a problem committing a record to the DB when the form contains an intermedia data type. If I do not fill in the image column (using file upload) it works fine. My work around for now is to commit twice.
    To create a new entry that contains intermedia data type (ORDSYS.ORDIMAGE) I am using the following flow of events.
    NOTE: THIS DOES NOT WORK IF I UPLOAD AN IMAGE, HOWEVER, IF I LEAVE THE IMAGE COLUMN BLANK IT WORKS FINE.
    01. start at browseInventory.uix
    02. press create button which triggers event named createInventoryEvent
    03. which gives control to createInventoryFoward
    04. which fires Data Action named createInventoryAction
    05. which forwards to formInventory.uix
    06. user supplies data and presses the submit button which triggers event named commitInventoryEvent
    07. which gives control to commitInventoryFoward
    08. which fires Data Action named commitInventoryAction
    09. which forwards to browseInventory.uix
    NOTE: THIS WORKS IF I DO UPLOAD AN IMAGE (COMMIT TWICE)
    01. start at browseInventory.uix
    02. press create button which triggers event named createInventoryEvent
    03. which gives control to createInventoryFoward
    04. which fires Data Action named createInventoryAction
    05. which forwards to formInventory.uix
    06. user supplies data and presses the submit button which triggers event named commitInventoryEvent
    07. which gives control to commitInventoryFoward
    08. which fires Data Action named commitInventoryAction
    09. which (on success) fires Data Action named commitInventoryAction_2
    10. which forwards to browseInventory.uix
    BTW - is there some codes I can use to display an image (Struts Config - Page Flow) on the OTN forums if I am hosting the image?
    Thanks,
    Bill G...

    Did you ever get a soluction for the duoble commit thingie?
    cause I cuirrently have the smae problem. It seems that it uses the first commit to instantiate the object, and the second commit to actually upload it to the database.

  • Using Struts, On submit button in child window, its opening new window.

    We are developing a project using Struts and BC4J. I am opening a child window(window.showmodaldialog) from main window using struts action. Actually Child window is a search kind of page. User will enter the search criteria and press the sumbit button. I want to display the search result in the same window using datatable when jboevent="submit". But its opening new window and displaying the result in that. However in <html:form>, Even I tried the target="_self".
    I am not sure wether the associated action in the <html:form> is forcing to open a new window.
    Similar kind of thing I am able to achieve in other similar search page, it its not a child window.
    Please let me know what I am missing.
    Thanks,
    Arvind

    So you want the search window to submit back to itself so you see the search field and a result list..?
    In pure Struts terms either using "_self" or the name of the popup window in the <html:form> tag will do the trick
    You need to make sure that the inital window that you created as the popup search window has a name in the first place - can you specify this with showModalDialog()?
    BTW isn't showModalDialog an IE only feature...

  • Htmls:submit buttons and links in struts

    Hello,
    I am developing a struts web application. In the course of that I have two questions:
    How can I define an image to display for a html:submit button instead the traditional visualization of the html:submit button?
    The same for links - How can I define an image for a link?
    thanks in advance
    Kind Regards
    pat

    How can I define an image to display for a
    html:submit button instead the traditional
    visualization of the html:submit button?
    The same for links - How can I define an image for a
    link?
    <html:image>

  • Submit struts portlet in same window

    hi,
    i develop a portlet in struts and its running ok, but i click in button submit the portlet is process in full window and not in same page in portlet.

    Download the PDK software and extract it. You find a sample portlet in the following path:
    pdksoftware\pdk\jpdk\v2\jpdk\pdkstruts\htdocs\struts
    For your convenience, I pasted here one of the JSPs:
    <%@ page contentType="text/html;charset=ISO-8859-1"%>
    <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/tlds/pdk-struts-html.tld" prefix="pdk-html" %>
    <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %>
    <h2>
        <bean:message key="addCustomer.title"/>
    </h2>
    <p>
    <pdk-html:form action="updateCustomerStore.do">
        <table border="1">
            <tr>
                <td><bean:message key="general.name"/></td>
                <td><html:text property="name"/></td>
            </tr>
            <tr>
                <td><bean:message key="general.address"/></td>
                <td><html:text property="address"/></td>
            </tr>
        </table>
        <html:submit/>
    </pdk-html:form>
    <p>
    <pdk-html:img page="/htdocs/struts/struts-power.gif" alt="Powered by Struts"/>Peter

Maybe you are looking for

  • If i deleted my history, is there a way you can still tell me how many times a site was visited from my MacBook?

    My history has been wiped out. I would like to know if there is a way i can see how many times a site was previously visited using my MacBook. Pelase advise. Thansk!

  • Material Creation Using BDCs.

    Hi all, I have developed a program for Material Creation using BDC. Material is Being created and that is working well and good.Here i have a Requirement to update the Newly creted material in Ztable.So when i use call transaction mathod,i have writt

  • Creating new report category in Abap HR

    When I try and create a new custom report category, I get a message saying "Choose the key from the allowed namespace". I did use a Z report category (we do have Z report categories that have been created earlier by somebody else). It would be great

  • AppServer crashes. Need help troubleshooting

    After following the guidance and completing the installation I have noticed AppServer will crash intermittently. It could happen after 5 mins running or 15. Here's the log in /opt/SUNWappserver/domains/domain1/logs/server.log [#|2008-10-10T00:08:47.6

  • Picture files all come up as same scenery image

    I am new here, hope I am in the right forum, apologize if I am not. All  pictures in my hard drives come up as an ocean shore scene. I have to  double click each one to get the correct photo, but I can't look at them  all at once to compare which one