html:select Struts tag problems

hello
I've a bean "Profile" in my sessionScope under name "myProfile"
This bean is defined as
public class Profile implements java.io.Serializable  {
     private User user;
     private List<Groups> groups;
     private List<Function> function;
     private List<Services> services;
     etc. .-.... getter and setter.....
}the "services list" is full of data
now in my jsp I want to print all the services in a select box. I'm using struts so I do
<html:select property="serviceId">
      <html:options collection="${myProfile.services}" property="idSoc" labelProperty="descrizione" />
                    </html:select>it doesn't works..the console says
Cannot find bean under name [it.object.Services@16b5518, it.object.Services@19fdafc]
I've read the documentation.. but I don't understand if in the collection attribute I can put only the name of a bean that identify a collection...
I can't use EL?
I try do use a bean:define and to put its name in the collection attribute
<bean:define id="myBean" value="${myProfile.services}"/>
               <html:select property="societaId" >
                         <html:options collection="myBean" property="idSoc" labelProperty="descrizione" />
                    </html:select>but it still doesn't work.. it says
Cannot create iterator for [it.object.Services@16b5518, it.object.Services@19fdafc]
what the way to solve this problem
thanks
martina

<html:select>
<html:optionsCollection name = "myProfile"
property = "services" value ="idSoc" label =
"descrizione"/>
/html:select>yes evnafets
you're right
this code works!
but there's a problem. To simplify this post I say I've a bean with a Collection inside that I want to iterate.
In my real application I've a session bean with another bean inside that contains the Collection. I've one more level (3 levels instead 2)
whit the code you suggest I can't search inside it...
I mean over myProfile I've onother bean that contains it and it's in the session
bean1 -> myProfile -> List of Services
from the session I can take by name only the "bean1"
do you know what's the solution in this case?
I've used some code like this
<bean:define id="myBean" name="bean1" property="profilo"></bean:define>
<html:select>
        <html:optionsCollection name = "myBean" property = "services" value ="idSoc" label = "descrizione"/>
</html:select>it works..as you suggest I can specify only attribute names so I think this is the right way... or?!
thanks a lot for yor help
martina

Similar Messages

  • Struts tag problems in weblogic 5.1 sp12

              Hello,
              I am deploying a struts application in weblogic 5.1 sp 12. When I load any jsp
              page with a struts tag, e.g. <html:html>, it will throw exceptions as follows:
              Parsing of JSP File '/Feedback.jsp' failed:
              /Feedback.jsp(-1): Error in tag library at: 'bean': error introspecting class:
              'org.apache.struts.taglib.bean.CookieTag': weblogic.servlet.jsp.JspException:
              (line -1): Error in tag library at: 'bean': class org.apache.struts.taglib.bean.CookieTag
              doesn't implement javax.servlet.jsp.tagext.Tag
              probably occurred due to an error in /Feedback.jsp line -1:
              any comment is highly appreciated! I am following the directions posted on apache
              website about instaling struts with weblogic 5.1.
              

              Hello,
              I am deploying a struts application in weblogic 5.1 sp 12. When I load any jsp
              page with a struts tag, e.g. <html:html>, it will throw exceptions as follows:
              Parsing of JSP File '/Feedback.jsp' failed:
              /Feedback.jsp(-1): Error in tag library at: 'bean': error introspecting class:
              'org.apache.struts.taglib.bean.CookieTag': weblogic.servlet.jsp.JspException:
              (line -1): Error in tag library at: 'bean': class org.apache.struts.taglib.bean.CookieTag
              doesn't implement javax.servlet.jsp.tagext.Tag
              probably occurred due to an error in /Feedback.jsp line -1:
              any comment is highly appreciated! I am following the directions posted on apache
              website about instaling struts with weblogic 5.1.
              

  • How to get the values from html:select? tag..?

    i tried with this, but its not working...
    <html:select styleClass="text" name="querydefs" property="shortcut"
                 onchange="retrieveOptions()" styleId="firstBox" indexed="true">
    <html:options collection="advanced.choices" property="shortcut" labelProperty="label" />
    </html:select>
                        <td align="left" class="rowcolor1">
                        <script language="javascript" type="text/javascript">
                              function retrieveOptions(){
                             var sel = document.querydefs.options;
                             var selectedOption = sel[sel.selectedIndex].value;
                             document.write(selectedOption);
                           </script>

    <td align="left" class="rowcolor1">
                        <script language="javascript" type="text/javascript">
                              function retrieveOptions(){
                             var sel = document.querydefs.options;
                             var selectedOption = sel[sel.selectedIndex].value;
                             document.write(selectedOption);
                           </script>This java script is not working at all..its not printing anything in document.write();
    This is code..
    <td class="rowcolor1" width="20%">
    <html:select styleClass="text" name="querydefs" property="shortcut"
                             onchange="retrieveSecondOptions()" styleId="firstBox"
                             indexed="true">
                             <html:options collection="advanced.choices" property="shortcut"
                                  labelProperty="label"  />
                        </html:select>i tried with this also. but no use..i'm not the getting the seleced option...
    function retrieveOptions(){
    firstBox = document.getElementById('firstBox');
                             if(firstBox.selectedIndex==0){
          return;
        selectedOption = firstBox.options[firstBox.selectedIndex].value;
    }actually , how to get the values from <html:select> ...?
    my idea is to know which value is selected from the combo box(<html:select> ) if that value is equal some string i have enable a hyperlink to open a popup window

  • Struts tag problem when migrating to 7.0 from 5.1

              We currently have an application using struts running on WLS 5.1. When we use the
              application
              on WLS 7.0 and WLE 7.0 we get errors for the tag properties that are not defined
              in the tag
              library. In 5.1 WLS seemed to just ignore them and rewrite them but in 7.0 it
              seems to validate them so we can't actually include regular HTML tags.
              The JSP is:
              ', 'Terms', 600, 800 );">
              <html:img page="/jsp/images/viewbill.gif" width="78" height="19"
              border="0" target="_blank"/>
              </a>
              and the error message we are getting is:
              Parsing of JSP File '/jsp/pages/ViewMyBill.jsp' failed:
              /jsp/pages/ViewMyBill.jsp(40): for tag 'img' handler type 'org.apache.struts.taglib.html.ImgTag'
              has no property 'target'
              probably occurred due to an error in /jsp/pages/ViewMyBill.jsp line 40:
              </a>
              Wed Oct 29 11:21:50 GMT 2003 [Exception in:/jsp/pages/ViewMyBill.jsp] (line 40):
              for
              tag 'img' handler type 'org.apache.struts.taglib.html.ImgTag' has no property
              'target'
              weblogic.servlet.jsp.JspException: (line 40): for tag 'img' handler type 'org.apache.struts.taglib.html.ImgTag'
              has no property 'target' at
              weblogic.servlet.jsp.StandardTagLib.jspException(StandardTagLib.java:1087) at
              weblogic.servlet.jsp.StandardTagLib.addAllSetters(StandardTagLib.java:960) at
              weblogic.servlet.jsp.StandardTagLib.genericStartBegin(StandardTagLib.java:716)
              at
              weblogic.servlet.jsp.StandardTagLib.processStartTag(StandardTagLib.java:813) at
              weblogic.servlet.jsp.JspLexer.mOPEN_EXTENSION_TAG(JspLexer.java:2652) at
              weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:2013) at
              weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java:1892) at
              <snip>
              In 5.1 this would result in the following HTML tag:
              <a href="javascript:openBareScrollableWindow( '/selfcare/GoViewMyBill.do',
              'Terms', 600, 800 );">
              <img src="/selfcare/jsp/images/viewbill.gif" height="19"
              width="78" border="0">
              </a>
              The struts.jar is located correctly in the WEB-INF/lib folder as are the tag libraries
              - it's the
              same folder structure for 5.1 and 7.0.
              Any ideas on what's wrong here appreciated.
              Thanks in advance,
              Brian Flannagan
              BT

              In the tld file include 'target' attribute for tag ImgTag.
              thanks,
              Deepak
              "Brian Flannagan" <[email protected]> wrote:
              >
              >We currently have an application using struts running on WLS 5.1. When
              >we use the
              >application
              >on WLS 7.0 and WLE 7.0 we get errors for the tag properties that are
              >not defined
              >in the tag
              >library. In 5.1 WLS seemed to just ignore them and rewrite them but in
              >7.0 it
              >seems to validate them so we can't actually include regular HTML tags.
              >
              >The JSP is:
              > ', 'Terms', 600, 800 );">
              > <html:img page="/jsp/images/viewbill.gif" width="78"
              >height="19"
              >border="0" target="_blank"/>
              > </a>
              >
              >and the error message we are getting is:
              >Parsing of JSP File '/jsp/pages/ViewMyBill.jsp' failed:
              >--------------------------------------------------------------------------------
              > /jsp/pages/ViewMyBill.jsp(40): for tag 'img' handler type 'org.apache.struts.taglib.html.ImgTag'
              >has no property 'target'
              >probably occurred due to an error in /jsp/pages/ViewMyBill.jsp line 40:
              ></a>
              >--------------------------------------------------------------------------------
              >
              >Wed Oct 29 11:21:50 GMT 2003 [Exception in:/jsp/pages/ViewMyBill.jsp]
              >(line 40):
              >for
              >tag 'img' handler type 'org.apache.struts.taglib.html.ImgTag' has no
              >property
              >'target'
              >weblogic.servlet.jsp.JspException: (line 40): for tag 'img' handler type
              >'org.apache.struts.taglib.html.ImgTag'
              >has no property 'target' at
              >weblogic.servlet.jsp.StandardTagLib.jspException(StandardTagLib.java:1087)
              >at
              >
              >weblogic.servlet.jsp.StandardTagLib.addAllSetters(StandardTagLib.java:960)
              >at
              >
              >weblogic.servlet.jsp.StandardTagLib.genericStartBegin(StandardTagLib.java:716)
              >at
              >weblogic.servlet.jsp.StandardTagLib.processStartTag(StandardTagLib.java:813)
              >at
              >
              >weblogic.servlet.jsp.JspLexer.mOPEN_EXTENSION_TAG(JspLexer.java:2652)
              >at
              >weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:2013) at
              >weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java:1892) at
              >
              ><snip>
              >
              >
              >In 5.1 this would result in the following HTML tag:
              >
              > <a href="javascript:openBareScrollableWindow( '/selfcare/GoViewMyBill.do',
              >'Terms', 600, 800 );">
              > <img src="/selfcare/jsp/images/viewbill.gif" height="19"
              >width="78" border="0">
              >
              > </a>
              >
              >
              >The struts.jar is located correctly in the WEB-INF/lib folder as are
              >the tag libraries
              >- it's the
              >same folder structure for 5.1 and 7.0.
              >
              >Any ideas on what's wrong here appreciated.
              >
              >Thanks in advance,
              >
              >Brian Flannagan
              >BT
              >

  • How to load data into html:select using Struts ?

    How to load data into <html:select> using Struts ?
    I can not load an array or collection (static or dynamic data) into drop down list control by <html:select /> Struts.
    please use:
    <html:select >
    <html:options />
    </html:select >
    Please help me. please detail it. thanks a lot.
    Message was edited by:
    tranminhman

    In order to load a collection or array of data you can use <html:select> with <html: options collection="" name=""/>
    here collection attribute refers to the Arraylist or Array of data and name is the name of the Form bean.
    Hope this helps...
    Chaitanya V

  • Problem with html:select or html:options tags using struts,jsp and tomcat

    Hi
    I'm updating a Struts-Project to a new layout and therefore rework all jsp Sites.
    I'm also using a new Folder-Structure and update therefore my struts-config file.
    My Problem now is:
    Till now, we had a select-field with a code like this:
    < html:form action="/timetableAction" method="POST">
    < table width="53%" border="0">
    < tr>
    < td>< html:radio property="dauer" value="semester"
    /></ td>
    < html:select property="semester" size="1">
    < htmlptions name="semesterList" />
    </ html:select>
    </ html:form>
    The problem now is, that whenever I use any <html:xy> tag, the tomcat server I use can not show the page, he shows just the headers of the template, but not the
    content.-jsp-File where the form would be in. He stops right in the middle of the html page, when he notices the <html:xy> tags.
    And the funny thing is, that he has no problem to show a page when there is a <html:errors> within it? Why could this be? the struts-html.tld File is well included and teh Tomcat Server shows no exceptions.
    Waiting for you answers and thanks

    Thank you, I already got the answer in another forum

  • Help! Problem with Struts tag html:errors/

    Hi everybody,
    In my JSP page called addUser.jsp, i have the different Struts Tag
    <html:errors/>
    <html:form action="/addUser" focus="firstName">
    </html:form>
    I have of course the ApplicationResources.properties file with differents Struts properties:
    errors.footer=</ul><hr>
    errors.header=<h3><font color="red">Validation Error</font></h3>You must correct the following error(s) before proceeding:<ul>
    errors.ioException=I/O exception rendering error messages: {0}
    and an other one:
    error.fieldsNeeded=<font color="#FF0000">Some fields are missing.</font>
    when I call the addUser form, my JSP page display:
    null Some fields are missing. null
    Have u any suggestion about my prob?
    tx a lot
    s.

    Hi,
    can u post the java code where u are actually adding the error to the action errors. may be there is something wrong with that. I dont see any problem with the jsp or the applicationsResources.properties.
    Thanks
    Latha

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

  • How to make  struts html:select tag readOnly....!!!!

    Hi All,
    In my below code I want to make <html:select> as readonly like I did for <html:text>
    I don't want to make it disabled as it is graying out that field.
    My requirement is that it should be visible and also it shouldn't be editable.
    I am using Struts...!!!
    <html:text property="paramName" size="20" maxlength="50" readonly="true"/>                                
    <html:select property="paramTypeId" disabled="true"> // I dont want to use this--- disabled="true"
         <html:options collection="queryReturnType" property="value" labelProperty="label"/>
    </html:select>Thanks in advance....!!

    Can some one tell me in the below code
    *1. what is test="${controlEnabled}"....wha is this controlEnabled variable*
    *2. do I need to create an attribute for paramTypeId_Label in my form bean ??*
    I just wanna to make my <html:select> readonly..pls see my first post in this thread....!!
    <c:choose>
         <c:when test="${controlEnabled}">
           <html:select property="paramTypeId" >
                <html:options collection="queryReturnType" property="value" labelProperty="label"/>
           </html:select>
         </c:when>
         <c:otherwise
           <html:text property="paramTypeId_Label" value="${queryReturnType[paramTypeId].label}" readonly="true"/>
           <html:hidden property="paramTypeId"/>
         </c:otherwise>
    </c:choose>--Thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Problem in submiting the form onchange of html:select

    I am using WSAD 5.0 and working on a small application with struts.
    I have following code where I want to submit the form if user selects any option from the list. Problem is when i select any option it is giving error that this property is not supported. Following is my code
    <html:form action="/NewUserAction1">
    <tr>
                   <td>
                        <font color="Blue">
                             <b><bean:message key="NewUser1.CountryName" /></b>
                        </font>*
                   </td>
                   <td>
                        <html:select property="state" onchange="submit();">
                             <html:option value="default">select state</html:option>
                             <html:option value="bangalore">Bangalore</html:option>
                             <html:option value="delhi">Delhi</html:option>
                        </html:select>
                   </td>
              </tr>
         </html:form>
    Please help me someone why i am not able to submit the form on onchange event of <html:select>
    Thanks.

    I got the solution :)
    Finally I figured out that
    by default, struts gives <html:submit/> tags a name of
    "submit". Thus there was a namespace collision in the
    form object, with the submit button overriding the
    form's submit method. I fixed the problem by changing
    the name of the submit button. Something like this
    works great:
    <html:submit property="submitPage">
                        <bean:message key="NewUse1.Submit"/>
                   </html:submit></td>
    Now i am able to submit the form.
    Thanks alot.

  • Use of titleKey attribute in html:select tag

    Hi,
    There is one "titleKey" attribute to create mouse over pop-up texts taking key values from property files in case of i18n. It works for every struts specific tag like <html:text titleKey="help.rmc.name"/> or <html:checkbox titleKey="help.rmc.name"/> except for <html:select> tag which is used for creating combo box or list box. But this tag contains the titleKey attribute.
    Please give me some suggestions how to implement this mouse over pop-up texts in case of <html:select> tag

    Hi,
    There is one "titleKey" attribute to create mouse over pop-up texts taking key values from property files in case of i18n. It works for every struts specific tag like <html:text titleKey="help.rmc.name"/> or <html:checkbox titleKey="help.rmc.name"/> except for <html:select> tag which is used for creating combo box or list box. But this tag contains the titleKey attribute.
    Please give me some suggestions how to implement this mouse over pop-up texts in case of <html:select> tag

  • Html:select tag

    Hi all,
    In my jsp page i am using struts html:select tag,some contents are not fitting in the alloted size so i want to give horizontal scrolling for this select box,pls any body can tell me which property of select tag can be used,or any html tricks by which i can achive horizontal scrolling.examples will be help full.
    thanks,

    There aren't any tricks. This has nothing to do with Struts or JSP. It only has to to with HTML. The width is controlled by the size of the options or the size of the HTML area it has to display in. The latter if it's restricted otherwise by some table cell's width. I don't believe that I've ever seen a select box which has horizontol scrolling in any browser ever.

  • Problem in html:select

    MY problem is
    my html:select
    <html:select property = "planetID" size = "1">
    <html:option value = "1">one</html:option>
    <html:option value = "2">two</html:option>
    <html:option value = "3">three</html:option>
    <html:option value = "4">four</html:option>
    </html:select>
    when user vist this page i want[b] three to be selected in html:select
    i have tried using
    <html:option value = "3" selected>three</html:option> but it is not working
    please help me this is urgent

    If you want to select an option by default, you should specify it in the struts-config.xml int the form bean.
    <form-property name="month"  initial="0"   type="java.lang.String" />

  • Please help me to get knowledge about struts tags(html,bean,logic).

    hai Friends,
    I know basics of struts. I have done basic examples.
    I have to know , how to get dynamic values in "view".
    Instead of writing like this..
    <html:select property="color1" size="4" >
    <html:option value="red">red</html:option>
    <html:option value="blue">blue</html:option>
    <html:option value="green">green</html:option>
    <html:option value="orange">orange</html:option>
    <html:option value="red">red</html:option>
    <html:option value="pink">pink</html:option>
    </html:select>
    How to use <html:options> tag to get dynamic values.
    I have to get knowledge about this tags, so please suggest some
    sites (or) send some materials (or) send some live examples("[email protected]"). It will very useful..
    thanks friends....
    take care...
    bye.....
    will be very useful for me...

    you have to have a list of label and value pairs in you ActionForm then define it in your jsp to able able to use it in your <html:options> tag
    ActionForm
    public final class ColorForm extends ActionForm {
        public String color;
        public void setColor(String color) {
            this.color = color;
        public String getColor() {
            return this.color;
        public List getColorList() {
            List l = new ArrayList();
            ColorLabelValueBean lvRed = new ColorLabelValueBean();
            lv.setLabel("Red");
            lv.setValue("R");
            l.add(lv);
            ColorLabelValueBean lvGreen = new ColorLabelValueBean();
            lv.setLabel("Green");
            lv.setValue("G");
            l.add(lv);
            ColorLabelValueBean lvBlue = new ColorLabelValueBean();
            lv.setLabel("Blue");
            lv.setValue("B");
            l.add(lv);
            return l;
    }Label - Value Bean
    public final class ColorLabelValueBean implements Serializable {
        private String label;
        private String value;
        public void setLabel(String label) {
            this.label = label;
        public String getLabel() {
            return this.label;
        public void setValue(String value) {
            this.value = value;
        public String getValue() {
            return this.value;
    }JSP
    <bean:define id="colorListOption" name="ColorForm" property="colorList" type="java.util.List" />
    <html:select property="color">
         <html:option value=""></html:option>
         <html:options collection="colorListOption" labelProperty="label" property="value" />
    </html:select>
    ...Good luck!

  • Where can I get an Html error report of all the syntax and tag problems?

    Where can I get an Html error report of all the syntax and tag problems?

    Thank you for your answer.
    Where is the DW validation for me?
    My files are in my computer so I don’t have an external URL.
    File > validation > as xml = closes DW... Maybe because it is not a correct command for HTML,
    And
    Window > results > validation = gives a partial mistakes (e.g. shows an open tag without closing tag, but doesn’t show a closing tag without an open tag).
    Thank you.

Maybe you are looking for