Struts html:form vs form

Hi,
I'm trying to get form validation working in struts but am running into a bit of difficulty. I have a couple of questions:
1) When an ActionError is returned - does the input form have to have used <html:form> tags for the errors to be shown. The reason i ask is because at the moment i am using the original <form> tags and when the request is returned to the input page there is just a blank page - i though this might be because i am not using the specialised struts html tags? This leads nicely on to my 2nd question... :o)
2)Now the reason i am not using these tags is because when i try and create a form using these tags the text input areas/buttons etc do not appear - here is my code:
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html:html>
  <head>
    <title>iQ Holiday Entitlement Calculator</title>
  </head>
  <body>
    <p><html:errors property="date"/></p>
    <html:form action="/iq/hr/holiday/calculate" name="calculatorForm" type="iq.hr.holiday.calculator.forms.CalculatorForm" >
      <table width="45%" border="0">
        <tr>
          <td>Day: <html:text property="day" /></td>
        </tr>
        <tr>
          <td>Month: <html:text property="month" /></td>
        </tr>
        <tr>
          <td>Year: <html:text property="year" /></td>
        </tr>
        <tr>
          <td colspan="2" align="center"><html:submit styleClass="button" value="Go"/></td>
        </tr>
      <table>
    </html:form>
  </body>
</html:html>The text literals "Day:", "Month:", "Year:" appear but no text field with which to enter the text!
I would very much appreciate any help anyone can offer!
Many thanks

<%@ page contentType="text/html; charset=iso-8859-1"
language="java" import="java.sql.*" errorPage="" %>
<%@ taglib uri="/WEB-INF/struts-html.tld"
prefix="html" %>
<html:html>
<head>
<title>iQ Holiday Entitlement Calculator</title>
</head>
<body>
<p><html:errors property="date"/></p>
<html:form action="/iq/hr/holiday/calculate"
te" name="calculatorForm"
type="iq.hr.holiday.calculator.forms.CalculatorForm"
>
<table width="45%" border="0">
<tr>
<td>Day: <html:text property="day" /></td>...
</tr>
<table>
</html:form>
</body>
</html:html>try:
1.check your Action to see if the forward is ok (I think that your forward=... is not reachable if you have some errors)
2.delete property="date" from <html:errors.../>
3.close <table>tag
4.delete <html:html> and </html:html> from your code
5.maybe you have some errors in your and you have errorPage=""

Similar Messages

  • How to use form name in struts html:form tag

    Hi,
    I want to validate text box value, if it is ordinary html form I would have done like this <form name="myform" action="xxxx.jsp" onsubmit="return validate()">
    But am using struts html:form tags. In this case how can I use/specify name for a form.
    Can any one help me.
    Thanks

    The name of the form comes from the actionForm you have defined backing it.
    View source on the generated page to see what HTML it constructs.
    You are able to use the onsubmit event with the <html:form> tag just like the standard one, so if all you want to do is that:
    <html:form action="/saveUser" onsubmit="return validate()">
    ...You can also give it a styleId, which will generate an id in the HTML.
    See the tag documentation for details: http://struts.apache.org/1.2.x/userGuide/struts-html.html#form

  • How to return a html repsonse after form guide rendering in browser?

    How to return a html repsonse after form guide rendering in browser indicating that server has recieved transmission and request is submitted succesfuly?
    I am rendering the form guide in browser using guide invoke service and when i submit the data in browser to server through guide , it is displaying some random number in browser?
    i need to display a resposne that request is submitted successfully?

    how could i define a variable with "html data" ?
    Create a variable of type document and then a service to read the html from where ever it's located. If you put it in LiveCycle, you can use the ReadRessource service. If it's on the file system, you can use the Read Document. If it's in the database, you can use the JDBC service.
    Also, one more doubt where should i use this variable in my process to get the same?
    You want the response once you've submitted the data, so the html is really the result of calling the process that's processing the data. So I would create an output variable of type document on that process.
    Right now it displays a random number in the browser because your submit process is long lived. When a process is long lived (asynchronous), you invoke it and then you get an identifier back. It's kind of a fire and forget. You can use that identifier to check the status of the long lived process, since long lived processes can take hours, days to complete. You don't want your browser to wait that long, hence the identifier.
    However if you change the process to be short lived (synchronous), the browser will wait for the result of the process, which really means the output variables for that process. If your output variable contains html, it'll display html.
    So the key is make you submit process short lived and populate the output variables appropriately.
    Jasmin

  • How to display HTML file in forms 6i

    please can any one tell me how i can display normal HTML file in forms 6i
    this HTML file will be called from help menu.
    thanks in advance

    If you're fine with opening html file in a separate browser window, you can use web.show_document.
    But if you have to see html inside Form, one of the solution may be use embeded browser. for detail goto http://forms.pjc.bean.over-blog.com/article-1890238.html

  • BPELConsole: Initiate does not show HTML or XML form to fill in variables

    Hi,
    i am using a xsd with a cascaded import of other xsds.
    If i use one import layer everything is fine.
    But if i use something like:
    1.xsd (imports 2.xsd)
    2.xsd (imports 3.xsd)
    The BPELConsole refuses to show me a HTML or XML form where i can fill in the variables...

    Hi,
    For time being create one dummy process with request and response as a string type and call your process with the [xml]string input by creating partnerlink.
    Generate xml from the schema with xml generator tools.
    or use java api to invoke the process.
    Regards,
    Bogi

  • Create HTML page inside form 6i

    Hi ,
    I would like to know if it's possible to create an HTML page inside form 6i ,, where this html page will include a time using html code, and a refresh button will be in the form whenever I press the refresh button the html page inside the form will be updated ..
    how can i do that ?
    Thanks in advance … :)

    Yes its possible . If you are running forms in client server , use host built in to open the html page. This html page can be created
    dynamically using text io.
    If you are running on web use webutil client host and text io.
    Best Regards
    Rajesh Alex

  • How to exchange data between the html in the form layout and itsparameters?

    i am trying to rephrase a question i asked a few days back and which yielded no response.
    is there any way to exchange/transfer values or data between the html in the form layout editor and the form parameters?
    for instance, is there any bridge such that the form template design (controlled by some html-based attribute), or the display property (again managed by some string value for the style:display attribute) of some of its divisions etc could be controlled by the values passed to some parameters of a portal form?
    has any body ever tried to do it or thought of doing it? or it's inherrently beyond the portal forms capacity?
    folks, any clues or hints on 'yes, that's how' or 'no, and that's why not!' please? will greatly appreciate.
    Naqvi

    i am trying to rephrase a question i asked a few days back and which yielded no response.
    is there any way to exchange/transfer values or data between the html in the form layout editor and the form parameters?
    for instance, is there any bridge such that the form template design (controlled by some html-based attribute), or the display property (again managed by some string value for the style:display attribute) of some of its divisions etc could be controlled by the values passed to some parameters of a portal form?
    has any body ever tried to do it or thought of doing it? or it's inherrently beyond the portal forms capacity?
    folks, any clues or hints on 'yes, that's how' or 'no, and that's why not!' please? will greatly appreciate.
    Naqvi

  • How to embed the html file into form 6i?

    How to embed the html file into form. What control activeX should i use? please help!!!!!!

    You can use web.show_document function for this purpose. See
    form builder help topics for more details.
    Hope this helps.

  • HTML 5 Contact Form "Placeholder" instead of label makes form validation not work

    Hi,
    I am trying to implement a HTML 5 contact form which uses a "placeholder" within the field instead of a label. But now the form validation does not work.
    The site is at http://www.partnerrealestate.ch/avenuedefrance23/index.html and it is not using any workflows from BC as the person receiving it is an external person and the process does not require a workflow.
    Would appreciate any input into this.
    Kindest Regards,
    corina

    There is no label on input fields. The form does not work because you have edited the names. BC needs the ID and names to be as it is issue when you create the form so it knows what to use for the validation and what information to pass into the database.
    So where you have edited these, you need to restore those.
    You have some invalid html on some input's as well one has input="" inside of it when rendered so that is not right.
    It is not to do with placeholder use. So fix up your HTML errors, correct the name and ID changes and it will work fine.

  • What are the steps to create a simple html e-mail form?

    I've attempted to make an html e-mail form using PHP. However, the instructions from Adobe that I've been following aren't working. Perhaps because I am doing something wrong. Anybody have any ideas as to why it might not be working?

    The path to the form script is wrong. Change
    <form action="www.mocatholic.org/sendresults.php"
    to
    <form action="/sendresults.php"
    or include the full url like
    <form action="http://www.mocatholic.org/sendresults.php"

  • Oracle 11g Forms Configuration Forms.conf  (Image and Html files)

    Hello,
    We are configuring our forms.conf file as such.
    AliasMatch ^/forms/help/(..*) "/u01/app/forms/as_1/forms/appname/help/$1"
    AliasMatch ^/forms/icons/(..*) "/u01/app/forms/as_1/forms/appname/icons/$1"
    AliasMatch ^/forms/images/(..*) "/u01/app/forms/as_1/forms/appname/icons/$1"
    However when I go to
    https://server/forms/help/help.pdf
    I get 404 .
    Is there something I am missing here. file permissions are read across the board and the directory exists.
    Is there some other configuraiton I am missing.
    Thanks!

    Was able to fix this problem.
    The following is hte resolution.
    In plan.xml
    1. At the very top create a variables.
    <variable>
    <name>vd-application</name>
    <value>/u01/middleware/wls_forms/forms/forms</value>
    </variable>
    <variable>
    At the bottom Add
    <variable-assignment>
    <name>vd-application</name>
    <xpath>/weblogic-web-app/virtual-directory-mapping/[url-pattern="help/*"]
    /local-path</xpath>
    </variable-assignment>

  • Struts Html tag problem in Weblogic 8.1

    Hi
    I am using weblogic8.1 Application server
    I have written a simple web application in struts that accepts
    username and password in "login.jsp" and corresponding "bean" ActionForm
    for the same.
    Below are my application source files......
    login.jsp
    <%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
    <%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
    <html:html>
    <head>Struts Test</head>
    <body bgcolor="#E6F1FC">
    <html:form action="login.do">
    <table>
    <tr>
    <td><html:text property="uname" value=" "/></td>
    <td><html:submit>SUBMIT</html:submit></td>
    </tr>
    </table>
    </html:form>
    </body>
    </html:html>
    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/dtd/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>/WEB-INF/struts-html.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
    </taglib>
    <taglib>
    <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
    </taglib>
    </web-app>
    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="LoginFrom" type="com.nit.StrutsEx.LoginFrom"/>
    </form-beans>
    <action-mappings>
    <action path="/login" type="com.nit.StrutsEx.LoginAction" name="LoginFrom" validate="false"
    input="/login.jsp">
    <forward name="success" path="/success.jsp"/>
    </action>
    </action-mappings>
    <message-resources parameter="ApplicationResource" null="false"/>
    </struts-config>
    ActionForm
    package com.nit.StrutsEx;
    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.action.*;
    import javax.servlet.*;
    import java.io.*;
    public class LoginForm extends ActionForm
    private String uname=null;
    public void setUname(String uname){
    this.uname=uname;
    public String getUname(){
    return this.uname;
    public void reset(ActionMapping am, HttpServletRequest req) {
    this.uname=null;
    public ActionErrors validate(ActionMapping am,HttpServletRequest req)
    System.out.println("I am in Validate");
    return null;
    ActionServlet
    package com.nit.StrutsEx;
    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 javax.servlet.*;
    import java.io.*;
    public class LoginAction extends Action
    public ActionForward execute(
    ActionMapping am,
    ActionForm af,
    HttpServletRequest req,
    HttpServletResponse res) throws ServletException , IOException
    return am.findForward("success");
    My application runs well under tomcat but when i deploy it on Weblogic 8.1 it gives following error
    Compilation of 'E:\bea\weblogic81\server\bin\.\myserver\.wlnotdelete\extract\myserver_stest_stest\jsp_servlet\__login.java' failed:
    E:\bea\weblogic81\server\bin\.\myserver\.wlnotdelete\extract\myserver_stest_stest\jsp_servlet\__login.java:151: cannot resolve symbol
    probably occurred due to an error in /login.jsp line 4:
    <html:html>
    E:\bea\weblogic81\server\bin\.\myserver\.wlnotdelete\extract\myserver_stest_stest\jsp_servlet\__login.java:168: cannot resolve symbol
    probably occurred due to an error in /login.jsp line 8:
    <html:form action="login.do">
    E:\bea\weblogic81\server\bin\.\myserver\.wlnotdelete\extract\myserver_stest_stest\jsp_servlet\__login.java:203: cannot resolve symbol
    probably occurred due to an error in /login.jsp line 13:
    <td><html:submit>SUBMIT</html:submit></td>
    E:\bea\weblogic81\server\bin\.\myserver\.wlnotdelete\extract\myserver_stest_stest\jsp_servlet\__login.java:216: cannot resolve symbol
    probably occurred due to an error in /login.jsp line 13:
    <td><html:submit>SUBMIT</html:submit></td>
    E:\bea\weblogic81\server\bin\.\myserver\.wlnotdelete\extract\myserver_stest_stest\jsp_servlet\__login.java:226: cannot resolve symbol
    probably occurred due to an error in /login.jsp line 16:
    </html:form>
    E:\bea\weblogic81\server\bin\.\myserver\.wlnotdelete\extract\myserver_stest_stest\jsp_servlet\__login.java:235: cannot resolve symbol
    probably occurred due to an error in /login.jsp line 18:
    </html:html>
    Full compiler error(s):
    E:\bea\weblogic81\server\bin\.\myserver\.wlnotdelete\extract\myserver_stest_stest\jsp_servlet\__login.java:151: cannot resolve symbol
    symbol : variable EVAL_BODY_BUFFERED
    location: interface javax.servlet.jsp.tagext.BodyTag
    if (_int0 == BodyTag.EVAL_BODY_BUFFERED) { //[ /login.jsp; Line: 4]
    ^
    E:\bea\weblogic81\server\bin\.\myserver\.wlnotdelete\extract\myserver_stest_stest\jsp_servlet\__login.java:168: cannot resolve symbol
    symbol : variable EVAL_BODY_BUFFERED
    location: interface javax.servlet.jsp.tagext.BodyTag
    if (_int1 == BodyTag.EVAL_BODY_BUFFERED) { //[ /login.jsp; Line: 8]
    ^
    E:\bea\weblogic81\server\bin\.\myserver\.wlnotdelete\extract\myserver_stest_stest\jsp_servlet\__login.java:203: cannot resolve symbol
    symbol : variable EVAL_BODY_BUFFERED
    location: interface javax.servlet.jsp.tagext.BodyTag
    if (_int2 == BodyTag.EVAL_BODY_BUFFERED) { //[ /login.jsp; Line: 13]
    ^
    E:\bea\weblogic81\server\bin\.\myserver\.wlnotdelete\extract\myserver_stest_stest\jsp_servlet\__login.java:216: cannot resolve symbol
    symbol : variable EVAL_BODY_BUFFERED
    location: interface javax.servlet.jsp.tagext.BodyTag
    if (_int2 == BodyTag.EVAL_BODY_BUFFERED) out = pageContext.popBody(); //[ /login.jsp; Line: 13]
    ^
    E:\bea\weblogic81\server\bin\.\myserver\.wlnotdelete\extract\myserver_stest_stest\jsp_servlet\__login.java:226: cannot resolve symbol
    symbol : method doAfterBody ()
    location: class org.apache.struts.taglib.html.FormTag
    } while (_html_form0.doAfterBody() == IterationTag.EVAL_BODY_AGAIN); //[ /login.jsp; Line: 16]
    ^
    E:\bea\weblogic81\server\bin\.\myserver\.wlnotdelete\extract\myserver_stest_stest\jsp_servlet\__login.java:235: cannot resolve symbol
    symbol : method doAfterBody ()
    location: class org.apache.struts.taglib.html.HtmlTag
    } while (_html_html0.doAfterBody() == IterationTag.EVAL_BODY_AGAIN); //[ /login.jsp; Line: 18]
    ^
    6 errors
    Wed Jul 25 17:06:07 GMT+05:30 2007
    Please reply the solution

    I don't know about that, but I am using MyFaces and tomahawk with WLS8.1 sp5 jdk1.4.2_05 and it works fine.
    I do remember getting such an error when I moved from Sun RI to MyFaces and all I can recall is that it was a commons library mismatch problem or some classpath problem...

  • Action listener for struts html tag

    hi i am doing a project using sturts. I have used struts HTML Select tag with a collection of values in select box. now i want to write an actionlistner for that select...ie if i select any value from the select list it should do some action like take me to different page...can anyone tell me how can i do that...
    Thanks

    Soultech, I think you're being a bit harsh. Struts is a valid topic on this forum as it is a java framework related to JSP.
    However having said that, the question does show a basic misunderstanding of JSP technology.
    JSP = Java SERVER Pages. Java code only runs on the server.
    All that gets sent to the client (browser) is an HTML file.
    You can not write java action listeners to run and respond to events on the client.
    For any client side interaction you will have to use javascript (which is NOT java) - probably an onclick/onchange event - the same as any other web page.
    However you can only run javascript code from such events.
    To run java again you have to submit a request to a server - normally done by submitting a form.

  • Query on struts html:optionsCollection tag !

    Hi,
    I've a query on struts <html:optionsCollection tag. I'm trying to render the values of an arraylist using the optionsCollection . The arraylist is stored as a part of form object. But the issue is that each row of arraylist contains a string data. The arraylist is returned by a remote process.Now, when I use the following struts code,
    <html:select property="userProxy" size="1" >
    <html:optionsCollection property="userProxy" value="" label=""/>
    </html:select>
    what shud be the value for value and label , as the arraylist contains only one string per row . The userProxy is the arraylist field defined in the form object.
    My question, will I be able to use the <html:optionsCollection tag in this scenerio ?
    I'll really appreciate if someone can get back to me on this.
    Thnx

    The html:optionsCollection tag is designed to work with a collection of beans, each with a "label" and "value" attribute.
    If you only have a list of strings, then you probably want to use the html:options tag.
    Note that your ActionForm should have two attributes
    // form bean"
    String userProxy;  //stores the currently selected userProxy
    List userProxyList;  //list of userProxies.
    // assume appropriate get/set methods
    // the jsp page:
    <html:select property="userProxy" size="1" >
      <html:options property="userProxyList"/>
    </html:select>Cheers,
    evnafets

  • ADF/Struts Generated tag code variations? Struts html:text vs Html input

    Hi,
    JDev 10.1.2.1
    ADF/Struts
    I noticed that the JDev IDE generates different code for a same component/binding combination.
    Example:Data Control of type Input form with same VO selection.
    Generated code for 1 field:
    case 1)
    JSP code:
    <tr>
    <td>
    <c:out value="${bindings['TitleLang1'].label}"/>
    </td>
    <td>
    <html:text property="TitleLang1"/>
    </td>
    </tr>
    HTML output:
    <tr>
    <td>
    Short Title Language 1
    </td>
    <td>
    <input type="text" name="TitleLang1" value="Preliminary Demo">
    </td>
    </tr>
    case 2)
    JSP code:
    <tr>
    <td>
    <c:out value="${bindings['TitleLang1'].label}"/>
    </td>
    <td>
    <input type="text" name="<c:out value='${bindings.TitleLang1.path}'/>" value="<c:out value='${bindings.TitleLang1}'/>"/>
    </td>
    </tr>
    HTML output:
    <tr>
    <td>
    Short Title Language 1
    </td>
    <td>
    <input type="text" name="VB_TitleLang1" value="Preliminary Demo"/>
    </td>
    </tr>
    Case 1 generated code is obvious to me, the html name of the field equals the field binding id.
    In Case 2, the VB_ prefix is added and the binding variable references bindings.fieldName.path?
    Could someone explain me the second flavor?
    When should we use the path reference and replace the Struts html:text tag with html input tag?
    Thanks
    Fred

    I dont think you can mix static values and rt expressions together in attribute values.
    String onBlurString = "dontLeaveItEmpty(this);referenceEntered(" + recordNumber + ")" ;
    html:text styleClass="textFieldInTable" name="refrences" property="referenceName" onblur="<%=onBlurString%>" />cheers,
    ram.

Maybe you are looking for

  • Storage rules for an editing rig. Some basics.

    How do you set up your editing machine in terms of disks for maximum performance and reliability? (SSD's are left out here.) This is a question that often arises and all too often one sees that initial settings are really suboptimal. These rules are

  • How to freeze the selection column in the table control of the module pool.

    hi , in my module pool there is a row selection field  <b>w/selcolumn</b> of the table control called as mark. how to freeze the selection column where there is no record in the table control row. or in other words where wa is initial. thanks ekta

  • Can I set up folders in the numbers app

    Hi, Can anyone tell me hoe to sut up folders in both numbers and pages Thanks

  • Restrict data only up to last week

    Hi, I got a keyfigure in query which has to be restricted only up to completed week. For eg. Case 1. If we run this report in any week days it should fetch data till last completed week. So it should not consider data till date. Case 2. If we run thi

  • Will Final Cut Pro work on the 2014 macbook air?

    I recently purchased an early-2014 13-inch 128 GB Macbook Air. I have done my research about video-editing software and would like to use Final Cut Pro. Would my air be able to handle it or is my only option using iMovie?