Re: how do I use absolute url actions in html:form tag with struts 1.3.8
I'll echo the question of "why would you want to?", but it's easy to accomplish if you're not insistent on using the tag: " method="GET" action=""> ... -Brian P.S. Is it just me, or is the documentation on the struts form tag a bit lacking in examples? On Sun, Jan 3, 2010 at 1:28 AM, Paul Benedict wrote: > I don't think you can. Why would you want to? > > On Tue, Dec 22, 2009 at 8:01 PM, Jason Novotny > wrote: > > Hi, > > > >I'm a Struts newbie and am tasked with trying to change relative URLs > on > > our site to be absolute. I have a form that looks like: > > > > > > > > and once it renders it displays: > > > > action="/modules/mymodule/fcon/MyAction.do" > > onsubmit="return validateFilterForm(event, this);"> > > > > What I'd like is to have it render an absolute URL: > > > > > action="http://www.mysite.com/modules/mymodule/fcon/MyAction.do"; > > onsubmit="return validateFilterForm(event, this);"> > > > > How can I do this? > > > >Thanks a lot, Jason > > > > - > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > > For additional commands, e-mail: user-h...@struts.apache.org > > > > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > >
Re: how do I use absolute url actions in html:form tag with struts 1.3.8
I don't think you can. Why would you want to? On Tue, Dec 22, 2009 at 8:01 PM, Jason Novotny wrote: > Hi, > > I'm a Struts newbie and am tasked with trying to change relative URLs on > our site to be absolute. I have a form that looks like: > > > > and once it renders it displays: > > onsubmit="return validateFilterForm(event, this);"> > > What I'd like is to have it render an absolute URL: > > action="http://www.mysite.com/modules/mymodule/fcon/MyAction.do"; > onsubmit="return validateFilterForm(event, this);"> > > How can I do this? > > Thanks a lot, Jason > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
how do I use absolute url actions in html:form tag with struts 1.3.8
Hi, I'm a Struts newbie and am tasked with trying to change relative URLs on our site to be absolute. I have a form that looks like: and once it renders it displays: action="/modules/mymodule/fcon/MyAction.do" onsubmit="return validateFilterForm(event, this);"> What I'd like is to have it render an absolute URL: action="http://www.mysite.com/modules/mymodule/fcon/MyAction.do"; onsubmit="return validateFilterForm(event, this);"> How can I do this? Thanks a lot, Jason - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: html:form windowstate
Are you using the struts 1 portlet bridge? (http://portals.apache.org/bridges/multiproject/portals-bridges-struts) Haven't used it myself, but I'd be surprised if the framework didn't support creating portlet urls. I have only used a WebSphere Portal-proprietary extension which (from what I remember) created portlet urls automatically. Nils-H On Tue, Dec 16, 2008 at 5:27 PM, Evert Lammerts wrote: > Hi Nils, > > I've tried your suggestion but it doesn't seem to be possible. The action > attribute in html:form expects an Action URI, while actionURL creates an > absolute URL. Still, being a beginner with this, I'm pretty sure I'm missing > something - I guess it IS possible to create a form tag that submits to a > WindowState.MAXIMIZED state. > > Thanks, Evert Lammerts > > -Original Message- > From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] > Sent: dinsdag 16 december 2008 13:07 > To: Struts Users Mailing List > Subject: Re: html:form windowstate > > You can probably use the 'var' attribute of the portlet:actionURL tag > to store the url as a variable which you can reference by an > expression in the html:form tag. Take a look at the tag reference for > the portlet tags (PLT.22.2) in the JSR168 spec [1] for details. > > Nils-H > > [1] - http://jcp.org/aboutJava/communityprocess/final/jsr168/index.html > > On Tue, Dec 16, 2008 at 12:47 PM, Evert Lammerts > wrote: >> Hi all, >> >> Using struts 1.3.8 I'm trying to use the struts-html taglib to create a form >> attribute that submits the form to a maximized window state, like possible >> with the actionURL tag: >> >> > WindowState.MAXIMIZED.toString() %>"> >> >>" >>method="POST"> >> >> Is there a way to do this? Maybe with a hidden form input? >> >> Thanks, >> Evert Lammerts >> > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: html:form windowstate
Hi Nils, I've tried your suggestion but it doesn't seem to be possible. The action attribute in html:form expects an Action URI, while actionURL creates an absolute URL. Still, being a beginner with this, I'm pretty sure I'm missing something - I guess it IS possible to create a form tag that submits to a WindowState.MAXIMIZED state. Thanks, Evert Lammerts -Original Message- From: Nils-Helge Garli Hegvik [mailto:nil...@gmail.com] Sent: dinsdag 16 december 2008 13:07 To: Struts Users Mailing List Subject: Re: html:form windowstate You can probably use the 'var' attribute of the portlet:actionURL tag to store the url as a variable which you can reference by an expression in the html:form tag. Take a look at the tag reference for the portlet tags (PLT.22.2) in the JSR168 spec [1] for details. Nils-H [1] - http://jcp.org/aboutJava/communityprocess/final/jsr168/index.html On Tue, Dec 16, 2008 at 12:47 PM, Evert Lammerts wrote: > Hi all, > > Using struts 1.3.8 I'm trying to use the struts-html taglib to create a form > attribute that submits the form to a maximized window state, like possible > with the actionURL tag: > > WindowState.MAXIMIZED.toString() %>"> > >" >method="POST"> > > Is there a way to do this? Maybe with a hidden form input? > > Thanks, > Evert Lammerts > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: html:form windowstate
You can probably use the 'var' attribute of the portlet:actionURL tag to store the url as a variable which you can reference by an expression in the html:form tag. Take a look at the tag reference for the portlet tags (PLT.22.2) in the JSR168 spec [1] for details. Nils-H [1] - http://jcp.org/aboutJava/communityprocess/final/jsr168/index.html On Tue, Dec 16, 2008 at 12:47 PM, Evert Lammerts wrote: > Hi all, > > Using struts 1.3.8 I'm trying to use the struts-html taglib to create a form > attribute that submits the form to a maximized window state, like possible > with the actionURL tag: > > WindowState.MAXIMIZED.toString() %>"> > >" >method="POST"> > > Is there a way to do this? Maybe with a hidden form input? > > Thanks, > Evert Lammerts > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
html:form windowstate
Hi all, Using struts 1.3.8 I'm trying to use the struts-html taglib to create a form attribute that submits the form to a maximized window state, like possible with the actionURL tag: "> " method="POST"> Is there a way to do this? Maybe with a hidden form input? Thanks, Evert Lammerts
RE: More html:form TAG in one page for struts 1
If the functionality provided by the 2 different classes is similar: You could use a dispatchaction instead of two different Action classes. Just give the submit buttons different values. EG: Public MyDispatchAction extends DispatchAction { void dispatchMethod(mapping, form, request, response, name) { name = nameform.getSubmit().trim(); super(mapping, form, request, response, name); } ActionForward add(mapping, form, request, response) { ... } ActionForward delete(mapping, form, request, response) { ... } } -Original Message- From: D'Ottavio Alessandro [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 22, 2008 11:47 AM To: Struts Users Mailing List Subject: R: More html:form TAG in one page for struts 1 Ciao Antonio, Actually I'm using 2 different actions and in both the action I have associated the same formBean, but you gave me one idea: if I create the FormBeanA associate with the ActionA (specific properties with getter and setter and validate specific only for that properties requested by function A need) struts automatically will valorised the bean using the setter present... and the same will be done for the Action B with the associated FormBeanB this will solve the problem of the validation and mean that I can use more html:form tag associate at the same page because the submit will request one specific action and the ActionServlet will populated the specific Bean But in this way I have another problem :) When I populate the FormA and I submit, the result could populate the filed of the FormB. That mean that when I submit the function A I should put manually in the request also the FormB FormBean? Struts will understand automatically that there is that bean? Actually the framework automatically will populate formA with BeanA because is in the action activated, but for the formB and BeanB? Or is there another way to populate the fields of one form that is not using the FormBean properties? Thanks 2008/10/22 D'Ottavio Alessandro <[EMAIL PROTECTED]>: > I have one page and one FormBean that is populated by the form but I > would like have 2 FormBean and 2 form associated at the same page Are you going to use 1 or 2 actions? Because you can associate only 1 form bean to 1 action, but the same form bean can be associated to more than one action. Antonio Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: R: More html:form TAG in one page for struts 1
2008/10/22 D'Ottavio Alessandro <[EMAIL PROTECTED]>: > if I create the FormBeanA associate with the ActionA (specific > properties with getter and setter and validate specific only for that > properties requested by function A need) struts automatically will > valorised the bean using the setter present... > and the same will be done for the Action B with the associated FormBeanB > > this will solve the problem of the validation and mean that I can use > more html:form tag associate at the same page because the submit will > request one specific action and the ActionServlet will populated the > specific Bean OK. > > > But in this way I have another problem :) > > When I populate the FormA and I submit, the result could populate the > filed of the FormB. > That mean that when I submit the function A I should put manually in the > request also the FormB FormBean? When you submit a form, only that form will be populated, the other one in the page won't. This is related to HTTP (when you press "submit" of a form, only the fields of that form are submitted) not to Struts. > Struts will understand automatically that there is that bean? > Actually the framework automatically will populate formA with BeanA > because is in the action activated, but for the formB and BeanB? If you reason in terms of HTTP requests everything becomes clear: each field is translated into HTTP parameters, each form name (or "id") is translated into the name of the form bean, each action (of tag) is translated into a Struts action. This way, you can see that the two forms are completely independent, so Struts won't get confused. What you can do is mixing up fields: you cannot submit a field that belongs to another form. Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
R: More html:form TAG in one page for struts 1
Ciao Antonio, Actually I'm using 2 different actions and in both the action I have associated the same formBean, but you gave me one idea: if I create the FormBeanA associate with the ActionA (specific properties with getter and setter and validate specific only for that properties requested by function A need) struts automatically will valorised the bean using the setter present... and the same will be done for the Action B with the associated FormBeanB this will solve the problem of the validation and mean that I can use more html:form tag associate at the same page because the submit will request one specific action and the ActionServlet will populated the specific Bean But in this way I have another problem :) When I populate the FormA and I submit, the result could populate the filed of the FormB. That mean that when I submit the function A I should put manually in the request also the FormB FormBean? Struts will understand automatically that there is that bean? Actually the framework automatically will populate formA with BeanA because is in the action activated, but for the formB and BeanB? Or is there another way to populate the fields of one form that is not using the FormBean properties? Thanks 2008/10/22 D'Ottavio Alessandro <[EMAIL PROTECTED]>: > I have one page and one FormBean that is populated by the form but I > would like have 2 FormBean and 2 form associated at the same page Are you going to use 1 or 2 actions? Because you can associate only 1 form bean to 1 action, but the same form bean can be associated to more than one action. Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] "Questo messaggio ed ogni suo allegato sono confidenziali e possono essere riservati o, comunque, protetti dall'essere diffusi. Se il ricevente non é il destinatario diretto del presente messaggio, é pregato di contattare l'originario mittente e di cancellare questo messaggio ed ogni suo allegato dal sistema di posta. Se il ricevente non é il destinatario diretto del presente messaggio, sono vietati l'uso, la riproduzione e la stampa di questo messaggio e di ogni suo allegato, nonché la diffusione del loro contenuto a qualsiasi altro soggetto" * "This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please contact the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not use, copy or print this message or attachment or disclose the contents to any other person." - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: More html:form TAG in one page for struts 1
2008/10/22 D'Ottavio Alessandro <[EMAIL PROTECTED]>: > I have one page and one FormBean that is populated by the form but I > would like have 2 FormBean and 2 form associated at the same page Are you going to use 1 or 2 actions? Because you can associate only 1 form bean to 1 action, but the same form bean can be associated to more than one action. Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
More html:form TAG in one page for struts 1
Hi to all Sorry for my poor English I have one page and one FormBean that is populated by the form but I would like have 2 FormBean and 2 form associated at the same page Actually Form a logical point of view: My pages represent 2 different function, so there is one button for one function and another one for the other function. From a technical point of view: in my code I have only one form tag hrml:form, but inside the form there are 2 submit. Each button redirect to one of the specific action That mean that one button required only some field to be valorized and the other one require other so in my validate method I have to filter one parameter to understand wich button was been pressed and to use one of the validate method Example Validate(){ If(parameter==1) ValidateA Else ValidateB } So my question is this: * understand if with struts 1 is possible define more FormBean for the same page * If not, the only solution is to create one big FormBean that encapsulate all the data related to all the possible field that can be populated? * For the validation is there any other solution or I have to switch as I'm actually doing base on one parameter? Thanks Alessandro Ing. Alessandro D'Ottavio Elsag Datamat S.p.A. - Banking & Finance Division Financing Systems Area Department - Tadawul Via Naide 43 - 00155 - Rome Italy Fax Number : +39 06 22796324 Office : +39 06 22724617 Mobile : +39 3349067696 e-mail : [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]> "Questo messaggio ed ogni suo allegato sono confidenziali e possono essere riservati o, comunque, protetti dall'essere diffusi. Se il ricevente non é il destinatario diretto del presente messaggio, é pregato di contattare l'originario mittente e di cancellare questo messaggio ed ogni suo allegato dal sistema di posta. Se il ricevente non é il destinatario diretto del presente messaggio, sono vietati l'uso, la riproduzione e la stampa di questo messaggio e di ogni suo allegato, nonché la diffusione del loro contenuto a qualsiasi altro soggetto" * "This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please contact the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not use, copy or print this message or attachment or disclose the contents to any other person."
Re: Struts 1.3.8 problem html:form
2008/8/4 Alexis Abdel <[EMAIL PROTECTED]>: > That exeption in english it is: > > The server found an error,and cant fill this requirement. > > org.apache.jasper.JasperException: Exception in JSP: /index.jsp:16 Can you post the complete stack trace, especially the cause? Antonio P.S. I speak also Italian (since I am Italian :-) ), but anyway I won't give you my MSN contact, nor I do want to write in Italian in an English-speaking mailing list. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts 1.3.8 problem html:form
2008/8/4 Alexis Abdel <[EMAIL PROTECTED]>: > Configuration 1.3//EN" > > "http://struts.apache.org/dtds/struts-config_1_0.dtd";> Shouldn't it be "1_3"? Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts 1.3.8 problem html:form
Hi! I am using Struts 1.3.8 and when i want to try some of the examples or when i want to develop something i always have the same error in the line with "html:form." This is a very simple example: Inside Web-inf,i have a lib folder with the following libs: Antlr-2.7.2.jar,commons-beanutils,commons-chain-common-digester,-commons-fileupload,commons-io commons-loggining,commons-validator,jstl-1.0.6,oro-2.0.8,standar-1.06,struts-core,struts-el,struts-extras, struts-taglib,struts-tiles. Struts-config.xml with this Information: http://struts.apache.org/dtds/struts-config_1_0.dtd";> Inside Web-inf-src i have a package "app" with 2 classes. ---RegistroAction-- package app; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.*; 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 java.util.Properties; import java.lang.Object; public class RegistroAction extends Action { public ActionForward perform(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { RegistroForm registroForm = (RegistroForm) form; String user = registroForm.getUsername(); String pass1 = registroForm.getPassword1(); String pass2 = registroForm.getPassword2(); if (pass1.equals(pass2)) { return mapping.findForward("sucess"); } else { return mapping.findForward("error"); } } --- RegistroForm package app; import org.apache.struts.action.ActionForm; public class RegistroForm extends ActionForm{ protected String username; protected String password1; protected String password2; public String getPassword1() { return password1; } public void setPassword1(String password1) { this.password1 = password1; } public String getPassword2() { return password2; } public void setPassword2(String password2) { this.password2 = password2; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } } In a folder call "Pages" i have a 2 .html "error.html" and "succes.html" And of course i have the index.jsp page,i use this page to start the application and there is where i have the error. --index.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ taglib uri="http://struts.apache.org/tags-html"; prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-bean"; prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-logic"; prefix="logic" %> Identificación Nombre Usuario Contraseña Repetir Contraseña The error is in El servidor encontró un error interno () que hizo que no pudiera rellenar este requerimiento. excepción That exeption in english it is: The server found an error,and cant fill this requirement. org.apache.jasper.JasperException: Exception in JSP: /index.jsp:16 I am using Tomcat 5.5.26 Thanks in advance. ¡Buscá desde tu celular! Yahoo! oneSEARCH ahora está en Claro http://ar.mobile.yahoo.com/onesearch
RE: styleId attribute in html:form
> Right, that has sorted the problem with the form, thanks for the help. > > I'm wondering why that tag was put there in the first place, > what could have been the reasoning behind that? I'm hoping > that removing it won't have implication elsewhere in the process... Are you talking about the xhtml tag? There's a standard out for xhtml, which some people want to write their web pages to conform to. The xhtml tag (or xhtml attribute of the html tag) tells Struts to generate code that conforms to that standard. A more interesting question to me is why Struts insists on putting the form bean name into the form tag, and won't let you specify your own ID tag when it's in xhtml mode. That makes no sense to me. At the moment, conforming to the xhtml standard - or any other HTML standard, for that matter - doesn't really matter a lot. *All* web browsers are very tolerant of HTML oddities and inexactnesses. None of them insist on strict conformity to any standard. If they did, I suspect that nearly all web pages - even those that claim to conform to one standard or another - would fail. -- Tim Slattery [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: styleId attribute in html:form
Right, that has sorted the problem with the form, thanks for the help. I'm wondering why that tag was put there in the first place, what could have been the reasoning behind that? I'm hoping that removing it won't have implication elsewhere in the process... Slattery, Tim - BLS wrote: > >> We have a struts form, and we need to have a styleId element >> (which translates into a standard HTML id element). When we >> include it, the page breaks, with no errors logged, just a >> blank page. If we leave it out completely, when the page >> loads an id element has been included, with the value set to >> the name of the form as defined in the struts-config file. >> That's not id we need! > > I assume you're using XHTML (either xhtml="true" in the Struts html > element or the tag). Normally Struts will create a "name" > attribute for the form tag that contains the form bean name. But in the > xhtml spec, the form tag doesn't have a "name" attribute, so Struts puts > the form bean name into an id attribute instead. As you've seen, if you > try to specify an ID tag, Struts dies. > > > -- > Tim Slattery > [EMAIL PROTECTED] > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/styleId-attribute-in-html%3Aform-tf4607534.html#a13158694 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: styleId attribute in html:form
> We have a struts form, and we need to have a styleId element > (which translates into a standard HTML id element). When we > include it, the page breaks, with no errors logged, just a > blank page. If we leave it out completely, when the page > loads an id element has been included, with the value set to > the name of the form as defined in the struts-config file. > That's not id we need! I assume you're using XHTML (either xhtml="true" in the Struts html element or the tag). Normally Struts will create a "name" attribute for the form tag that contains the form bean name. But in the xhtml spec, the form tag doesn't have a "name" attribute, so Struts puts the form bean name into an id attribute instead. As you've seen, if you try to specify an ID tag, Struts dies. -- Tim Slattery [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
styleId attribute in html:form
Hello all. We have a struts form, and we need to have a styleId element (which translates into a standard HTML id element). When we include it, the page breaks, with no errors logged, just a blank page. If we leave it out completely, when the page loads an id element has been included, with the value set to the name of the form as defined in the struts-config file. That's not id we need! So, with the following form declaration the page is fine: But with this, our page breaks. In the first case, the HTML gets translated as: (why did the id get put there automatically?) Why can't I include my custom styleId? If I make the form a normal HTML form, everything works fine. What implications are there for the rest of the struts elements if the form is declared in this way? Many thanks! -- View this message in context: http://www.nabble.com/styleId-attribute-in-html%3Aform-tf4607534.html#a13156706 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:form styleId name attribute javascript issue
Use the getElementById scripting method. On 8/6/07, john lee <[EMAIL PROTECTED]> wrote: > > I have two file, and try to test javascript, but javascript can not access > document.form. > > Can one know why? inside , styleId <> Name attribute? if so, > what is the solution for that? > > i use strusts 1.3 > > tks in advance > > john > > > one file is javacript file, called my.js > > function loader(){ > var form=document.form["partsearchinput"]; > from.setAttribute("autocomplete","off"); > } > > - > > > second file is test file, called my.jsp > - > > > > > > > > > > > > > - > Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's > on, when.
html:form styleId name attribute javascript issue
I have two file, and try to test javascript, but javascript can not access document.form. Can one know why? inside , styleId <> Name attribute? if so, what is the solution for that? i use strusts 1.3 tks in advance john one file is javacript file, called my.js function loader(){ var form=document.form["partsearchinput"]; from.setAttribute("autocomplete","off"); } - second file is test file, called my.jsp - - Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, when.
Help required for error html:form not closed
Hi all, We have got an Application wherein we are having many layouts. But we can easily group some layouts of some pages. We also can say that some part is common to all pages in a group. Hence we thought of segregating those contents into common files and including these as shown below. <%@ include file="/WEB-INF/jspf/PreHeader.jspf" %> <%@ include file="/WEB-INF/jspf/Header.jspf" %> <%@ include file="/WEB-INF/jspf/WelcomeMessage.jspf" %> <%@ include file="/WEB-INF/jspf/PreBody.jspf" %> . . . Content of the JSP . . <%@ include file="/WEB-INF/jspf/PreFooter.jspf" %> We have defined the form attribute in PreHeader.jspf itself. Now when we thought of using taglibs through out our project, we are not able to define in PreHeader.jspf as it gives an error saying unterminated html:form Any idea how we could over come this problem. Also use of tiles was one opinion but we are already through development of many pages and hence not able to judge how far the implementation of tiles hit us. For clarification we are using Tomcat 5.0.28, JDK 1.5, Struts version 1.3.8. Thanks and regards, Kalpak Luniya - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:form array submit, capture inside ActionFrom question
David, tks for ur help. actually, my goal is to have multiple submit button on same page, do same thing, but carry different input value(different search result). john David Conrad <[EMAIL PROTECTED]> wrote: On 4/20/07, john lee wrote: > what is S1 tags? i still use struts 1.3.8. Struts 1.x. S2 would be Struts 2.x. So, with 1.3.8, you are still using S1. > So, no possible to submit formay array? > > > possible for me to implement the following code? > > > for (i=1:i> { > > response.Write("> styleId="+i); > > response.Write("> value="+i); > > response.Write(""); > > response.Write(""); > > } > > %> > > > > but, how to capature form(0), form(1) with > > corrsponsed part inside ActionForm ? > I think you could get the Struts tags to be interpreted if you wrapped them in a tag or a tag, rather than in a loop in a scriptlet. I can't imagine how it would work beyond that, though. I guess since only one form is actually posted back, you'd be OK as long as it went to an action with a form bean that matched the form? If the goal is just to have multiple submit buttons on the page that do different things, you might try another approach: Have one with multiple tags, each one having an onclick handler e.g., Then, in Javascript, you could alter the action of the form like this: function doSubmitOne() { var form = document.forms["myForm"]; form.action += "?method=submitOne"; form.submit(); } Thus, the action would become "sth.do?method=submitOne", and then in your Action class you would have a form bean that could handle all the fields from all your separate forms, and one method for each submit button that would look at just the fields appropriate to that action. Does that make sense? It might not be the cleanest method, but it's not unlike something I've used in the past. Good luck, David Conrad - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Ahhh...imagining that irresistible "new car" smell? Check outnew cars at Yahoo! Autos.
Re: html:form array submit, capture inside ActionFrom question
On 4/20/07, john lee <[EMAIL PROTECTED]> wrote: what is S1 tags? i still use struts 1.3.8. Struts 1.x. S2 would be Struts 2.x. So, with 1.3.8, you are still using S1. So, no possible to submit formay array? > possible for me to implement the following code? > > for (i=1:i> { >response.Write("> styleId="+i); >response.Write("> value="+i); >response.Write(""); >response.Write(""); >} > %> > > but, how to capature form(0), form(1) with > corrsponsed part inside ActionForm ? I think you could get the Struts tags to be interpreted if you wrapped them in a tag or a tag, rather than in a loop in a scriptlet. I can't imagine how it would work beyond that, though. I guess since only one form is actually posted back, you'd be OK as long as it went to an action with a form bean that matched the form? If the goal is just to have multiple submit buttons on the page that do different things, you might try another approach: Have one with multiple tags, each one having an onclick handler e.g., Then, in Javascript, you could alter the action of the form like this: function doSubmitOne() { var form = document.forms["myForm"]; form.action += "?method=submitOne"; form.submit(); } Thus, the action would become "sth.do?method=submitOne", and then in your Action class you would have a form bean that could handle all the fields from all your separate forms, and one method for each submit button that would look at just the fields appropriate to that action. Does that make sense? It might not be the cleanest method, but it's not unlike something I've used in the past. Good luck, David Conrad - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:form array submit, capture inside ActionFrom question
what is S1 tags? i still use struts 1.3.8. So, no possible to submit formay array? tks john Dave Newton <[EMAIL PROTECTED]> wrote: --- john lee wrote: > possible for me to implement the following code? > > for (i=1:i> { >response.Write("> styleId="+i); >response.Write("> value="+i); >response.Write(""); >response.Write(""); >} > %> > > but, how to capature form(0), form(1) with > corrsponsed part inside ActionForm ? I don't think so, because the S1 tags won't be compiled: you'll just get raw tags in the output. d. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Ahhh...imagining that irresistible "new car" smell? Check outnew cars at Yahoo! Autos.
Re: html:form array submit, capture inside ActionFrom question
--- john lee <[EMAIL PROTECTED]> wrote: > possible for me to implement the following code? > <% > for (i=1:i<=10:i++) > { >response.Write(" styleId="+i); >response.Write(" value="+i); >response.Write(""); >response.Write(""); >} > %> > > but, how to capature form(0), form(1) with > corrsponsed part inside ActionForm ? I don't think so, because the S1 tags won't be compiled: you'll just get raw tags in the output. d. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:form array submit, capture inside ActionFrom question
possible for me to implement the following code? <% for (i=1:i<=10:i++) { response.Write(""); response.Write(""); } %> but, how to capature form(0), form(1) with corrsponsed part inside ActionForm ? tks in advance john - Ahhh...imagining that irresistible "new car" smell? Check outnew cars at Yahoo! Autos.
RE: Re: EL expression in html:form action
Don't recommend using the struts-el taglib if you don't know what environment the user is in. The struts-el taglib can't be used in a JSP 2.0 environment. > -Original Message- > From: Strachan, Paul [mailto:[EMAIL PROTECTED] > Sent: Thursday, March 15, 2007 5:50 PM > To: Struts Users Mailing List > Subject: RE: Re: EL expression in html:form action > > It should work OK if you're using the > http://struts.apache.org/tags-html-el taglib. > > -Original Message- > From: Lim Hock-Chai [mailto:[EMAIL PROTECTED] > Sent: Friday, 16 March 2007 4:08 AM > To: Struts Users Mailing List > Subject: RE: Re: EL expression in html:form action > > I'm pretty sure that contactType was not empty. It was > showing BIL on the screen. > > contactType is created using jstl's core tag with > request scope. > I just wonder if EL expression is allowed in 's > action attribute. Has anybody done this before? > > -Original Message- > From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper > Sent: Thursday, March 15, 2007 12:00 PM > To: user@struts.apache.org > Subject: Re: EL expression in html:form action > > Lim Hock-Chai wrote: > > I'm getting the "cannot retrieve mapping for action" error > when using > > EL expression in the action attribute of tag. > See below. > > > > > > AcctContact.jsp ==> > > > > .. . . > > > > > > > > struts-config.xml ==> > > >type="com.factor8th.i5.AcctContactAction" > >name="AcctContactBILForm" > >scope="request" > >validate="true" > >input="/AcctContact.jsp"> > > .. . . > > > > > > Error ==> > > > == > > == > > == > > ERROR - ServletException in '/AcctContact.jsp': Cannot retrieve > > mapping for action /AcctContactAction > > javax.servlet.ServletException: Cannot retrieve mapping for action > > /AcctContactAction at > > > org.apache.jasper.runtime.PageContextImpl.handlePageException(PageCont > > ex > > tImpl.java:495) > > at > > org.apache.jsp.AcctContact_jsp._jspService(AcctContact_jsp.java:245) > > at > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92) > > So contactType is empty or undefined, no? So it's not looking > for the mapping you've defined, AcctContactBILAction. > > L. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > ** > This message is intended for the addressee named and may > contain privileged information or confidential information or > both. If you are not the intended recipient please delete it > and notify the sender. > ** > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Re: EL expression in html:form action
It should work OK if you're using the http://struts.apache.org/tags-html-el taglib. -Original Message- From: Lim Hock-Chai [mailto:[EMAIL PROTECTED] Sent: Friday, 16 March 2007 4:08 AM To: Struts Users Mailing List Subject: RE: Re: EL expression in html:form action I'm pretty sure that contactType was not empty. It was showing BIL on the screen. contactType is created using jstl's core tag with request scope. I just wonder if EL expression is allowed in 's action attribute. Has anybody done this before? -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper Sent: Thursday, March 15, 2007 12:00 PM To: user@struts.apache.org Subject: Re: EL expression in html:form action Lim Hock-Chai wrote: > I'm getting the "cannot retrieve mapping for action" error when using > EL expression in the action attribute of tag. See below. > > > AcctContact.jsp ==> > > .. . . > > > > struts-config.xml ==> > type="com.factor8th.i5.AcctContactAction" >name="AcctContactBILForm" >scope="request" >validate="true" >input="/AcctContact.jsp"> > .. . . > > > Error ==> > == > == > == > ERROR - ServletException in '/AcctContact.jsp': Cannot retrieve > mapping for action /AcctContactAction > javax.servlet.ServletException: Cannot retrieve mapping for action > /AcctContactAction at > org.apache.jasper.runtime.PageContextImpl.handlePageException(PageCont > ex > tImpl.java:495) > at > org.apache.jsp.AcctContact_jsp._jspService(AcctContact_jsp.java:245) > at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92) So contactType is empty or undefined, no? So it's not looking for the mapping you've defined, AcctContactBILAction. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** This message is intended for the addressee named and may contain privileged information or confidential information or both. If you are not the intended recipient please delete it and notify the sender. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Re: EL expression in html:form action
I'm pretty sure that contactType was not empty. It was showing BIL on the screen. contactType is created using jstl's core tag with request scope. I just wonder if EL expression is allowed in 's action attribute. Has anybody done this before? -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper Sent: Thursday, March 15, 2007 12:00 PM To: user@struts.apache.org Subject: Re: EL expression in html:form action Lim Hock-Chai wrote: > I'm getting the "cannot retrieve mapping for action" error when using > EL expression in the action attribute of tag. See below. > > > AcctContact.jsp ==> > > .. . . > > > > struts-config.xml ==> > type="com.factor8th.i5.AcctContactAction" >name="AcctContactBILForm" >scope="request" >validate="true" >input="/AcctContact.jsp"> > .. . . > > > Error ==> > == > == > == > ERROR - ServletException in '/AcctContact.jsp': Cannot retrieve > mapping for action /AcctContactAction > javax.servlet.ServletException: Cannot retrieve mapping for action > /AcctContactAction at > org.apache.jasper.runtime.PageContextImpl.handlePageException(PageCont > ex > tImpl.java:495) > at > org.apache.jsp.AcctContact_jsp._jspService(AcctContact_jsp.java:245) > at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92) So contactType is empty or undefined, no? So it's not looking for the mapping you've defined, AcctContactBILAction. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: EL expression in html:form action
Lim Hock-Chai wrote: I'm getting the "cannot retrieve mapping for action" error when using EL expression in the action attribute of tag. See below. AcctContact.jsp ==> .. . . struts-config.xml ==> .. . . Error ==> == ERROR - ServletException in '/AcctContact.jsp': Cannot retrieve mapping for action /AcctContactAction javax.servlet.ServletException: Cannot retrieve mapping for action /AcctContactAction at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex tImpl.java:495) at org.apache.jsp.AcctContact_jsp._jspService(AcctContact_jsp.java:245) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92) So contactType is empty or undefined, no? So it's not looking for the mapping you've defined, AcctContactBILAction. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
EL expression in html:form action
I'm getting the "cannot retrieve mapping for action" error when using EL expression in the action attribute of tag. See below. AcctContact.jsp ==> . . . struts-config.xml ==> . . . Error ==> == ERROR - ServletException in '/AcctContact.jsp': Cannot retrieve mapping for action /AcctContactAction javax.servlet.ServletException: Cannot retrieve mapping for action /AcctContactAction at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex tImpl.java:495) at org.apache.jsp.AcctContact_jsp._jspService(AcctContact_jsp.java:245) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: From html:form direct to JSP
Hi, Set the action field of the to say "/xyz.do" And put the following action mapping in struts-config.xml : This will directly redirect to Target Jsp without going into any Custom Action. Hope it will work for u. Thanks & Regards Abhishek Khandelwal -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, February 09, 2007 4:14 AM To: user@struts.apache.org Subject: From html:form direct to JSP Hi everybody, New day, new problem :). I have a html:form in my page, with hidden fields (don't ask why, long explanation). When you submit that form, an action is triggered, which forwards the user to a page. The problem is, the forward is the only thing that the action does (no additional lookups or processes). Is there a way to forward the form directly to a JSP page, instead of triggering an action? This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
From html:form direct to JSP
Hi everybody, New day, new problem :). I have a html:form in my page, with hidden fields (don't ask why, long explanation). When you submit that form, an action is triggered, which forwards the user to a page. The problem is, the forward is the only thing that the action does (no additional lookups or processes). Is there a way to forward the form directly to a JSP page, instead of triggering an action? This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.
Re: specify html:form action property
Sorry didn't get what you mean by "use JSTL/EL to navigate the servlet api" :) As I mentioned before request.getServletPath() gives Tiles layout jsp page, not action mapping. * Best Regards Ilja Joseph McGranaghan wrote: That MappingDispatchAction sounds like a good idea. What if you use JSTL/EL to navigate the servlet api and do a similar filter for /admin/* etc? Could do it in a javascript function onSubmit. -Joe Ilja S. wrote: The thing is that I use MappingDispatchAction So in one action class I have 2 methods: 1 will be executed when /supervisor/deals is accessed and other when /admin/deals is executed. I found this convenient for handling authorization (user with role supervisor can't access /admin/* urls) and having one Action class for few tasks. The problem here that I also want to use one JSP for those mappings and submit form in this jsp to corresponding mapping. Joseph McGranaghan wrote: What if you use a DispatchAction and one path. Either way you will need to check a parameter (or something) to ensure the proper route -Joe Ilja S. wrote: Hello This could be silly question but I'm kind stuck here. I have 2 ActionMappings in struts config with following paths: path="/admin/deals" path="/supervisor/deals" Both have the forward to same jsp with form. All I want to do is depending on a requested mapping submit form, well, to its' action i.e. if /admin/deals page is opened then it would be action="/admin/deals.do"> and if /supervisor/deals url is opened then form would be submitted to "/supervisor/deals.do". Getting servletPath() from request object gives me smth like /layout/layout.jsp since struts Tiles is used. Thanks in advance. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: specify html:form action property
That MappingDispatchAction sounds like a good idea. What if you use JSTL/EL to navigate the servlet api and do a similar filter for /admin/* etc? Could do it in a javascript function onSubmit. -Joe Ilja S. wrote: The thing is that I use MappingDispatchAction So in one action class I have 2 methods: 1 will be executed when /supervisor/deals is accessed and other when /admin/deals is executed. I found this convenient for handling authorization (user with role supervisor can't access /admin/* urls) and having one Action class for few tasks. The problem here that I also want to use one JSP for those mappings and submit form in this jsp to corresponding mapping. Joseph McGranaghan wrote: What if you use a DispatchAction and one path. Either way you will need to check a parameter (or something) to ensure the proper route -Joe Ilja S. wrote: Hello This could be silly question but I'm kind stuck here. I have 2 ActionMappings in struts config with following paths: path="/admin/deals" path="/supervisor/deals" Both have the forward to same jsp with form. All I want to do is depending on a requested mapping submit form, well, to its' action i.e. if /admin/deals page is opened then it would be action="/admin/deals.do"> and if /supervisor/deals url is opened then form would be submitted to "/supervisor/deals.do". Getting servletPath() from request object gives me smth like /layout/layout.jsp since struts Tiles is used. Thanks in advance. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: specify html:form action property
The thing is that I use MappingDispatchAction So in one action class I have 2 methods: 1 will be executed when /supervisor/deals is accessed and other when /admin/deals is executed. I found this convenient for handling authorization (user with role supervisor can't access /admin/* urls) and having one Action class for few tasks. The problem here that I also want to use one JSP for those mappings and submit form in this jsp to corresponding mapping. Joseph McGranaghan wrote: What if you use a DispatchAction and one path. Either way you will need to check a parameter (or something) to ensure the proper route -Joe Ilja S. wrote: Hello This could be silly question but I'm kind stuck here. I have 2 ActionMappings in struts config with following paths: path="/admin/deals" path="/supervisor/deals" Both have the forward to same jsp with form. All I want to do is depending on a requested mapping submit form, well, to its' action i.e. if /admin/deals page is opened then it would be action="/admin/deals.do"> and if /supervisor/deals url is opened then form would be submitted to "/supervisor/deals.do". Getting servletPath() from request object gives me smth like /layout/layout.jsp since struts Tiles is used. Thanks in advance. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: specify html:form action property
What if you use a DispatchAction and one path. Either way you will need to check a parameter (or something) to ensure the proper route -Joe Ilja S. wrote: Hello This could be silly question but I'm kind stuck here. I have 2 ActionMappings in struts config with following paths: path="/admin/deals" path="/supervisor/deals" Both have the forward to same jsp with form. All I want to do is depending on a requested mapping submit form, well, to its' action i.e. if /admin/deals page is opened then it would be action="/admin/deals.do"> and if /supervisor/deals url is opened then form would be submitted to "/supervisor/deals.do". Getting servletPath() from request object gives me smth like /layout/layout.jsp since struts Tiles is used. Thanks in advance. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
specify html:form action property
Hello This could be silly question but I'm kind stuck here. I have 2 ActionMappings in struts config with following paths: path="/admin/deals" path="/supervisor/deals" Both have the forward to same jsp with form. All I want to do is depending on a requested mapping submit form, well, to its' action i.e. if /admin/deals page is opened then it would be action="/admin/deals.do"> and if /supervisor/deals url is opened then form would be submitted to "/supervisor/deals.do". Getting servletPath() from request object gives me smth like /layout/layout.jsp since struts Tiles is used. Thanks in advance. -- * Best Regards Ilja - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:form action mapping
On 12/7/06, chuanjiang lo <[EMAIL PROTECTED]> wrote: Hi all i have this jsp page with a form and the corresponding mapping in the struts config is When i view the source code of the jsp it shows Why is the action mapping to my context path? Appreciate any advice found the error mess up some mappings in web.xml hence causing this problem.
html:form action mapping
Hi all i have this jsp page with a form and the corresponding mapping in the struts config is When i view the source code of the jsp it shows Why is the action mapping to my context path? Appreciate any advice
Re: RES: html:form problem
Forms submit to the web application, so it requires a web context proceeding your domain. You can't submit to the root of the domain; the root domain is not a web application. Struts is rendering the form action correctly. Roberto C. Lima Jr. wrote: No. I'm not using modules. -- Roberto Costa Lima Jr. e-novar Soluções Tecnológicas www.enovar.com.br +55(85) 4009-5860 +55(85) 9104-6526 -Mensagem original- De: Adam Gordon [mailto:[EMAIL PROTECTED] Enviada em: quinta-feira, 21 de setembro de 2006 17:35 Para: Struts Users Mailing List Assunto: Re: html:form problem It looks like you might be using modules...are you? -adam Roberto C. Lima Jr. wrote: Hi, everyone. I have an app that will be published at internet with apache + JBoss Server. So, it will be published on the address above: <http://sis.enovar.com.br/> http://sis.enovar.com.br/ But the problem is that html:form writes more than just the “.do” thing becomes So, when i submit the page, it is trying to go to http://sis.enovar.com.br/sis/example.do and actually I was wondering it goes to http://sis.enovar.com.br/example.do Does anyone have any tip to solve my problem? I’m using struts 1.2 Thank’s -- Roberto Costa Lima Jr. e-novar Soluções Tecnológicas <http://www.enovar.com.br/> www.enovar.com.br +55(85) 4009-5860 +55(85) 9104-6526 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RES: html:form problem
No. I'm not using modules. -- Roberto Costa Lima Jr. e-novar Soluções Tecnológicas www.enovar.com.br +55(85) 4009-5860 +55(85) 9104-6526 -Mensagem original- De: Adam Gordon [mailto:[EMAIL PROTECTED] Enviada em: quinta-feira, 21 de setembro de 2006 17:35 Para: Struts Users Mailing List Assunto: Re: html:form problem It looks like you might be using modules...are you? -adam Roberto C. Lima Jr. wrote: > Hi, everyone. > > > > I have an app that will be published at internet with apache + JBoss > Server. > > So, it will be published on the address above: > > > > <http://sis.enovar.com.br/> http://sis.enovar.com.br/ > > > > But the problem is that html:form writes more than just the .do thing > > > > > > > > becomes > > > > > > > > So, when i submit the page, it is trying to go to > > http://sis.enovar.com.br/sis/example.do > > and actually I was wondering it goes to > > http://sis.enovar.com.br/example.do > > > > Does anyone have any tip to solve my problem? > > > > Im using struts 1.2 > > > > Thanks > > -- > Roberto Costa Lima Jr. > e-novar Soluções Tecnológicas > <http://www.enovar.com.br/> www.enovar.com.br > > +55(85) 4009-5860 > +55(85) 9104-6526 > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RES: html:form problem
Yes. It didn't work. :( -- Roberto Costa Lima Jr. e-novar Soluções Tecnológicas www.enovar.com.br +55(85) 4009-5860 +55(85) 9104-6526 -Mensagem original- De: Chris Pratt [mailto:[EMAIL PROTECTED] Enviada em: quinta-feira, 21 de setembro de 2006 17:31 Para: Struts Users Mailing List Assunto: Re: html:form problem Have you tried: (*Chris*) On 9/21/06, Roberto C. Lima Jr. <[EMAIL PROTECTED]> wrote: > > Hi, everyone. > > > > I have an app that will be published at internet with apache + JBoss > Server. > > So, it will be published on the address above: > > > > <http://sis.enovar.com.br/> http://sis.enovar.com.br/ > > > > But the problem is that html:form writes more than just the ".do" thing > > > > > > > > becomes > > > > > > > > So, when i submit the page, it is trying to go to > > http://sis.enovar.com.br/sis/example.do > > and actually I was wondering it goes to > > http://sis.enovar.com.br/example.do > > > > Does anyone have any tip to solve my problem? > > > > I'm using struts 1.2 > > > > Thank's > > -- > Roberto Costa Lima Jr. > e-novar Soluções Tecnológicas > <http://www.enovar.com.br/> www.enovar.com.br > > +55(85) 4009-5860 > +55(85) 9104-6526 > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:form problem
It looks like you might be using modules...are you? -adam Roberto C. Lima Jr. wrote: Hi, everyone. I have an app that will be published at internet with apache + JBoss Server. So, it will be published on the address above: <http://sis.enovar.com.br/> http://sis.enovar.com.br/ But the problem is that html:form writes more than just the “.do” thing becomes So, when i submit the page, it is trying to go to http://sis.enovar.com.br/sis/example.do and actually I was wondering it goes to http://sis.enovar.com.br/example.do Does anyone have any tip to solve my problem? I’m using struts 1.2 Thank’s -- Roberto Costa Lima Jr. e-novar Soluções Tecnológicas <http://www.enovar.com.br/> www.enovar.com.br +55(85) 4009-5860 +55(85) 9104-6526 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:form problem
Have you tried: (*Chris*) On 9/21/06, Roberto C. Lima Jr. <[EMAIL PROTECTED]> wrote: Hi, everyone. I have an app that will be published at internet with apache + JBoss Server. So, it will be published on the address above: <http://sis.enovar.com.br/> http://sis.enovar.com.br/ But the problem is that html:form writes more than just the ".do" thing becomes So, when i submit the page, it is trying to go to http://sis.enovar.com.br/sis/example.do and actually I was wondering it goes to http://sis.enovar.com.br/example.do Does anyone have any tip to solve my problem? I'm using struts 1.2 Thank's -- Roberto Costa Lima Jr. e-novar Soluções Tecnológicas <http://www.enovar.com.br/> www.enovar.com.br +55(85) 4009-5860 +55(85) 9104-6526
html:form problem
Hi, everyone. I have an app that will be published at internet with apache + JBoss Server. So, it will be published on the address above: <http://sis.enovar.com.br/> http://sis.enovar.com.br/ But the problem is that html:form writes more than just the .do thing becomes So, when i submit the page, it is trying to go to http://sis.enovar.com.br/sis/example.do and actually I was wondering it goes to http://sis.enovar.com.br/example.do Does anyone have any tip to solve my problem? Im using struts 1.2 Thanks -- Roberto Costa Lima Jr. e-novar Soluções Tecnológicas <http://www.enovar.com.br/> www.enovar.com.br +55(85) 4009-5860 +55(85) 9104-6526
Re: html:form / styleId in xhtml mode
I suspect this restriction is there to support the validator. XHTML mandates the use of 'id' in place of 'name' in various situations. That said, you can still predict what the 'id' value will be; in this case, it will take the name of the FormBean associated with the form. So your AJAX calls could just use that name to reference the form. L. Michael Rush wrote: I was just looking into upgrading my app from 1.2.9 to 1.3.4 and have run into a snag: 2006-08-01 15:33:49,911 (ERROR) InsertTag.doEndTag - ServletException in '/pages/site/entry.jsp': Cannot specify "styleId" when in XHTML mode as the HTML "id" attribute is already used to store the bean name javax.servlet.ServletException: Cannot specify "styleId" when in XHTML mode as the HTML "id" attribute is already used to store the bean name FormTag dictates that the styleId attribute cannot be set in the html:form tag when using xhtml mode: protected void renderName(StringBuffer results) throws JspException { if (this.isXhtml()) { if (getStyleId() == null) { renderAttribute(results, "id", beanName); } else { throw new JspException(messages.getMessage("formTag.ignoredId")); } } else { renderAttribute(results, "name", beanName); renderAttribute(results, "id", getStyleId()); } } The question is, why? Couldn't it just as easily be done as the following? if (this.isXhtml()) { if (getStyleId() == null) { renderAttribute(results, "id", beanName); } else { renderAttribute(results, "id", getStyleId()); } } We're using quite a bit of AJAX in our application and referring to document elements by id quite regularly, not to mention that stylesheets reference specific ids as well (i.e. all of our forms have a styleId attribute). Going through and renaming all of the ids of the forms doesn't seem very attractive. Can someone verify that it's necessary? Thanks, Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:form / styleId in xhtml mode
I was just looking into upgrading my app from 1.2.9 to 1.3.4 and have run into a snag: 2006-08-01 15:33:49,911 (ERROR) InsertTag.doEndTag - ServletException in '/pages/site/entry.jsp': Cannot specify "styleId" when in XHTML mode as the HTML "id" attribute is already used to store the bean name javax.servlet.ServletException: Cannot specify "styleId" when in XHTML mode as the HTML "id" attribute is already used to store the bean name FormTag dictates that the styleId attribute cannot be set in the html:form tag when using xhtml mode: protected void renderName(StringBuffer results) throws JspException { if (this.isXhtml()) { if (getStyleId() == null) { renderAttribute(results, "id", beanName); } else { throw new JspException(messages.getMessage ("formTag.ignoredId")); } } else { renderAttribute(results, "name", beanName); renderAttribute(results, "id", getStyleId()); } } The question is, why? Couldn't it just as easily be done as the following? if (this.isXhtml()) { if (getStyleId() == null) { renderAttribute(results, "id", beanName); } else { renderAttribute(results, "id", getStyleId()); } } We're using quite a bit of AJAX in our application and referring to document elements by id quite regularly, not to mention that stylesheets reference specific ids as well (i.e. all of our forms have a styleId attribute). Going through and renaming all of the ids of the forms doesn't seem very attractive. Can someone verify that it's necessary? Thanks, Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: use html:form to pass the a child window to a parent window
Ok. Thank you very much. -Mensaje original- De: M Faizal [mailto:[EMAIL PROTECTED] Enviado el: viernes, 12 de mayo de 2006 5:32 Para: Struts Users Mailing List Asunto: RE: use html:form to pass the a child window to a parent window Add target attrib. in the form of your popup window ... -Original Message- From: Jos Mara Tristn [mailto:[EMAIL PROTECTED] Sent: May 11, 2006 6:33 PM To: 'Struts Users Mailing List' Subject: use html:form to pass the a child window to a parent window Hi, Sorry but I'm speak only a little english. I have two windows. the first windows call to a popup windows that gets data. When user subbmit the form this is close and the parent window show this data. First Window Name: Street: Phone:_ Open popup Popup List Name: Jhon Henry ::: Submit If I'm select Henry in the list of popup the first window show Name: Jhon. In the popup I'm forward html:form to a ActionFirstWindow.do. But this action open a new first window and not gets the data. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message has been automatically scanned for viruses - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: use html:form to pass the a child window to a parent window
Add target attrib. in the form of your popup window ... -Original Message- From: José María Tristán [mailto:[EMAIL PROTECTED] Sent: May 11, 2006 6:33 PM To: 'Struts Users Mailing List' Subject: use html:form to pass the a child window to a parent window Hi, Sorry but I'm speak only a little english. I have two windows. the first windows call to a popup windows that gets data. When user subbmit the form this is close and the parent window show this data. First Window Name: Street: Phone:_ Open popup Popup List Name: Jhon Henry ::: Submit If I'm select Henry in the list of popup the first window show Name: Jhon. In the popup I'm forward html:form to a ActionFirstWindow.do. But this action open a new first window and not gets the data. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message has been automatically scanned for viruses
use html:form to pass the a child window to a parent window
Hi, Sorry but I'm speak only a little english. I have two windows. the first windows call to a popup windows that gets data. When user subbmit the form this is close and the parent window show this data. First Window Name: Street: Phone:_ Open popup Popup List Name: Jhon Henry ::: Submit If I'm select Henry in the list of popup the first window show Name: Jhon. In the popup I'm forward html:form to a ActionFirstWindow.do. But this action open a new first window and not gets the data. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: newbie question about xhtml, html:form, submit button
On Wednesday, May 3, Nathan Coast wrote: > You need to change your javascript to > document.getElementById('tryItForm').submit(); That does it. Thanks for your help. -DB - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: newbie question about xhtml, html:form, submit button
without struts inserts the name="tryItForm" attribute for the form. With struts inserts the id="tryItForm" attribute. You need to change your javascript to document.getElementById('tryItForm').submit(); David Byron wrote: I've inherited some struts code and I have a question about the html that it generates. I have a feeling there's a bunch more stuff I need to read but I'm having trouble finding it. I've run the generated html through validator.w3.org and it gave me errors that I don't have end tags on input elements. The code for an offending input element is: So, I added to my .jsp page and the html validates cleanly. Unfortunately, my page doesn't work anymore. I've got: which is generated by: Unfortunately I get javascript errors in both IE (document.tryItForm is null or not an object) and firefox (document.tryItForm has no properties) unless the form element has a name attribute like this: which is the html that I get without the attribute... I'm looking for a way to get the validation clean and a working page. I'm not sure whether this is too much to ask or whether the solution is: 1. patch renderName in FormTag.java to add a name attribute even in the XHTML case. 2. do something different with the html:text to get valid XHTML 3. somehow change my a href="javascript" so it works, or replace it with something else that does the same thing. The DOCTYPE element is: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> The DTD there shows that name is a valid attribute for form elements, so maybe #1 is OK? If not, can someone point me in the right direction? I'm using struts 1.2.9. Thanks much for your help. -DB - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
newbie question about xhtml, html:form, submit button
I've inherited some struts code and I have a question about the html that it generates. I have a feeling there's a bunch more stuff I need to read but I'm having trouble finding it. I've run the generated html through validator.w3.org and it gave me errors that I don't have end tags on input elements. The code for an offending input element is: So, I added to my .jsp page and the html validates cleanly. Unfortunately, my page doesn't work anymore. I've got: which is generated by: Unfortunately I get javascript errors in both IE (document.tryItForm is null or not an object) and firefox (document.tryItForm has no properties) unless the form element has a name attribute like this: which is the html that I get without the attribute... I'm looking for a way to get the validation clean and a working page. I'm not sure whether this is too much to ask or whether the solution is: 1. patch renderName in FormTag.java to add a name attribute even in the XHTML case. 2. do something different with the html:text to get valid XHTML 3. somehow change my a href="javascript" so it works, or replace it with something else that does the same thing. The DOCTYPE element is: http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> The DTD there shows that name is a valid attribute for form elements, so maybe #1 is OK? If not, can someone point me in the right direction? I'm using struts 1.2.9. Thanks much for your help. -DB - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Submit a html:form with a link
It is - but it also indicates its going to be removed. Typically deprecations are removed in the version following the one thery are deprecated in. Opnions are great, but if there are conflicting ones then maybe they're better off on the wiki? Niall - Original Message - From: "Michael Jouravlev" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Thursday, March 09, 2006 2:33 AM Subject: Re: Submit a html:form with a link On 3/8/06, Niall Pemberton <[EMAIL PROTECTED]> wrote: > I see no real need to force people to change working implementations that > use DispatchAction or LookupDispatchAction by deprecating them. Still some do the same job better than other. I am not saying about forcing people. Just telling them that there is a better way. Isn't it what @deprecated for? > We probably > need better docs to explain the different implementations - but peoples > opnions on whats best to use vary widely - some people don't think > DispatchAction should be used at all. Since I don't use any DispatchAction > flavours, I'm going to leave them alone - but thats just my opnion. If I cannot give a birth, does this mean that I cannot have opinion on abortion? ;-) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Submit a html:form with a link
On 3/8/06, Niall Pemberton <[EMAIL PROTECTED]> wrote: > I see no real need to force people to change working implementations that > use DispatchAction or LookupDispatchAction by deprecating them. Still some do the same job better than other. I am not saying about forcing people. Just telling them that there is a better way. Isn't it what @deprecated for? > We probably > need better docs to explain the different implementations - but peoples > opnions on whats best to use vary widely - some people don't think > DispatchAction should be used at all. Since I don't use any DispatchAction > flavours, I'm going to leave them alone - but thats just my opnion. If I cannot give a birth, does this mean that I cannot have opinion on abortion? ;-) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Submit a html:form with a link
I see no real need to force people to change working implementations that use DispatchAction or LookupDispatchAction by deprecating them. We probably need better docs to explain the different implementations - but peoples opnions on whats best to use vary widely - some people don't think DispatchAction should be used at all. Since I don't use any DispatchAction flavours, I'm going to leave them alone - but thats just my opnion. Niall - Original Message - From: "Michael Jouravlev" <[EMAIL PROTECTED]> Sent: Wednesday, March 08, 2006 4:13 PM [OT] Should not LDA (along with DA and MDA) now be officially considered deprecated in favor of EAD (EventActionDispacher) ? If there are several ways to do the same job, some of these ways should be better than other. With 1.3.x there is a perfect opportunity to deprecate (if not throw out) a lot of older stuff. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Submit a html:form with a link
On 3/8/06, Niall Pemberton <[EMAIL PROTECTED]> wrote: > The most common cause of this in LookupDispatchAction is the presence of > "whitespace" in the label value. So in the example I gave you, this happens > if you don't put the tags all on one line, something like this: > > > > > > You need them, on one line, like this: > > > > Otherwise you need to look at how you've set up the "key method map" - > returned by the getKeyMethodMap() method in your LookupDispatchAction or if > you have specified the correct parameter and label value in your jsp. [OT] Should not LDA (along with DA and MDA) now be officially considered deprecated in favor of EAD (EventActionDispacher) ? If there are several ways to do the same job, some of these ways should be better than other. With 1.3.x there is a perfect opportunity to deprecate (if not throw out) a lot of older stuff. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Submit a html:form with a link
On 3/8/06, Yariel Ramos Moreno <[EMAIL PROTECTED]> wrote: > I tried your solution but it does't work. I get the exception: > > SEVERE: Servlet.service() for servlet action threw exception > javax.servlet.ServletException: Request[/search] does not contain handler > parameter named searchType We need to see the code you used in the JSP, and the resulting tag in order to help. -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Submit a html:form with a link
The most common cause of this in LookupDispatchAction is the presence of "whitespace" in the label value. So in the example I gave you, this happens if you don't put the tags all on one line, something like this: You need them, on one line, like this: Otherwise you need to look at how you've set up the "key method map" - returned by the getKeyMethodMap() method in your LookupDispatchAction or if you have specified the correct parameter and label value in your jsp. Niall - Original Message - From: "Yariel Ramos Moreno" <[EMAIL PROTECTED]> To: "Struts" Sent: Wednesday, March 08, 2006 3:19 PM Subject: Re: Submit a html:form with a link Niall: I tried your solution but it does't work. I get the exception: SEVERE: Servlet.service() for servlet action threw exception javax.servlet.ServletException: Request[/search] does not contain handler parameter named searchType at org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction. java:199) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces sor.java:484) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126 ) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105 ) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java :107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processC onnection(Http11BaseProtocol.java:667) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav a:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWo rkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav a:684) at java.lang.Thread.run(Thread.java:595) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Submit a html:form with a link
Niall: I tried your solution but it does't work. I get the exception: SEVERE: Servlet.service() for servlet action threw exception javax.servlet.ServletException: Request[/search] does not contain handler parameter named searchType at org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.java:199) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:667) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595)
Re: Submit a html:form with a link
On 3/8/06, Yariel Ramos Moreno <[EMAIL PROTECTED]> wrote: > It's there a way of submit an html:form to a LookUpDispathAction with > a link instead of a submit button? What problem are you trying to solve? * If you can get all of the request parameters into the link URL, yes. * Otherwise, not without client side scripting. http://www.thesitewizard.com/archive/textsubmit.shtml * You can make a submit button *look* like a link with CSS. http://tom.me.uk/scripting/submit.html HTH, -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Submit a html:form with a link
I believe you can do something like the following, although I haven't tried it myself: ... link text here e.g. This adds a parameter called "foo" to the link with the internationalized value of "foo.label" from the message resources. If you want more than one parameter you need to build a java.util.Map of parameters and pass it to the tag using the name/property attributes. Niall - Original Message - From: "Yariel Ramos Moreno" <[EMAIL PROTECTED]> Sent: Wednesday, March 08, 2006 2:19 PM Hi everybody: It's there a way of submit an html:form to a LookUpDispathAction with a link instead of a submit button? Thanks and regards. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Submit a html:form with a link
Hi everybody: It's there a way of submit an html:form to a LookUpDispathAction with a link instead of a submit button? Thanks and regards.
Re: html:form dynamic action value
Perry Jeung wrote: I have a html:form tag with a dynamic action value that works in one version of Struts and not in another. I'm new to Tiles and I want to do the following in one of the reusable tiles named report.jsp: " > In an experiment, I took the struts-example webapp from the Struts 1.2.8 binary distributon and modified the html-link.jsp like this: <% String actionValue = "/html-link-submit"; request.setAttribute("action", actionValue); %> "> This works so I go back to my application to do the same thing but doesn't work. I get the following error on the html page in the browser: [ServletException in:/tiles/report.jsp] null' I'm using a debugger and I can see that the action attribute is defined in the request context. Why the difference? Is it the struts environment? Both are running on Tomcat 5.0.28. My app uses Struts 1.1 and has this preamble in web.xml http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";> The modified struts-example is from Struts 1.2.8 and has the same web.xml preamble as above. Would I be right in concluding that the difference is in the Struts version and that upgrading would solve my problem? My app has close to 100 pages, so before I start, can anybody offer some insight as to the root of the problem. Have you tried your experiment using the examples app from Struts 1.1? That might be a useful sanity check before drawing any conclusions. I can't offer any insight into the error you're getting without seeing the full stacktrace (if then! :-) L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:form dynamic action value
I have a html:form tag with a dynamic action value that works in one version of Struts and not in another. I'm new to Tiles and I want to do the following in one of the reusable tiles named report.jsp: " > In an experiment, I took the struts-example webapp from the Struts 1.2.8 binary distributon and modified the html-link.jsp like this: <% String actionValue = "/html-link-submit"; request.setAttribute("action", actionValue); %> "> This works so I go back to my application to do the same thing but doesn't work. I get the following error on the html page in the browser: [ServletException in:/tiles/report.jsp] null' I'm using a debugger and I can see that the action attribute is defined in the request context. Why the difference? Is it the struts environment? Both are running on Tomcat 5.0.28. My app uses Struts 1.1 and has this preamble in web.xml http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";> The modified struts-example is from Struts 1.2.8 and has the same web.xml preamble as above. Would I be right in concluding that the difference is in the Struts version and that upgrading would solve my problem? My app has close to 100 pages, so before I start, can anybody offer some insight as to the root of the problem. Thanks. Perry Jeung - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [struts-faces] html:form vs. s:form
Craig McClanahan wrote: On 11/24/05, Laurie Harper <[EMAIL PROTECTED]> wrote: I have code for populating form beans dynamically, as follows (I'll spare you the dirty details of why I'm doing this instead of relying on Struts' standard form bean population): String formKey = Constants.FORM_KEY; getJspContext().findAttribute(formKey); String formBeanName = formTag.getBeanName(); ActionForm form = (ActionForm) getJspContext(). findAttribute(formBeanName); BeanUtils.copyProperties(form, source); Using s:form from the struts-face lib, this fails as (a) there's no instance of the form tag stored in any scope under that key; and (b) even if it were, the tag implementation class isn't type compatible with the standard Struts tag. So, the first question is should this be considered a bug in so much as s:form is documented as being functionally equivalent to html:form? Yah, that sounds like a bug ... or perhaps a change in functionality of the standard version that needs to be ported to the faces version. OK, I'll file something for that once I understand what the correct behaviour should be. And second, how would I rewrite the above code so it works equivalently with both form tags? This one will have to wait until tomorrow ... getting ready to go join the rest of my family and gorge on a bit of turkey :-). Happy Thanksgiving! Fair enough ;-) Enjoy the turkey! L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [struts-faces] html:form vs. s:form
On 11/24/05, Laurie Harper <[EMAIL PROTECTED]> wrote: > > I have code for populating form beans dynamically, as follows (I'll > spare you the dirty details of why I'm doing this instead of relying on > Struts' standard form bean population): > >String formKey = Constants.FORM_KEY; >getJspContext().findAttribute(formKey); >String formBeanName = formTag.getBeanName(); >ActionForm form = (ActionForm) getJspContext(). > findAttribute(formBeanName); >BeanUtils.copyProperties(form, source); > > Using s:form from the struts-face lib, this fails as (a) there's no > instance of the form tag stored in any scope under that key; and (b) > even if it were, the tag implementation class isn't type compatible with > the standard Struts tag. So, the first question is should this be considered a bug in so much as > s:form is documented as being functionally equivalent to html:form? Yah, that sounds like a bug ... or perhaps a change in functionality of the standard version that needs to be ported to the faces version. And second, how would I rewrite the above code so it works equivalently > with both form tags? This one will have to wait until tomorrow ... getting ready to go join the rest of my family and gorge on a bit of turkey :-). Happy Thanksgiving! L. Craig - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
[struts-faces] html:form vs. s:form
I have code for populating form beans dynamically, as follows (I'll spare you the dirty details of why I'm doing this instead of relying on Struts' standard form bean population): String formKey = Constants.FORM_KEY; getJspContext().findAttribute(formKey); String formBeanName = formTag.getBeanName(); ActionForm form = (ActionForm) getJspContext(). findAttribute(formBeanName); BeanUtils.copyProperties(form, source); Using s:form from the struts-face lib, this fails as (a) there's no instance of the form tag stored in any scope under that key; and (b) even if it were, the tag implementation class isn't type compatible with the standard Struts tag. So, the first question is should this be considered a bug in so much as s:form is documented as being functionally equivalent to html:form? And second, how would I rewrite the above code so it works equivalently with both form tags? L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem with html:form tag action property
Hi Its good taht we have found the solution, I have a question here! Why are u making two url-patterns for action servlet.i want to know the use case. coz i have never done that is there some benefit with this Regards A On 9/27/05, Jane Eisenstein <[EMAIL PROTECTED]> wrote: > > Problem solved. The problem was due to the ordering of tags in our > web.xml. When I rearranged the servlet-mappings for our action servlet > so the *.do pattern is specified last, the form tag generates a correct > action property: > > action > Main.jsp > > action > *.do > > > -Original Message- > From: Jane Eisenstein [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 27, 2005 12:06 PM > To: Struts Users Mailing List > Subject: RE: problem with html:form tag action property > > Yes I have that mapping. The form tag is not working irrespective of > whether the .do suffix is there. > > -Original Message- > From: Catherine [mailto:[EMAIL PROTECTED] > Sent: Tuesday, September 27, 2005 10:02 AM > To: user@struts.apache.org > Subject: Re:problem with html:form tag action property > > Check if you have the following entry in your web.xml. > > > ... > > > action > *.do > > > > Then in your form, you don't need to suffix .do, Struts will do that for > you: > > > Cheers, > Catherine > > > - > http://Struts_User_List.roomity.com";>roomity.com<http://roomity.com> > > roomity.com <http://roomity.com> is broadband internet. ~~1127829746411~~ > - > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
RE: problem with html:form tag action property
Jane, If I recall correctly, struts overrides the pattern each time, only using the LAST url pattern. So be careful! Regards, David -Original Message- From: Jane Eisenstein [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 27, 2005 2:10 PM To: Struts Users Mailing List Subject: RE: problem with html:form tag action property Problem solved. The problem was due to the ordering of tags in our web.xml. When I rearranged the servlet-mappings for our action servlet so the *.do pattern is specified last, the form tag generates a correct action property: action Main.jsp action *.do -Original Message- From: Jane Eisenstein [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 27, 2005 12:06 PM To: Struts Users Mailing List Subject: RE: problem with html:form tag action property Yes I have that mapping. The form tag is not working irrespective of whether the .do suffix is there. -Original Message- From: Catherine [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 27, 2005 10:02 AM To: user@struts.apache.org Subject: Re:problem with html:form tag action property Check if you have the following entry in your web.xml. ... action *.do Then in your form, you don't need to suffix .do, Struts will do that for you: Cheers, Catherine - http://Struts_User_List.roomity.com";>roomity.com roomity.com is broadband internet. ~~1127829746411~~ - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: problem with html:form tag action property
Problem solved. The problem was due to the ordering of tags in our web.xml. When I rearranged the servlet-mappings for our action servlet so the *.do pattern is specified last, the form tag generates a correct action property: action Main.jsp action *.do -Original Message- From: Jane Eisenstein [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 27, 2005 12:06 PM To: Struts Users Mailing List Subject: RE: problem with html:form tag action property Yes I have that mapping. The form tag is not working irrespective of whether the .do suffix is there. -Original Message- From: Catherine [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 27, 2005 10:02 AM To: user@struts.apache.org Subject: Re:problem with html:form tag action property Check if you have the following entry in your web.xml. ... action *.do Then in your form, you don't need to suffix .do, Struts will do that for you: Cheers, Catherine - http://Struts_User_List.roomity.com";>roomity.com roomity.com is broadband internet. ~~1127829746411~~ - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: problem with html:form tag action property
Yes I have that mapping. The form tag is not working irrespective of whether the .do suffix is there. -Original Message- From: Catherine [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 27, 2005 10:02 AM To: user@struts.apache.org Subject: Re:problem with html:form tag action property Check if you have the following entry in your web.xml. ... action *.do Then in your form, you don't need to suffix .do, Struts will do that for you: Cheers, Catherine - http://Struts_User_List.roomity.com";>roomity.com roomity.com is broadband internet. ~~1127829746411~~ - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re:problem with html:form tag action property
Check if you have the following entry in your web.xml. ... action *.do Then in your form, you don't need to suffix .do, Struts will do that for you: Cheers, Catherine - http://Struts_User_List.roomity.com";>roomity.com roomity.com is broadband internet. ~~1127829746411~~ -
RE: Re: problem with html:form tag action property
I've tried the action with and without the initial slash and with and without the .do suffix. All those versions result in the form having the same, wrong /CarePlannerWeb action. In case it matters, the action servlet is configured in web.xml as follows: action CarePlanner ActionServlet com.med.struts.action.CarePlannerActionServlet config /WEB-INF/struts-config.xml, /WEB-INF/struts-config-cpadmin.xml, /WEB-INF/struts-config-cpweb.xml, /WEB-INF/struts-config-sync.xml, /WEB-INF/struts-config-utils.xml debug 2 detail 2 2 Is it practical to step through the html:form tag's execution with a debugger and see where things are going wrong? -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper Sent: Monday, September 26, 2005 6:59 PM To: user@struts.apache.org Subject: Re: problem with html:form tag action property I think you need to remove the '.do' from the action (I'm using prefix rather than suffix mapping, though, so I could be wrong...). L. Jane Eisenstein wrote: > I am converting an existing jsp to use struts tags. I replaced the > original form tag that looked like this: > action="timeTrackingReport.do"> > with: > focus="reportStartDate"> > > The tag generates a form tag that looks like: > action="/CarePlannerWeb" target="main"> (CarePlannerWeb is the name of > the web application) > > I don't understand why the wrong form action is being generated. The > target action is defined as follows: > path="/timeTrackingReport" > parameter="targetAction" > name="timeTrackingReportForm" > scope="request" > type="com.med.struts.action.cp.timetracking.TimeTrackingReportAction" > validate="false"> >path="/WEB-INF/jsp/cpweb/timeTracking/timeTrackingEntry.jsp"/> >path="/WEB-INF/jsp/cpweb/timeTracking/timeTrackingReport.jsp"/> > > > -- > Jane Eisenstein > MEDecision, Inc. > phone: 610-540-0202 ext. 1285 > email: [EMAIL PROTECTED] > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem with html:form tag action property
I think you need to remove the '.do' from the action (I'm using prefix rather than suffix mapping, though, so I could be wrong...). L. Jane Eisenstein wrote: I am converting an existing jsp to use struts tags. I replaced the original form tag that looked like this: with: The tag generates a form tag that looks like: (CarePlannerWeb is the name of the web application) I don't understand why the wrong form action is being generated. The target action is defined as follows: -- Jane Eisenstein MEDecision, Inc. phone: 610-540-0202 ext. 1285 email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
problem with html:form tag action property
I am converting an existing jsp to use struts tags. I replaced the original form tag that looked like this: with: The tag generates a form tag that looks like: (CarePlannerWeb is the name of the web application) I don't understand why the wrong form action is being generated. The target action is defined as follows: -- Jane Eisenstein MEDecision, Inc. phone: 610-540-0202 ext. 1285 email: [EMAIL PROTECTED]
Re: How to replace normal html-from through html:form in Struts? Example
> A tag would be handy for this ... Indeed there is one, please take a look at
Re: How to replace normal html-from through html:form in Struts? Example
On Wed, September 14, 2005 11:15 am, Laurie Harper said: > I think your 'semantics' arugment may be confusing two orthogonal sets > of semantics, but I do see where you're coming from. Could be. Wouldn't be the first time :) > We're well off-topic so I'm keeping this brief, but feel free to follow > up off-list if you want to discuss further. Yeah, definitely OT now... probably no need to continue... it's not in the end a big deal either way I suppose... both our approaches work and neither is so much more right than the other (if at all) that we're going to convince everyone either way, so I'm content to call it a draw and continue on our merry ways :) > L. Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to replace normal html-from through html:form in Struts? Example
I think your 'semantics' arugment may be confusing two orthogonal sets of semantics, but I do see where you're coming from. We're well off-topic so I'm keeping this brief, but feel free to follow up off-list if you want to discuss further. L. Frank W. Zammetti wrote: On Wed, September 14, 2005 6:35 am, Laurie Harper said: I never said you *shouldn't* use 'class' to style elements :-) True enough :) That's the right answer when you want to apply the same set of styles to multiple elements (although even without the 'class' attribute here, you'd still only need to define one rule in the stylesheet... it would just jave 3 selectors). Yeah, that's true. Even still though, 3 selectors feels like a little more complexity than there needs to be. I suppose it's like preferring a++; over a=a+1; ... neither is complicated by any stretch, but the postfix just seems slightly cleaner. I know some people feel the exact opposite though, so I'm coming down to personal preference, not the basis of a strong argument :) Specifically, the first sentence of the last paragraph: "The use of ID is appropriate when a style only needs to be applied once in any document." That's another way of saying what I was trying to say above :) Note that there's no corollary there that this is in any way inappropriate, though. If I only *want* to apply styles to one element in the document, this is the way to do it. Yes, I definitely agree there is nothing saying that is inappropriate. I would still make the argument however that it semantically doesn't feel right... it's almost as if instead of saying: class B extends A { } ...I instead did something like: B b(extendsA) = new B(); That's of course not real syntax, but pretend it is :) What I'm trying to say is that it's almost like I'm tying what class B extends into the identification of an instance of B. That's what using the ID feels like to me. There's a difference between class and style, though. Class and ID are two different 'hooks' by which you can associate style with (one or more) elements. CSS provides all sorts of selectors besides class selectors, after all. True enough :) 'id' is guaranteed unique in any valid document, whereas 'class' is (obviously) not. So, if I know that the thing I want to style should occur exactly once (for example, a title at the start of an article) I can assign it an ID. By attaching styles via the ID, I can be sure those styles will never be applied anywhere else in the document, because the ID must be unique. If it's not, I'll get an error when I validate the document. On the other hand, if I use 'class' instead of 'id', that class could be re-used elsewhere in the document. That won't be caught by validation, or anything else but visual inspection of the result. Ah, gotcha. OK, so it probably not something you care about very often ;-) My point was just that, while IDs must be unique and that uniqueness is checked during validation, no such restriction applies to 'class'. Makes sense. Yeah, I'm not sure how often it would come up, but if someone knew it would be a concern, and I could see where it might be if you have a lot of page designers working in parallel, you might be able to convince me on this basis. Heh :) Have you had any experiences where using CSS ID selectors was actually bad, or caused problems? No, I can't say that I have. Ok, I will amend my original comment after this discussion... It's considered a bad practice, but only by me :) And not for any real, concrete technical reasons, just because it doesn't quite *feel* right :) L. (F)rank :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to replace normal html-from through html:form in Struts? Example
Frank W. Zammetti wrote: If I don't want to use scripting I guess I could use something like ${requestScope['org.apache.struts.action.mapping.instance'].name} But what if the Globals.MAPPING_KEY will change ... :-) That's why you want to use the field in Globals... if the key under which the mapping will be found is changed, your code doesn't need to change. If you use the value as it currently is today as you show above, you'll need to change that it someone changes the key down the road. That's the whole point of that Globals class. I think it's pretty safe to say it *wont* change, though, since not just the field but also its value are part of the public API, and Struts *is* very good about maintaining backwards compatibility, after all :-) L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to replace normal html-from through html:form in Struts? Example
On Wed, September 14, 2005 10:15 am, Tamas Szabo said: > I definitely like clean code and if I'm looking at the generated HTML > I agree that it is cleaner if you reference the form by name. > But in the JSP it's just doesn't seem right to reference a form > name that will appear only in the generated HTML, based on a config > file value. > It just doesn't seem clean ... You could make that argument :) > If I don't want to use scripting I guess I could use something like > ${requestScope['org.apache.struts.action.mapping.instance'].name} > > But what if the Globals.MAPPING_KEY will change ... :-) That's why you want to use the field in Globals... if the key under which the mapping will be found is changed, your code doesn't need to change. If you use the value as it currently is today as you show above, you'll need to change that it someone changes the key down the road. That's the whole point of that Globals class. > A tag would be handy for this ... Pretty trivial... go for it :) > Tamas Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to replace normal html-from through html:form in Struts? Example
> > I would say that the code that is yielded when you reference the form by > name is clearer and thus better regardless and I would throw away the > possibility of someone changing the name in the config file. It's more > important that the code be as explicit IMO. I definitely like clean code and if I'm looking at the generated HTML I agree that it is cleaner if you reference the form by name. But in the JSP it's just doesn't seem right to reference a form name that will appear only in the generated HTML, based on a config file value. It just doesn't seem clean ... > Isn't there a struts tag which for a given action path it gives me the > > name of the associated form? > > You mean the associated ActionForm? I don't think there is a tag to so > that specifically, but you can get at that information by doing: > > <% ActionConfig mapping = (ActionConfig)request.getAttribute( > Globals.MAPPING_KEY); %> If I don't want to use scripting I guess I could use something like ${requestScope['org.apache.struts.action.mapping.instance'].name} But what if the Globals.MAPPING_KEY will change ... :-) A tag would be handy for this ... Tamas
Re: How to replace normal html-from through html:form in Struts? Example
On Wed, September 14, 2005 6:35 am, Laurie Harper said: > I never said you *shouldn't* use 'class' to style elements :-) True enough :) > That's the right answer when you want to apply the same set of styles to > multiple elements (although even without the 'class' attribute here, > you'd still only need to define one rule in the stylesheet... it would > just jave 3 selectors). Yeah, that's true. Even still though, 3 selectors feels like a little more complexity than there needs to be. I suppose it's like preferring a++; over a=a+1; ... neither is complicated by any stretch, but the postfix just seems slightly cleaner. I know some people feel the exact opposite though, so I'm coming down to personal preference, not the basis of a strong argument :) >> Specifically, the first sentence of the last paragraph: >> >> "The use of ID is appropriate when a style only needs to be applied once >> in any document." >> >> That's another way of saying what I was trying to say above :) > > Note that there's no corollary there that this is in any way > inappropriate, though. If I only *want* to apply styles to one element > in the document, this is the way to do it. Yes, I definitely agree there is nothing saying that is inappropriate. I would still make the argument however that it semantically doesn't feel right... it's almost as if instead of saying: class B extends A { } ...I instead did something like: B b(extendsA) = new B(); That's of course not real syntax, but pretend it is :) What I'm trying to say is that it's almost like I'm tying what class B extends into the identification of an instance of B. That's what using the ID feels like to me. > There's a difference between class and style, though. Class and ID are > two different 'hooks' by which you can associate style with (one or > more) elements. CSS provides all sorts of selectors besides class > selectors, after all. True enough :) > 'id' is guaranteed unique in any valid document, whereas 'class' is > (obviously) not. So, if I know that the thing I want to style should > occur exactly once (for example, a title at the start of an article) I > can assign it an ID. By attaching styles via the ID, I can be sure those > styles will never be applied anywhere else in the document, because the > ID must be unique. If it's not, I'll get an error when I validate the > document. > > On the other hand, if I use 'class' instead of 'id', that class could be > re-used elsewhere in the document. That won't be caught by validation, > or anything else but visual inspection of the result. Ah, gotcha. > OK, so it probably not something you care about very often ;-) My point > was just that, while IDs must be unique and that uniqueness is checked > during validation, no such restriction applies to 'class'. Makes sense. Yeah, I'm not sure how often it would come up, but if someone knew it would be a concern, and I could see where it might be if you have a lot of page designers working in parallel, you might be able to convince me on this basis. > Heh :) Have you had any experiences where using CSS ID selectors was > actually bad, or caused problems? No, I can't say that I have. Ok, I will amend my original comment after this discussion... It's considered a bad practice, but only by me :) And not for any real, concrete technical reasons, just because it doesn't quite *feel* right :) > L. (F)rank :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to replace normal html-from through html:form in Struts? Example
On Wed, September 14, 2005 6:35 am, Laurie Harper said: > I never said you *shouldn't* use 'class' to style elements :-) True enough :) > That's the right answer when you want to apply the same set of styles to > multiple elements (although even without the 'class' attribute here, > you'd still only need to define one rule in the stylesheet... it would > just jave 3 selectors). Yeah, that's true. Even still though, 3 selectors feels like a little more complexity than there needs to be. I suppose it's like preferring a++; over a=a+1; ... neither is complicated by any stretch, but the postfix just seems slightly cleaner. I know some people feel the exact opposite though, so I'm coming down to personal preference, not the basis of a strong argument :) >> Specifically, the first sentence of the last paragraph: >> >> "The use of ID is appropriate when a style only needs to be applied once >> in any document." >> >> That's another way of saying what I was trying to say above :) > > Note that there's no corollary there that this is in any way > inappropriate, though. If I only *want* to apply styles to one element > in the document, this is the way to do it. Yes, I definitely agree there is nothing saying that is inappropriate. I would still make the argument however that it semantically doesn't feel right... it's almost as if instead of saying: class B extends A { } ...I instead did something like: B b(extendsA) = new B(); That's of course not real syntax, but pretend it is :) What I'm trying to say is that it's almost like I'm tying what class B extends into the identification of an instance of B. That's what using the ID feels like to me. > There's a difference between class and style, though. Class and ID are > two different 'hooks' by which you can associate style with (one or > more) elements. CSS provides all sorts of selectors besides class > selectors, after all. True enough :) > 'id' is guaranteed unique in any valid document, whereas 'class' is > (obviously) not. So, if I know that the thing I want to style should > occur exactly once (for example, a title at the start of an article) I > can assign it an ID. By attaching styles via the ID, I can be sure those > styles will never be applied anywhere else in the document, because the > ID must be unique. If it's not, I'll get an error when I validate the > document. > > On the other hand, if I use 'class' instead of 'id', that class could be > re-used elsewhere in the document. That won't be caught by validation, > or anything else but visual inspection of the result. Ah, gotcha. > OK, so it probably not something you care about very often ;-) My point > was just that, while IDs must be unique and that uniqueness is checked > during validation, no such restriction applies to 'class'. Makes sense. Yeah, I'm not sure how often it would come up, but if someone knew it would be a concern, and I could see where it might be if you have a lot of page designers working in parallel, you might be able to convince me on this basis. > Heh :) Have you had any experiences where using CSS ID selectors was > actually bad, or caused problems? No, I can't say that I have. Ok, I will amend my original comment after this discussion... It's considered a bad practice, but only by me :) And not for any real, concrete technical reasons, just because it doesn't quite *feel* right :) > L. (F)rank :) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to replace normal html-from through html:form in Struts? Example
Frank W. Zammetti wrote: Laurie Harper wrote: Why do you say that's a bad practice? It's actually both supported and recommended; in fact, the 'name' attribute is deprecated in favour of the 'id' attribute so 'id' is the only way to target CSS to a particular page element rather than an entire display class. ... OK, you could use class="something-I-made-sure-is-unique" instead of using id, but why do that and loose the ability to have uniqueness checked by validation? Exactly. class is what should be used. Well, ok, if I'm being fair, this is a debatable point, I can't point to any document somewhere that says there is a right and wrong answer. It is a bad practice to me though based on my experience :) The reason for this, in my mind, is that an ID attribute must be unique across a document so that you can uniquely address any individual element on the page by name. This makes DOM manipulation much easier, and frankly more like the back end where you are either addressing a specific object instance by name, or accessing the member of a collection. But that's maybe getting a tad off track I suppose :) ... By separating the CSS class an element uses from the ID you access it with you gain flexibility in being able to manipulate individual objects as well as change the stylesheet more precisely. More importantly perhaps, it eliminates duplication of style definitions. For example, imagine a situation where you have a series of textboxes, and you want to apply a style to each and also be able to address each individually via scripting... Ok, so I can certainly address each individually by name. But what does the stylesheet look like? It would have three styles defined that are all duplicate. Kind of inefficient. But, if you do: Now, you can still address each individually, and now they all use the same style definition. Duplication removed. I never said you *shouldn't* use 'class' to style elements :-) That's the right answer when you want to apply the same set of styles to multiple elements (although even without the 'class' attribute here, you'd still only need to define one rule in the stylesheet... it would just jave 3 selectors). Actually, I did find one reference that seems relevant: http://www.htmlhelp.com/reference/css/style-html.html#id Specifically, the first sentence of the last paragraph: "The use of ID is appropriate when a style only needs to be applied once in any document." That's another way of saying what I was trying to say above :) Note that there's no corollary there that this is in any way inappropriate, though. If I only *want* to apply styles to one element in the document, this is the way to do it. But, even putting all that aside... assigning a CSS class to an element with the ID attribute just seems wrong semantically... ID has a pretty specific meaning, it's a unique identifier. class also has a fairly specific meaning in this context, it's defining the supertype of an element (in essence), and doing it otherwise seems like fighting logic :) There's a difference between class and style, though. Class and ID are two different 'hooks' by which you can associate style with (one or more) elements. CSS provides all sorts of selectors besides class selectors, after all. I'm not sure about your validation point though... could you clarify that? You may well be pointing something out I've never considered. 'id' is guaranteed unique in any valid document, whereas 'class' is (obviously) not. So, if I know that the thing I want to style should occur exactly once (for example, a title at the start of an article) I can assign it an ID. By attaching styles via the ID, I can be sure those styles will never be applied anywhere else in the document, because the ID must be unique. If it's not, I'll get an error when I validate the document. On the other hand, if I use 'class' instead of 'id', that class could be re-used elsewhere in the document. That won't be caught by validation, or anything else but visual inspection of the result. OK, so it probably not something you care about very often ;-) My point was just that, while IDs must be unique and that uniqueness is checked during validation, no such restriction applies to 'class'. Not trying to go on the attack or anything here :-) Just curious where this is coming from... Sure, no problem at all. Like I said, I can't point to any official spec or something that says "this is the right way to do it", but I know what I have my people do and I know what has served me best over the years :) I have no doubt you and others have contrary experiences that are just as valid. Heh :) Have you had any experiences where using CSS ID selectors was actually bad, or caused problems? L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PRO
Re: How to replace normal html-from through html:form in Struts? Example
Tamas Szabo wrote: > So the whole decission comes down to: If I think that it's more likely that the name of the form will change in the action mapping(struts-config) than someone will add a new form to the jsp (before my form and without observing that I have javascript functions which rely on the position of the forms in the page) then I would use forms[0]. Otherwise I would reference the form by its name. Is this correct? I would say that the code that is yielded when you reference the form by name is clearer and thus better regardless and I would throw away the possibility of someone changing the name in the config file. It's more important that the code be as explicit IMO. Note too that you aren't really defining the name of the HTML form in the config file, not explicitly anyway... that's just a by-product of using the tag. You can simply not use those tags if you want, in which case the name of the form is strictly on your JSP. I suppose that's just an aside though :) Isn't there a struts tag which for a given action path it gives me the name of the associated form? You mean the associated ActionForm? I don't think there is a tag to so that specifically, but you can get at that information by doing: <% ActionConfig mapping = (ActionConfig)request.getAttribute( Globals.MAPPING_KEY); %> That will give you a reference to the ActionConfig associated with the request, and you can get the form name by calling getName() on it. Thanks, Tamas -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to replace normal html-from through html:form in Struts? Example
Laurie Harper wrote: Why do you say that's a bad practice? It's actually both supported and recommended; in fact, the 'name' attribute is deprecated in favour of the 'id' attribute so 'id' is the only way to target CSS to a particular page element rather than an entire display class. ... OK, you could use class="something-I-made-sure-is-unique" instead of using id, but why do that and loose the ability to have uniqueness checked by validation? Exactly. class is what should be used. Well, ok, if I'm being fair, this is a debatable point, I can't point to any document somewhere that says there is a right and wrong answer. It is a bad practice to me though based on my experience :) The reason for this, in my mind, is that an ID attribute must be unique across a document so that you can uniquely address any individual element on the page by name. This makes DOM manipulation much easier, and frankly more like the back end where you are either addressing a specific object instance by name, or accessing the member of a collection. But that's maybe getting a tad off track I suppose :) ... By separating the CSS class an element uses from the ID you access it with you gain flexibility in being able to manipulate individual objects as well as change the stylesheet more precisely. More importantly perhaps, it eliminates duplication of style definitions. For example, imagine a situation where you have a series of textboxes, and you want to apply a style to each and also be able to address each individually via scripting... Ok, so I can certainly address each individually by name. But what does the stylesheet look like? It would have three styles defined that are all duplicate. Kind of inefficient. But, if you do: Now, you can still address each individually, and now they all use the same style definition. Duplication removed. Actually, I did find one reference that seems relevant: http://www.htmlhelp.com/reference/css/style-html.html#id Specifically, the first sentence of the last paragraph: "The use of ID is appropriate when a style only needs to be applied once in any document." That's another way of saying what I was trying to say above :) But, even putting all that aside... assigning a CSS class to an element with the ID attribute just seems wrong semantically... ID has a pretty specific meaning, it's a unique identifier. class also has a fairly specific meaning in this context, it's defining the supertype of an element (in essence), and doing it otherwise seems like fighting logic :) I'm not sure about your validation point though... could you clarify that? You may well be pointing something out I've never considered. Not trying to go on the attack or anything here :-) Just curious where this is coming from... Sure, no problem at all. Like I said, I can't point to any official spec or something that says "this is the right way to do it", but I know what I have my people do and I know what has served me best over the years :) I have no doubt you and others have contrary experiences that are just as valid. Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to replace normal html-from through html:form in Struts? Example
Tamas Szabo wrote: Isn't there a struts tag which for a given action path it gives me the name of the associated form? No there isn't, though it'd be trivial to write. What you can do, though, is something like this: Note that's untested (and probably wrong!), but it really is just a couple lines of code to do this. That gives you the scripting variable name of the form bean for an enclosing tag, by the way; it won't do anything useful outside a form tag. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to replace normal html-from through html:form in Struts? Example
Frank W. Zammetti wrote: Note also that styleId is the attribute of that you want, that renders an ID attribute (unfortunate naming choice since it encourages the usage of the ID attribute to assign CSS classes, which is another bad practice IMO, but whatever, it works!). Why do you say that's a bad practice? It's actually both supported and recommended; in fact, the 'name' attribute is deprecated in favour of the 'id' attribute so 'id' is the only way to target CSS to a particular page element rather than an entire display class. OK, you could use class="something-I-made-sure-is-unique" instead of using id, but why do that and loose the ability to have uniqueness checked by validation? Not trying to go on the attack or anything here :-) Just curious where this is coming from... L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to replace normal html-from through html:form in Struts? Example
On 9/14/05, Frank W. Zammetti <[EMAIL PROTECTED]> wrote: > > It's generally something to avoid because you may at some point change > the order of your forms and then find that your code no longer works. > Think of what happens if you put a form before this one later... now the > form you want is actually form[1], and things break until you find and > change all the code. So the whole decission comes down to: If I think that it's more likely that the name of the form will change in the action mapping(struts-config) than someone will add a new form to the jsp (before my form and without observing that I have javascript functions which rely on the position of the forms in the page) then I would use forms[0]. Otherwise I would reference the form by its name. Is this correct? Isn't there a struts tag which for a given action path it gives me the name of the associated form? Thanks, Tamas
Re: How to replace normal html-from through html:form in Struts? Example
It's generally something to avoid because you may at some point change the order of your forms and then find that your code no longer works. Think of what happens if you put a form before this one later... now the form you want is actually form[1], and things break until you find and change all the code. With modern browsers your best bet is to set an ID on the form and use document.getElementById(). Note that you can also access the form using document.forms["name"] where name is of course the name attribute of the form. Note also that styleId is the attribute of that you want, that renders an ID attribute (unfortunate naming choice since it encourages the usage of the ID attribute to assign CSS classes, which is another bad practice IMO, but whatever, it works!). Frank Tamas Szabo wrote: If there is no name associated with your declared HTML form then use document.forms[0] (basically the first form defined for the HTML document) Personally I caution against using this convention as the caller does not properly identify the form (by name) Hi Martin! Why do you caution against using forms[0]? I'm not arguing against this, I'm a total newbie in javascript. I just ask because I had to reference the form and I used forms[0] despite of the fact that I'm using html:form and I have the name of the form. But the html:form is generated based on the action attribute so I thougth that if someone changes the action mapping in struts config the javascript won't break with forms[0]. Isn't the forms[0] reliable? Note that I have only one form in my jsp page. Thanks, Tamas Anyone else ? M- - Original Message - From: "Jason King" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Tuesday, September 13, 2005 11:05 AM Subject: Re: How to replace normal html-from through html:form in Struts? Example gollinger wrote: document.next.submit(); The problem I have is that the form tag in Struts has no name! Why? So how can I execute the java-script? Which name should I use instead? Regards Antonio document.form[0] or form[1] will work. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to replace normal html-from through html:form in Struts? Example
> > If there is no name associated with your declared HTML form then use > document.forms[0] (basically the first form defined for the HTML document) > Personally I caution against using this convention as the caller does not > properly identify the form (by name) Hi Martin! Why do you caution against using forms[0]? I'm not arguing against this, I'm a total newbie in javascript. I just ask because I had to reference the form and I used forms[0] despite of the fact that I'm using html:form and I have the name of the form. But the html:form is generated based on the action attribute so I thougth that if someone changes the action mapping in struts config the javascript won't break with forms[0]. Isn't the forms[0] reliable? Note that I have only one form in my jsp page. Thanks, Tamas Anyone else ? > M- > - Original Message - > From: "Jason King" <[EMAIL PROTECTED]> > To: "Struts Users Mailing List" > Sent: Tuesday, September 13, 2005 11:05 AM > Subject: Re: How to replace normal html-from through html:form in Struts? > Example > > > > gollinger wrote: > > > >> > >> > >> document.next.submit(); > >> > >> > >> > >>The problem I have is that the form tag in Struts has no name! > >> > >>Why? > >>So how can I execute the java-script? Which name should I use instead? > >> > >>Regards Antonio > >> > > document.form[0] or form[1] will work. > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
Re: How to replace normal html-from through html:form in Struts? Example
Hi, If you use the struts form tag, this will use the name of your form bean set within your struts-config for the action you are posting too. Regards, Gareth Martin Gainty wrote: Jason- If there is no name associated with your declared HTML form then use document.forms[0] (basically the first form defined for the HTML document) Personally I caution against using this convention as the caller does not properly identify the form (by name) Anyone else ? M- - Original Message - From: "Jason King" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Tuesday, September 13, 2005 11:05 AM Subject: Re: How to replace normal html-from through html:form in Struts? Example gollinger wrote: document.next.submit(); The problem I have is that the form tag in Struts has no name! Why? So how can I execute the java-script? Which name should I use instead? Regards Antonio document.form[0] or form[1] will work. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Gareth Evans MSoft eSolutions Limited Technology Centre Inward Way Rossmore Business Park Ellesmere Port Cheshire CH65 3EN -- Tel:+44 (0)870 0100 704 Fax:+44 (0)870 9010 705 E-Mail: [EMAIL PROTECTED] Web:www.msoft.co.uk -- Terms: Please note that any prices quoted within this e-mail are subject to VAT. All program details and code described in this e-mail are subject to copyright © of MSoft eSolutions Limited and remain the intellectual property of MSoft eSolutions Limited. Any proposal or pricing information contained within this e-mail are subject to MSoft eSolutions' Terms and Conditions -- Disclaimer: This message is intended only for use of the addressee. If this message was sent to you in error, please notify the sender and delete this message. MSoft eSolutions Limited cannot accept responsibility for viruses, so please scan attachments. Views expressed in this message do not necessarily reflect those of MSoft eSolutions Limited who will not necessarily be bound by its contents. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to replace normal html-from through html:form in Struts? Example
I'll agree that's a poor answer. The best answer is to fix the tag so it always generates a name, but sometimes a fast answer is the one you have to take. Martin Gainty wrote: Jason- If there is no name associated with your declared HTML form then use document.forms[0] (basically the first form defined for the HTML document) Personally I caution against using this convention as the caller does not properly identify the form (by name) Anyone else ? M- - Original Message - From: "Jason King" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Tuesday, September 13, 2005 11:05 AM Subject: Re: How to replace normal html-from through html:form in Struts? Example gollinger wrote: document.next.submit(); The problem I have is that the form tag in Struts has no name! Why? So how can I execute the java-script? Which name should I use instead? Regards Antonio document.form[0] or form[1] will work. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to replace normal html-from through html:form in Struts? Example
Jason- If there is no name associated with your declared HTML form then use document.forms[0] (basically the first form defined for the HTML document) Personally I caution against using this convention as the caller does not properly identify the form (by name) Anyone else ? M- - Original Message - From: "Jason King" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Tuesday, September 13, 2005 11:05 AM Subject: Re: How to replace normal html-from through html:form in Struts? Example gollinger wrote: document.next.submit(); The problem I have is that the form tag in Struts has no name! Why? So how can I execute the java-script? Which name should I use instead? Regards Antonio document.form[0] or form[1] will work. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to replace normal html-from through html:form in Struts? Example
gollinger wrote: document.next.submit(); The problem I have is that the form tag in Struts has no name! Why? So how can I execute the java-script? Which name should I use instead? Regards Antonio document.form[0] or form[1] will work. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to replace normal html-from through html:form in Struts? Example
document.next.submit(); The problem I have is that the form tag in Struts has no name! Why? So how can I execute the java-script? Which name should I use instead? Regards Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:form not generating name="" attribute
On Saturday at 9:36am, DB=>Don Brown <[EMAIL PROTECTED]> wrote: DB> Ok, I looked at the 1.2.7 source, and indeed, it doesn't generate an DB> "id" or"name" if xhtml mode is on. You are correct, the styleId is a DB> good workaround, especially if you use the commons-validator checked DB> out from trunk. DB> DB> Don This is fixed in subverion: http://issues.apache.org/bugzilla/show_bug.cgi?id=35127 and needs to be used with commons validator (latest subversion as well). -- Haroon Rafique <[EMAIL PROTECTED]> - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]